paid-python 0.4.1a0__py3-none-any.whl → 0.5.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. paid/__init__.py +42 -4
  2. paid/agents/client.py +32 -0
  3. paid/agents/raw_client.py +32 -0
  4. paid/client.py +25 -2
  5. paid/core/client_wrapper.py +2 -3
  6. paid/customers/client.py +168 -36
  7. paid/customers/raw_client.py +217 -36
  8. paid/errors/__init__.py +2 -1
  9. paid/errors/internal_server_error.py +11 -0
  10. paid/orders/lines/client.py +0 -4
  11. paid/plans/__init__.py +4 -0
  12. paid/plans/client.py +261 -0
  13. paid/plans/raw_client.py +345 -0
  14. paid/products/__init__.py +7 -0
  15. paid/products/client.py +788 -0
  16. paid/products/raw_client.py +807 -0
  17. paid/products/types/__init__.py +7 -0
  18. paid/products/types/product_create_type.py +5 -0
  19. paid/traces/__init__.py +4 -0
  20. paid/traces/client.py +218 -0
  21. paid/traces/raw_client.py +226 -0
  22. paid/tracing/context_manager.py +9 -4
  23. paid/types/__init__.py +32 -2
  24. paid/types/cost_trace.py +6 -1
  25. paid/types/customer.py +4 -3
  26. paid/types/customer_update.py +4 -2
  27. paid/types/order_line_attribute_create_one.py +5 -0
  28. paid/types/order_line_create.py +26 -5
  29. paid/types/pagination_meta.py +26 -0
  30. paid/types/plan.py +81 -0
  31. paid/types/plan_plan_products_item.py +35 -0
  32. paid/types/plan_plan_products_item_plan_product_attribute_item.py +34 -0
  33. paid/types/product.py +56 -0
  34. paid/types/product_type.py +5 -0
  35. paid/types/product_update.py +36 -0
  36. paid/types/product_update_type.py +5 -0
  37. paid/types/signal.py +17 -5
  38. paid/types/signal_v_2.py +56 -0
  39. paid/types/trace.py +69 -0
  40. paid/types/traces_response.py +26 -0
  41. paid/types/{order_line_attribute_create.py → usage_pagination_meta.py} +16 -8
  42. paid/types/usage_summaries_response.py +26 -0
  43. paid/types/usage_summary.py +121 -0
  44. paid/types/usage_summary_order.py +26 -0
  45. paid/types/usage_summary_order_line.py +26 -0
  46. paid/usage/__init__.py +3 -0
  47. paid/usage/client.py +206 -0
  48. paid/usage/raw_client.py +283 -0
  49. paid/usage/types/__init__.py +7 -0
  50. paid/usage/types/usage_check_usage_response.py +53 -0
  51. {paid_python-0.4.1a0.dist-info → paid_python-0.5.0.dist-info}/METADATA +20 -20
  52. {paid_python-0.4.1a0.dist-info → paid_python-0.5.0.dist-info}/RECORD +54 -25
  53. {paid_python-0.4.1a0.dist-info → paid_python-0.5.0.dist-info}/LICENSE +0 -0
  54. {paid_python-0.4.1a0.dist-info → paid_python-0.5.0.dist-info}/WHEEL +0 -0
@@ -6,22 +6,36 @@ import pydantic
6
6
  import typing_extensions
7
7
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
8
  from ..core.serialization import FieldMetadata
9
- from .order_line_attribute_create import OrderLineAttributeCreate
9
+ from .order_line_attribute_create_one import OrderLineAttributeCreateOne
10
10
 
11
11
 
12
12
  class OrderLineCreate(UniversalBaseModel):
13
+ product_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="productId")] = pydantic.Field(
14
+ default=None
15
+ )
16
+ """
17
+ Paid's internal ID for the product
18
+ """
19
+
20
+ product_external_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="productExternalId")] = (
21
+ pydantic.Field(default=None)
22
+ )
23
+ """
24
+ The external ID of the product i.e. the id within your system
25
+ """
26
+
13
27
  agent_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="agentId")] = pydantic.Field(
14
28
  default=None
15
29
  )
16
30
  """
17
- Paid's internal ID for the agent/product
31
+ DEPRECATED: Use productId instead. Paid's internal ID for the agent/product
18
32
  """
19
33
 
20
34
  agent_external_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="agentExternalId")] = (
21
35
  pydantic.Field(default=None)
22
36
  )
23
37
  """
24
- The external ID of the agent/product i.e. the id within your system
38
+ DEPRECATED: Use productExternalId instead. The external ID of the agent/product i.e. the id within your system
25
39
  """
26
40
 
27
41
  name: typing.Optional[str] = pydantic.Field(default=None)
@@ -34,11 +48,18 @@ class OrderLineCreate(UniversalBaseModel):
34
48
  Description of the order line
35
49
  """
36
50
 
51
+ product_attribute: typing_extensions.Annotated[
52
+ typing.Optional[typing.List[OrderLineAttributeCreateOne]], FieldMetadata(alias="ProductAttribute")
53
+ ] = pydantic.Field(default=None)
54
+ """
55
+ Optional array of custom product attributes to override default pricing, allowing per customer pricing. If not provided, attributes will be auto-generated from the product definition.
56
+ """
57
+
37
58
  agent_attributes: typing_extensions.Annotated[
38
- typing.Optional[typing.List[OrderLineAttributeCreate]], FieldMetadata(alias="agentAttributes")
59
+ typing.Optional[typing.List[OrderLineAttributeCreateOne]], FieldMetadata(alias="agentAttributes")
39
60
  ] = pydantic.Field(default=None)
40
61
  """
41
- Optional array of custom agent attributes to override default pricing, allowing per customer pricing. If not provided, attributes will be auto-generated from the product definition.
62
+ DEPRECATED: Use ProductAttribute instead. Optional array of custom agent attributes to override default pricing, allowing per customer pricing. If not provided, attributes will be auto-generated from the product definition.
42
63
  """
43
64
 
44
65
  if IS_PYDANTIC_V2:
@@ -48,6 +48,32 @@ class PaginationMeta(UniversalBaseModel):
48
48
  The endTime filter that was applied (if any)
49
49
  """
50
50
 
51
+ external_customer_id: typing_extensions.Annotated[
52
+ typing.Optional[str], FieldMetadata(alias="externalCustomerId")
53
+ ] = pydantic.Field(default=None)
54
+ """
55
+ The externalCustomerId filter that was applied (if any)
56
+ """
57
+
58
+ external_product_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="externalProductId")] = (
59
+ pydantic.Field(default=None)
60
+ )
61
+ """
62
+ The externalProductId filter that was applied (if any)
63
+ """
64
+
65
+ external_agent_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="externalAgentId")] = (
66
+ pydantic.Field(default=None)
67
+ )
68
+ """
69
+ DEPRECATED: Use externalProductId instead. The externalAgentId filter that was applied (if any)
70
+ """
71
+
72
+ metadata: typing.Optional[str] = pydantic.Field(default=None)
73
+ """
74
+ The metadata filter that was applied (if any)
75
+ """
76
+
51
77
  if IS_PYDANTIC_V2:
52
78
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
53
79
  else:
paid/types/plan.py ADDED
@@ -0,0 +1,81 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ import pydantic
7
+ import typing_extensions
8
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
9
+ from ..core.serialization import FieldMetadata
10
+ from .plan_plan_products_item import PlanPlanProductsItem
11
+
12
+
13
+ class Plan(UniversalBaseModel):
14
+ """
15
+ A plan containing products and their attributes
16
+ """
17
+
18
+ id: str = pydantic.Field()
19
+ """
20
+ The unique identifier of the plan
21
+ """
22
+
23
+ organization_id: typing_extensions.Annotated[str, FieldMetadata(alias="organizationId")] = pydantic.Field()
24
+ """
25
+ The organization ID that owns this plan
26
+ """
27
+
28
+ plan_group_id: typing_extensions.Annotated[str, FieldMetadata(alias="planGroupId")] = pydantic.Field()
29
+ """
30
+ The plan group ID this plan belongs to
31
+ """
32
+
33
+ name: str = pydantic.Field()
34
+ """
35
+ The name of the plan
36
+ """
37
+
38
+ description: typing.Optional[str] = pydantic.Field(default=None)
39
+ """
40
+ The description of the plan
41
+ """
42
+
43
+ next_plan_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="nextPlanId")] = pydantic.Field(
44
+ default=None
45
+ )
46
+ """
47
+ The ID of the next plan in the sequence
48
+ """
49
+
50
+ prev_plan_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="prevPlanId")] = pydantic.Field(
51
+ default=None
52
+ )
53
+ """
54
+ The ID of the previous plan in the sequence
55
+ """
56
+
57
+ created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field()
58
+ """
59
+ When the plan was created
60
+ """
61
+
62
+ updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field()
63
+ """
64
+ When the plan was last updated
65
+ """
66
+
67
+ plan_products: typing_extensions.Annotated[
68
+ typing.Optional[typing.List[PlanPlanProductsItem]], FieldMetadata(alias="planProducts")
69
+ ] = pydantic.Field(default=None)
70
+ """
71
+ The products included in this plan
72
+ """
73
+
74
+ if IS_PYDANTIC_V2:
75
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
76
+ else:
77
+
78
+ class Config:
79
+ frozen = True
80
+ smart_union = True
81
+ extra = pydantic.Extra.allow
@@ -0,0 +1,35 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ import pydantic
7
+ import typing_extensions
8
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
9
+ from ..core.serialization import FieldMetadata
10
+ from .plan_plan_products_item_plan_product_attribute_item import PlanPlanProductsItemPlanProductAttributeItem
11
+
12
+
13
+ class PlanPlanProductsItem(UniversalBaseModel):
14
+ id: typing.Optional[str] = None
15
+ organization_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="organizationId")] = None
16
+ plan_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="planId")] = None
17
+ product_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="productId")] = None
18
+ created_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="createdAt")] = None
19
+ updated_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="updatedAt")] = None
20
+ plan_product_attribute: typing_extensions.Annotated[
21
+ typing.Optional[typing.List[PlanPlanProductsItemPlanProductAttributeItem]],
22
+ FieldMetadata(alias="planProductAttribute"),
23
+ ] = pydantic.Field(default=None)
24
+ """
25
+ The product attributes with pricing for this plan
26
+ """
27
+
28
+ if IS_PYDANTIC_V2:
29
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
30
+ else:
31
+
32
+ class Config:
33
+ frozen = True
34
+ smart_union = True
35
+ extra = pydantic.Extra.allow
@@ -0,0 +1,34 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ import pydantic
7
+ import typing_extensions
8
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
9
+ from ..core.serialization import FieldMetadata
10
+
11
+
12
+ class PlanPlanProductsItemPlanProductAttributeItem(UniversalBaseModel):
13
+ id: typing.Optional[str] = None
14
+ organization_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="organizationId")] = None
15
+ plan_product_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="planProductId")] = None
16
+ product_attribute_id: typing_extensions.Annotated[
17
+ typing.Optional[str], FieldMetadata(alias="productAttributeId")
18
+ ] = None
19
+ pricing: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
20
+ """
21
+ The pricing configuration for this attribute
22
+ """
23
+
24
+ created_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="createdAt")] = None
25
+ updated_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="updatedAt")] = None
26
+
27
+ if IS_PYDANTIC_V2:
28
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
29
+ else:
30
+
31
+ class Config:
32
+ frozen = True
33
+ smart_union = True
34
+ extra = pydantic.Extra.allow
paid/types/product.py ADDED
@@ -0,0 +1,56 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ import pydantic
7
+ import typing_extensions
8
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
9
+ from ..core.serialization import FieldMetadata
10
+ from .agent_attribute import AgentAttribute
11
+ from .product_type import ProductType
12
+
13
+
14
+ class Product(UniversalBaseModel):
15
+ """
16
+ A product in the Paid system (previously called Agent)
17
+ """
18
+
19
+ id: str
20
+ external_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="externalId")] = None
21
+ display_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="displayId")] = pydantic.Field(
22
+ default=None
23
+ )
24
+ """
25
+ Human-readable display ID
26
+ """
27
+
28
+ organization_id: typing_extensions.Annotated[str, FieldMetadata(alias="organizationId")]
29
+ name: str
30
+ description: typing.Optional[str] = None
31
+ type: ProductType = pydantic.Field()
32
+ """
33
+ The type of product
34
+ """
35
+
36
+ active: bool
37
+ product_code: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="productCode")] = None
38
+ product_attribute: typing_extensions.Annotated[
39
+ typing.Optional[typing.List[AgentAttribute]], FieldMetadata(alias="ProductAttribute")
40
+ ] = pydantic.Field(default=None)
41
+ """
42
+ Pricing attributes for this product
43
+ """
44
+
45
+ metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
46
+ created_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="createdAt")] = None
47
+ updated_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="updatedAt")] = None
48
+
49
+ if IS_PYDANTIC_V2:
50
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
51
+ else:
52
+
53
+ class Config:
54
+ frozen = True
55
+ smart_union = True
56
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ProductType = typing.Union[typing.Literal["agent", "product", "prepaidCreditBundle"], typing.Any]
@@ -0,0 +1,36 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ..core.serialization import FieldMetadata
9
+ from .agent_attribute import AgentAttribute
10
+ from .product_update_type import ProductUpdateType
11
+
12
+
13
+ class ProductUpdate(UniversalBaseModel):
14
+ name: typing.Optional[str] = None
15
+ description: typing.Optional[str] = None
16
+ external_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="externalId")] = None
17
+ type: typing.Optional[ProductUpdateType] = None
18
+ active: typing.Optional[bool] = None
19
+ product_code: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="productCode")] = None
20
+ product_attribute: typing_extensions.Annotated[
21
+ typing.Optional[typing.List[AgentAttribute]], FieldMetadata(alias="ProductAttribute")
22
+ ] = pydantic.Field(default=None)
23
+ """
24
+ Pricing attributes for this product
25
+ """
26
+
27
+ metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
28
+
29
+ if IS_PYDANTIC_V2:
30
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
31
+ else:
32
+
33
+ class Config:
34
+ frozen = True
35
+ smart_union = True
36
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ProductUpdateType = typing.Union[typing.Literal["agent", "product", "prepaidCreditBundle"], typing.Any]
paid/types/signal.py CHANGED
@@ -7,12 +7,24 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
 
8
8
 
9
9
  class Signal(UniversalBaseModel):
10
+ """
11
+ DEPRECATED: Use SignalV2 instead for cleaner field names.
12
+ """
13
+
10
14
  event_name: typing.Optional[str] = None
11
- agent_id: typing.Optional[str] = None
12
- external_agent_id: typing.Optional[str] = None
13
- customer_id: typing.Optional[str] = None
15
+ agent_id: typing.Optional[str] = pydantic.Field(default=None)
16
+ """
17
+ DEPRECATED: Use product_id in SignalV2 instead.
18
+ """
19
+
20
+ external_agent_id: typing.Optional[str] = pydantic.Field(default=None)
21
+ """
22
+ DEPRECATED: Use external_product_id in SignalV2 instead.
23
+ """
24
+
25
+ customer_id: typing.Optional[str] = pydantic.Field(default=None)
14
26
  """
15
- Deprecated. The external customer id. Use `external_customer_id` or `internal_customer_id` instead.
27
+ DEPRECATED: The external customer id. Use `external_customer_id` or `internal_customer_id` instead.
16
28
  """
17
29
 
18
30
  data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
@@ -23,7 +35,7 @@ class Signal(UniversalBaseModel):
23
35
 
24
36
  internal_customer_id: typing.Optional[str] = pydantic.Field(default=None)
25
37
  """
26
- Paid's internal customer ID
38
+ DEPRECATED: Use customer_id in SignalV2 instead. This was Paid's internal customer ID.
27
39
  """
28
40
 
29
41
  external_customer_id: typing.Optional[str] = pydantic.Field(default=None)
@@ -0,0 +1,56 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class SignalV2(UniversalBaseModel):
10
+ """
11
+ V2 signal schema with clean field names. Use either internal IDs (product_id, customer_id) or external IDs (external_product_id, external_customer_id).
12
+ """
13
+
14
+ event_name: str = pydantic.Field()
15
+ """
16
+ The name of the event being tracked
17
+ """
18
+
19
+ product_id: typing.Optional[str] = pydantic.Field(default=None)
20
+ """
21
+ Paid's internal product ID. Use either this OR external_product_id.
22
+ """
23
+
24
+ external_product_id: typing.Optional[str] = pydantic.Field(default=None)
25
+ """
26
+ Your system's product ID. Use either this OR product_id.
27
+ """
28
+
29
+ customer_id: typing.Optional[str] = pydantic.Field(default=None)
30
+ """
31
+ Paid's internal customer ID. Use either this OR external_customer_id.
32
+ """
33
+
34
+ external_customer_id: typing.Optional[str] = pydantic.Field(default=None)
35
+ """
36
+ Your system's customer ID. Use either this OR customer_id.
37
+ """
38
+
39
+ data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
40
+ """
41
+ Optional additional data/metadata for the signal
42
+ """
43
+
44
+ idempotency_key: typing.Optional[str] = pydantic.Field(default=None)
45
+ """
46
+ A unique key to ensure idempotent signal processing
47
+ """
48
+
49
+ if IS_PYDANTIC_V2:
50
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
51
+ else:
52
+
53
+ class Config:
54
+ frozen = True
55
+ smart_union = True
56
+ extra = pydantic.Extra.allow
paid/types/trace.py ADDED
@@ -0,0 +1,69 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ..core.serialization import FieldMetadata
9
+ from .cost_amount import CostAmount
10
+
11
+
12
+ class Trace(UniversalBaseModel):
13
+ """
14
+ A single cost trace record with customer and product info
15
+ """
16
+
17
+ name: str = pydantic.Field()
18
+ """
19
+ The name/type of the operation (e.g., "trace.openai.agents.on_agent")
20
+ """
21
+
22
+ vendor: str = pydantic.Field()
23
+ """
24
+ The vendor/provider (e.g., "openai", "anthropic", "mistral")
25
+ """
26
+
27
+ model: str = pydantic.Field()
28
+ """
29
+ The model used for the operation (e.g., "gpt-4o-mini", "claude-3-sonnet")
30
+ """
31
+
32
+ cost: CostAmount
33
+ start_time_unix_nano: typing_extensions.Annotated[str, FieldMetadata(alias="startTimeUnixNano")] = pydantic.Field()
34
+ """
35
+ Unix timestamp in nanoseconds when the operation started
36
+ """
37
+
38
+ end_time_unix_nano: typing_extensions.Annotated[str, FieldMetadata(alias="endTimeUnixNano")] = pydantic.Field()
39
+ """
40
+ Unix timestamp in nanoseconds when the operation completed
41
+ """
42
+
43
+ attributes: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
44
+ """
45
+ Additional metadata about the trace (e.g., tokens, etc.)
46
+ """
47
+
48
+ customer_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="customerId")] = pydantic.Field(
49
+ default=None
50
+ )
51
+ """
52
+ The internal customer ID associated with this trace
53
+ """
54
+
55
+ product_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="productId")] = pydantic.Field(
56
+ default=None
57
+ )
58
+ """
59
+ The product/agent ID associated with this trace (optional)
60
+ """
61
+
62
+ if IS_PYDANTIC_V2:
63
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
64
+ else:
65
+
66
+ class Config:
67
+ frozen = True
68
+ smart_union = True
69
+ extra = pydantic.Extra.allow
@@ -0,0 +1,26 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .pagination_meta import PaginationMeta
8
+ from .trace import Trace
9
+
10
+
11
+ class TracesResponse(UniversalBaseModel):
12
+ """
13
+ Response containing cost traces and pagination metadata
14
+ """
15
+
16
+ traces: typing.List[Trace]
17
+ meta: PaginationMeta
18
+
19
+ if IS_PYDANTIC_V2:
20
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
21
+ else:
22
+
23
+ class Config:
24
+ frozen = True
25
+ smart_union = True
26
+ extra = pydantic.Extra.allow
@@ -6,23 +6,31 @@ import pydantic
6
6
  import typing_extensions
7
7
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
8
  from ..core.serialization import FieldMetadata
9
- from .order_line_attribute_pricing import OrderLineAttributePricing
10
9
 
11
10
 
12
- class OrderLineAttributeCreate(UniversalBaseModel):
13
- agent_attribute_name: typing_extensions.Annotated[str, FieldMetadata(alias="agentAttributeName")] = pydantic.Field()
11
+ class UsagePaginationMeta(UniversalBaseModel):
14
12
  """
15
- The name of the agent attribute to override (e.g., "api_call", "call_placed")
13
+ Pagination metadata for usage summaries
16
14
  """
17
15
 
18
- quantity: typing.Optional[float] = pydantic.Field(default=None)
16
+ limit: int = pydantic.Field()
19
17
  """
20
- Quantity for this attribute (defaults to 0)
18
+ The requested limit
21
19
  """
22
20
 
23
- pricing: OrderLineAttributePricing = pydantic.Field()
21
+ offset: int = pydantic.Field()
24
22
  """
25
- Custom pricing configuration for this attribute
23
+ The requested offset
24
+ """
25
+
26
+ total: int = pydantic.Field()
27
+ """
28
+ Total number of usage summaries available
29
+ """
30
+
31
+ has_more: typing_extensions.Annotated[bool, FieldMetadata(alias="hasMore")] = pydantic.Field()
32
+ """
33
+ Whether there are more results available
26
34
  """
27
35
 
28
36
  if IS_PYDANTIC_V2:
@@ -0,0 +1,26 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .usage_pagination_meta import UsagePaginationMeta
8
+ from .usage_summary import UsageSummary
9
+
10
+
11
+ class UsageSummariesResponse(UniversalBaseModel):
12
+ """
13
+ Response containing usage summaries and pagination metadata
14
+ """
15
+
16
+ data: typing.List[UsageSummary]
17
+ pagination: UsagePaginationMeta
18
+
19
+ if IS_PYDANTIC_V2:
20
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
21
+ else:
22
+
23
+ class Config:
24
+ frozen = True
25
+ smart_union = True
26
+ extra = pydantic.Extra.allow