@openmeter/client 1.0.0-beta.228

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 (122) hide show
  1. package/README.md +318 -0
  2. package/dist/core.d.ts +10 -0
  3. package/dist/core.js +38 -0
  4. package/dist/funcs/addons.d.ts +11 -0
  5. package/dist/funcs/addons.js +49 -0
  6. package/dist/funcs/apps.d.ts +6 -0
  7. package/dist/funcs/apps.js +18 -0
  8. package/dist/funcs/billing.d.ts +9 -0
  9. package/dist/funcs/billing.js +35 -0
  10. package/dist/funcs/currencies.d.ts +8 -0
  11. package/dist/funcs/currencies.js +35 -0
  12. package/dist/funcs/customers.d.ts +21 -0
  13. package/dist/funcs/customers.js +127 -0
  14. package/dist/funcs/defaults.d.ts +6 -0
  15. package/dist/funcs/defaults.js +13 -0
  16. package/dist/funcs/entitlements.d.ts +5 -0
  17. package/dist/funcs/entitlements.js +10 -0
  18. package/dist/funcs/events.d.ts +6 -0
  19. package/dist/funcs/events.js +19 -0
  20. package/dist/funcs/features.d.ts +10 -0
  21. package/dist/funcs/features.js +43 -0
  22. package/dist/funcs/governance.d.ts +5 -0
  23. package/dist/funcs/governance.js +12 -0
  24. package/dist/funcs/index.d.ts +17 -0
  25. package/dist/funcs/index.js +17 -0
  26. package/dist/funcs/llmCost.d.ts +9 -0
  27. package/dist/funcs/llmCost.js +40 -0
  28. package/dist/funcs/meters.d.ts +10 -0
  29. package/dist/funcs/meters.js +43 -0
  30. package/dist/funcs/planAddons.d.ts +9 -0
  31. package/dist/funcs/planAddons.js +37 -0
  32. package/dist/funcs/plans.d.ts +11 -0
  33. package/dist/funcs/plans.js +49 -0
  34. package/dist/funcs/subscriptions.d.ts +12 -0
  35. package/dist/funcs/subscriptions.js +59 -0
  36. package/dist/funcs/tax.d.ts +9 -0
  37. package/dist/funcs/tax.js +36 -0
  38. package/dist/index.d.ts +42 -0
  39. package/dist/index.js +23 -0
  40. package/dist/lib/config.d.ts +14 -0
  41. package/dist/lib/config.js +13 -0
  42. package/dist/lib/encodings.d.ts +8 -0
  43. package/dist/lib/encodings.js +56 -0
  44. package/dist/lib/request.d.ts +3 -0
  45. package/dist/lib/request.js +11 -0
  46. package/dist/lib/to-error.d.ts +2 -0
  47. package/dist/lib/to-error.js +16 -0
  48. package/dist/lib/types.d.ts +15 -0
  49. package/dist/lib/types.js +13 -0
  50. package/dist/models/errors.d.ts +16 -0
  51. package/dist/models/errors.js +28 -0
  52. package/dist/models/operations/addons.d.ts +38 -0
  53. package/dist/models/operations/addons.js +2 -0
  54. package/dist/models/operations/apps.d.ts +17 -0
  55. package/dist/models/operations/apps.js +2 -0
  56. package/dist/models/operations/billing.d.ts +26 -0
  57. package/dist/models/operations/billing.js +2 -0
  58. package/dist/models/operations/currencies.d.ts +35 -0
  59. package/dist/models/operations/currencies.js +2 -0
  60. package/dist/models/operations/customers.d.ts +117 -0
  61. package/dist/models/operations/customers.js +2 -0
  62. package/dist/models/operations/defaults.d.ts +6 -0
  63. package/dist/models/operations/defaults.js +2 -0
  64. package/dist/models/operations/entitlements.d.ts +6 -0
  65. package/dist/models/operations/entitlements.js +2 -0
  66. package/dist/models/operations/events.d.ts +13 -0
  67. package/dist/models/operations/events.js +2 -0
  68. package/dist/models/operations/features.d.ts +35 -0
  69. package/dist/models/operations/features.js +2 -0
  70. package/dist/models/operations/governance.d.ts +9 -0
  71. package/dist/models/operations/governance.js +2 -0
  72. package/dist/models/operations/llmCost.d.ts +35 -0
  73. package/dist/models/operations/llmCost.js +2 -0
  74. package/dist/models/operations/meters.d.ts +35 -0
  75. package/dist/models/operations/meters.js +2 -0
  76. package/dist/models/operations/planAddons.d.ts +34 -0
  77. package/dist/models/operations/planAddons.js +2 -0
  78. package/dist/models/operations/plans.d.ts +38 -0
  79. package/dist/models/operations/plans.js +2 -0
  80. package/dist/models/operations/subscriptions.d.ts +52 -0
  81. package/dist/models/operations/subscriptions.js +2 -0
  82. package/dist/models/operations/tax.d.ts +28 -0
  83. package/dist/models/operations/tax.js +2 -0
  84. package/dist/models/schemas.d.ts +11372 -0
  85. package/dist/models/schemas.js +4026 -0
  86. package/dist/models/types.d.ts +3385 -0
  87. package/dist/models/types.js +2 -0
  88. package/dist/sdk/addons.d.ts +15 -0
  89. package/dist/sdk/addons.js +30 -0
  90. package/dist/sdk/apps.d.ts +10 -0
  91. package/dist/sdk/apps.js +15 -0
  92. package/dist/sdk/billing.d.ts +13 -0
  93. package/dist/sdk/billing.js +24 -0
  94. package/dist/sdk/currencies.d.ts +12 -0
  95. package/dist/sdk/currencies.js +21 -0
  96. package/dist/sdk/customers.d.ts +67 -0
  97. package/dist/sdk/customers.js +130 -0
  98. package/dist/sdk/defaults.d.ts +10 -0
  99. package/dist/sdk/defaults.js +15 -0
  100. package/dist/sdk/entitlements.d.ts +9 -0
  101. package/dist/sdk/entitlements.js +12 -0
  102. package/dist/sdk/events.d.ts +10 -0
  103. package/dist/sdk/events.js +15 -0
  104. package/dist/sdk/features.d.ts +14 -0
  105. package/dist/sdk/features.js +27 -0
  106. package/dist/sdk/governance.d.ts +9 -0
  107. package/dist/sdk/governance.js +12 -0
  108. package/dist/sdk/llmCost.d.ts +13 -0
  109. package/dist/sdk/llmCost.js +24 -0
  110. package/dist/sdk/meters.d.ts +14 -0
  111. package/dist/sdk/meters.js +27 -0
  112. package/dist/sdk/planAddons.d.ts +13 -0
  113. package/dist/sdk/planAddons.js +24 -0
  114. package/dist/sdk/plans.d.ts +15 -0
  115. package/dist/sdk/plans.js +30 -0
  116. package/dist/sdk/sdk.d.ts +52 -0
  117. package/dist/sdk/sdk.js +84 -0
  118. package/dist/sdk/subscriptions.d.ts +16 -0
  119. package/dist/sdk/subscriptions.js +33 -0
  120. package/dist/sdk/tax.d.ts +13 -0
  121. package/dist/sdk/tax.js +24 -0
  122. package/package.json +33 -0
@@ -0,0 +1,4026 @@
1
+ import { z } from "zod";
2
+ export const labels = z
3
+ .record(z.string(), z.string())
4
+ .describe("Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with \"kong\", \"konnect\", \"mesh\", \"kic\", or \"\\_\".");
5
+ export const currencyCode = z
6
+ .string()
7
+ .min(3)
8
+ .max(3)
9
+ .regex(new RegExp("^[A-Z]{3}$"))
10
+ .describe("Three-letter [ISO4217](https://www.iso.org/iso-4217-currency-codes.html) currency code. Custom three-letter currency codes are also supported for convenience.");
11
+ export const numeric = z
12
+ .string()
13
+ .regex(new RegExp("^\\-?[0-9]+(\\.[0-9]+)?$"))
14
+ .describe("Numeric represents an arbitrary precision number.");
15
+ export const cursorPaginationQueryPage = z
16
+ .object({
17
+ size: z
18
+ .number()
19
+ .int()
20
+ .optional()
21
+ .describe("The number of items to include per page."),
22
+ after: z
23
+ .string()
24
+ .optional()
25
+ .describe("Request the next page of data, starting with the item after this parameter."),
26
+ before: z
27
+ .string()
28
+ .optional()
29
+ .describe("Request the previous page of data, starting with the item before this parameter."),
30
+ })
31
+ .describe("Determines which page of the collection to retrieve.");
32
+ export const stringFieldFilter = z
33
+ .union([
34
+ z.string(),
35
+ z.object({
36
+ eq: z
37
+ .string()
38
+ .optional()
39
+ .describe("Value strictly equals the given string value."),
40
+ neq: z
41
+ .string()
42
+ .optional()
43
+ .describe("Value does not equal the given string value."),
44
+ contains: z
45
+ .string()
46
+ .optional()
47
+ .describe("Value contains the given string value (fuzzy match)."),
48
+ ocontains: z
49
+ .array(z.string())
50
+ .optional()
51
+ .describe("Returns entities that fuzzy-match any of the comma-delimited phrases in the filter string."),
52
+ oeq: z
53
+ .array(z.string())
54
+ .optional()
55
+ .describe("Returns entities that exact match any of the comma-delimited phrases in the filter string."),
56
+ gt: z
57
+ .string()
58
+ .optional()
59
+ .describe("Value is greater than the given string value (lexicographic compare)."),
60
+ gte: z
61
+ .string()
62
+ .optional()
63
+ .describe("Value is greater than or equal to the given string value (lexicographic compare)."),
64
+ lt: z
65
+ .string()
66
+ .optional()
67
+ .describe("Value is less than the given string value (lexicographic compare)."),
68
+ lte: z
69
+ .string()
70
+ .optional()
71
+ .describe("Value is less than or equal to the given string value (lexicographic compare)."),
72
+ exists: z
73
+ .boolean()
74
+ .optional()
75
+ .describe("When true, the field must be present (non-null); when false, the field must be absent (null)."),
76
+ })
77
+ ])
78
+ .describe("Filters on the given string field value by either exact or fuzzy match. All properties are optional; provide exactly one to specify the comparison.");
79
+ export const ulid = z
80
+ .string()
81
+ .regex(new RegExp("^[0-7][0-9A-HJKMNP-TV-Z]{25}$"))
82
+ .describe("ULID (Universally Unique Lexicographically Sortable Identifier).");
83
+ export const dateTime = z
84
+ .string()
85
+ .datetime()
86
+ .describe("[RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.");
87
+ export const sortQuery = z
88
+ .object({
89
+ by: z.string().describe("The attribute to sort by."),
90
+ order: z
91
+ .union([z.literal("asc"), z.literal("desc")])
92
+ .optional()
93
+ .default("asc")
94
+ .describe("The sort order. `asc` for ascending, `desc` for descending."),
95
+ })
96
+ .describe("Sort query. The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.");
97
+ export const ingestedEventValidationError = z
98
+ .object({
99
+ code: z.string().describe("The machine readable code of the error."),
100
+ message: z
101
+ .string()
102
+ .describe("The human readable description of the error."),
103
+ attributes: z
104
+ .record(z.string(), z.unknown())
105
+ .optional()
106
+ .describe("Additional attributes."),
107
+ })
108
+ .describe("Event validation errors.");
109
+ export const cursorMetaPage = z
110
+ .object({
111
+ first: z.string().optional().describe("URI to the first page."),
112
+ last: z.string().optional().describe("URI to the last page."),
113
+ next: z.string().optional().describe("URI to the next page."),
114
+ previous: z.string().optional().describe("URI to the previous page."),
115
+ size: z.number().int().optional().describe("Requested page size."),
116
+ })
117
+ .describe("Cursor pagination metadata.");
118
+ export const invalidRules = z
119
+ .enum([
120
+ "required",
121
+ "is_array",
122
+ "is_base64",
123
+ "is_boolean",
124
+ "is_date_time",
125
+ "is_integer",
126
+ "is_null",
127
+ "is_number",
128
+ "is_object",
129
+ "is_string",
130
+ "is_uuid",
131
+ "is_fqdn",
132
+ "is_arn",
133
+ "unknown_property",
134
+ "missing_reference",
135
+ "is_label",
136
+ "matches_regex",
137
+ "invalid",
138
+ "is_supported_network_availability_zone_list",
139
+ "is_supported_network_cidr_block",
140
+ "is_supported_provider_region",
141
+ "type"
142
+ ])
143
+ .describe("The validation rule that a parameter failed.");
144
+ export const invalidParameterMinimumRule = z
145
+ .enum([
146
+ "min_length",
147
+ "min_digits",
148
+ "min_lowercase",
149
+ "min_uppercase",
150
+ "min_symbols",
151
+ "min_items",
152
+ "min"
153
+ ])
154
+ .describe("Minimum-length (or minimum-value) validation rules.");
155
+ export const invalidParameterMaximumRule = z
156
+ .enum(["max_length", "max_items", "max"])
157
+ .describe("Maximum-length (or maximum-value) validation rules.");
158
+ export const invalidParameterChoiceRule = z
159
+ .enum(["enum"])
160
+ .describe("The enum validation rule.");
161
+ export const invalidParameterDependentRule = z
162
+ .enum(["dependent_fields"])
163
+ .describe("The dependent-fields validation rule.");
164
+ export const baseError = z
165
+ .intersection(z.object({
166
+ type: z
167
+ .string()
168
+ .default("about:blank")
169
+ .describe("Type contains a URI that identifies the problem type."),
170
+ status: z
171
+ .number()
172
+ .int()
173
+ .describe("The HTTP status code generated by the origin server for this occurrence of the problem."),
174
+ title: z
175
+ .string()
176
+ .describe("A a short, human-readable summary of the problem type."),
177
+ detail: z
178
+ .string()
179
+ .describe("A human-readable explanation specific to this occurrence of the problem."),
180
+ instance: z
181
+ .string()
182
+ .describe("A URI reference that identifies the specific occurrence of the problem."),
183
+ }), z.record(z.string(), z.unknown()))
184
+ .describe("Standard error response.");
185
+ export const resourceKey = z
186
+ .string()
187
+ .min(1)
188
+ .max(64)
189
+ .regex(new RegExp("^[a-z0-9]+(?:_[a-z0-9]+)*$"))
190
+ .describe("A key is a unique string that is used to identify a resource.");
191
+ export const meterAggregation = z
192
+ .union([
193
+ z.literal("sum"),
194
+ z.literal("count"),
195
+ z.literal("unique_count"),
196
+ z.literal("avg"),
197
+ z.literal("min"),
198
+ z.literal("max"),
199
+ z.literal("latest")
200
+ ])
201
+ .describe("The aggregation type to use for the meter.");
202
+ export const pageMeta = z
203
+ .object({
204
+ number: z.number().int().describe("Page number."),
205
+ size: z.number().int().describe("Page size."),
206
+ total: z
207
+ .number()
208
+ .int()
209
+ .describe("Total number of items in the collection."),
210
+ })
211
+ .describe("Pagination information.");
212
+ export const meterQueryGranularity = z
213
+ .union([
214
+ z.literal("PT1M"),
215
+ z.literal("PT1H"),
216
+ z.literal("P1D"),
217
+ z.literal("P1M")
218
+ ])
219
+ .describe("The granularity of the time grouping. Time durations are specified in ISO 8601 format.");
220
+ export const queryFilterString = z
221
+ .object({
222
+ eq: z
223
+ .string()
224
+ .optional()
225
+ .describe("The attribute equals the provided value."),
226
+ neq: z
227
+ .string()
228
+ .optional()
229
+ .describe("The attribute does not equal the provided value."),
230
+ in: z
231
+ .array(z.string())
232
+ .min(1)
233
+ .max(100)
234
+ .optional()
235
+ .describe("The attribute is one of the provided values."),
236
+ nin: z
237
+ .array(z.string())
238
+ .min(1)
239
+ .max(100)
240
+ .optional()
241
+ .describe("The attribute is not one of the provided values."),
242
+ contains: z
243
+ .string()
244
+ .optional()
245
+ .describe("The attribute contains the provided value."),
246
+ ncontains: z
247
+ .string()
248
+ .optional()
249
+ .describe("The attribute does not contain the provided value."),
250
+ get and() {
251
+ return z
252
+ .array(queryFilterString)
253
+ .min(1)
254
+ .max(10)
255
+ .optional()
256
+ .describe("Combines the provided filters with a logical AND.");
257
+ },
258
+ get or() {
259
+ return z
260
+ .array(queryFilterString)
261
+ .min(1)
262
+ .max(10)
263
+ .optional()
264
+ .describe("Combines the provided filters with a logical OR.");
265
+ },
266
+ })
267
+ .describe("A query filter for a string attribute. Operators are mutually exclusive, only one operator is allowed at a time.");
268
+ export const externalResourceKey = z
269
+ .string()
270
+ .min(1)
271
+ .max(256)
272
+ .describe("ExternalResourceKey is a unique string that is used to identify a resource in an external system.");
273
+ export const usageAttributionSubjectKey = z
274
+ .string()
275
+ .min(1)
276
+ .describe("Subject key.");
277
+ export const countryCode = z
278
+ .string()
279
+ .min(2)
280
+ .max(2)
281
+ .regex(new RegExp("^[A-Z]{2}$"))
282
+ .describe("[ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-2 country code. Custom two-letter country codes are also supported for convenience.");
283
+ export const appStripeCreateCheckoutSessionBillingAddressCollection = z
284
+ .enum(["auto", "required"])
285
+ .describe("Controls whether Checkout collects the customer's billing address.");
286
+ export const appStripeCreateCheckoutSessionCustomerUpdateBehavior = z
287
+ .enum(["auto", "never"])
288
+ .describe("Behavior for updating customer fields from checkout session.");
289
+ export const appStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition = z
290
+ .enum(["auto", "hidden"])
291
+ .describe("Position of payment method reuse agreement in the UI.");
292
+ export const appStripeCreateCheckoutSessionConsentCollectionPromotions = z
293
+ .enum(["auto", "none"])
294
+ .describe("Promotional communication consent collection setting.");
295
+ export const appStripeCreateCheckoutSessionConsentCollectionTermsOfService = z
296
+ .enum(["none", "required"])
297
+ .describe("Terms of service acceptance requirement.");
298
+ export const appStripeCheckoutSessionCustomTextParams = z
299
+ .object({
300
+ after_submit: z
301
+ .object({
302
+ message: z
303
+ .string()
304
+ .max(1200)
305
+ .optional()
306
+ .describe("The custom message text (max 1200 characters)."),
307
+ })
308
+ .optional()
309
+ .describe("Text displayed after the payment confirmation button."),
310
+ shipping_address: z
311
+ .object({
312
+ message: z
313
+ .string()
314
+ .max(1200)
315
+ .optional()
316
+ .describe("The custom message text (max 1200 characters)."),
317
+ })
318
+ .optional()
319
+ .describe("Text displayed alongside shipping address collection."),
320
+ submit: z
321
+ .object({
322
+ message: z
323
+ .string()
324
+ .max(1200)
325
+ .optional()
326
+ .describe("The custom message text (max 1200 characters)."),
327
+ })
328
+ .optional()
329
+ .describe("Text displayed alongside the payment confirmation button."),
330
+ terms_of_service_acceptance: z
331
+ .object({
332
+ message: z
333
+ .string()
334
+ .max(1200)
335
+ .optional()
336
+ .describe("The custom message text (max 1200 characters)."),
337
+ })
338
+ .optional()
339
+ .describe("Text replacing the default terms of service agreement text."),
340
+ })
341
+ .describe("Custom text displayed at various stages of the checkout flow.");
342
+ export const appStripeCheckoutSessionUiMode = z
343
+ .enum(["embedded", "hosted"])
344
+ .describe("Checkout Session UI mode.");
345
+ export const appStripeCreateCheckoutSessionRedirectOnCompletion = z
346
+ .enum(["always", "if_required", "never"])
347
+ .describe("Redirect behavior for embedded checkout sessions.");
348
+ export const appStripeCreateCheckoutSessionTaxIdCollectionRequired = z
349
+ .enum(["if_supported", "never"])
350
+ .describe("Tax ID collection requirement level.");
351
+ export const appStripeCheckoutSessionMode = z
352
+ .enum(["setup"])
353
+ .describe("Stripe Checkout Session mode. Determines the primary purpose of the checkout session.");
354
+ export const appStripeCreateCustomerPortalSessionOptions = z
355
+ .object({
356
+ configuration_id: z
357
+ .string()
358
+ .optional()
359
+ .describe("The ID of an existing [Stripe configuration](https://docs.stripe.com/api/customer_portal/configurations) to use for this session, describing its functionality and features. If not specified, the session uses the default configuration."),
360
+ locale: z
361
+ .string()
362
+ .optional()
363
+ .describe("The IETF [language tag](https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-locale) of the locale customer portal is displayed in. If blank or `auto`, the customer's preferred_locales or browser's locale is used."),
364
+ return_url: z
365
+ .string()
366
+ .optional()
367
+ .describe("The [URL to redirect](https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-return_url) the customer to after they have completed their requested actions."),
368
+ })
369
+ .describe("Request to create a Stripe Customer Portal Session.");
370
+ export const entitlementType = z
371
+ .enum(["metered", "static", "boolean"])
372
+ .describe("The type of the entitlement.");
373
+ export const createLabels = z
374
+ .record(z.string(), z.string())
375
+ .describe("Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with \"kong\", \"konnect\", \"mesh\", \"kic\", or \"\\_\".");
376
+ export const creditFundingMethod = z
377
+ .enum(["none", "invoice", "external"])
378
+ .describe("The funding method describes how the grant is funded. - `none`: No funding workflow applies, for example promotional grants - `invoice`: The grant is funded by an in-system invoice flow - `external`: The grant is funded outside the system (e.g., wire transfer, external invoice, or manual reconciliation)");
379
+ export const creditAvailabilityPolicy = z
380
+ .enum(["on_creation"])
381
+ .describe("When credits become available for consumption. - `on_creation`: Credits are available as soon as the grant is created. - `on_authorization`: Credits are available once the payment is authorized. - `on_settlement`: Credits are available once the payment is settled.");
382
+ export const taxBehavior = z
383
+ .enum(["inclusive", "exclusive"])
384
+ .describe("Tax behavior. This enum is used to specify whether tax is included in the price or excluded from the price.");
385
+ export const iso8601Duration = z
386
+ .string()
387
+ .regex(new RegExp("^P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$"))
388
+ .describe("[ISO 8601 Duration](https://docs.digi.com/resources/documentation/digidocs/90001488-13/reference/r_iso_8601_duration_format.htm) string.");
389
+ export const creditPurchasePaymentSettlementStatus = z
390
+ .enum(["pending", "authorized", "settled"])
391
+ .describe("Credit purchase payment settlement status. - `pending`: Payment has been initiated and is not yet authorized. - `authorized`: Payment has been authorized. - `settled`: Payment has been settled.");
392
+ export const creditGrantStatus = z
393
+ .enum(["pending", "active", "expired", "voided"])
394
+ .describe("Credit grant lifecycle status. - `pending`: The credit block has been created but is not yet valid. (`effective_at` is in the future or availability_policy is not met) - `active`: The credit block is currently valid and eligible for consumption. (`effective_at` is in the past, `expires_at` is in the future and availability_policy is met) - `expired`: The credit block expired with remaining unused balance, `expires_at` time has passed. - `voided`: The credit block was voided. Remaining balance is forfeited.");
395
+ export const stringFieldFilterExact = z
396
+ .union([
397
+ z.string(),
398
+ z.object({
399
+ eq: z
400
+ .string()
401
+ .optional()
402
+ .describe("Value strictly equals the given string value."),
403
+ oeq: z
404
+ .array(z.string())
405
+ .optional()
406
+ .describe("Returns entities that exact match any of the comma-delimited phrases in the filter string."),
407
+ neq: z
408
+ .string()
409
+ .optional()
410
+ .describe("Value does not equal the given string value."),
411
+ })
412
+ ])
413
+ .describe("Filters on the given string field value by exact match. All properties are optional; provide exactly one to specify the comparison.");
414
+ export const creditTransactionType = z
415
+ .enum(["funded", "consumed", "expired"])
416
+ .describe("The type of the credit transaction. - `funded`: Credit granted and available for consumption. - `consumed`: Credit consumed by usage or fees. - `expired`: Credit removed because it expired before being used.");
417
+ export const chargesExpand = z
418
+ .enum(["real_time_usage"])
419
+ .describe("Expands for customer charges. Values: - `real_time_usage`: The charge's real-time usage.");
420
+ export const resourceManagedBy = z
421
+ .enum(["manual", "system", "subscription"])
422
+ .describe("Identifies which system manages a resource. Values: - `manual`: The resource is managed manually (overridden by our API users). - `system`: The resource is managed by the system. - `subscription`: The resource is managed by the subscription.");
423
+ export const chargeStatus = z
424
+ .enum(["created", "active", "final", "deleted"])
425
+ .describe("Lifecycle status of a charge. Values: - `created`: The charge has been created but is not active yet. - `active`: The charge is active. - `final`: The charge is fully finalized and no further changes are expected. - `deleted`: The charge has been deleted.");
426
+ export const priceFree = z
427
+ .object({
428
+ type: z.literal("free").describe("The type of the price."),
429
+ })
430
+ .describe("Free price.");
431
+ export const settlementMode = z
432
+ .enum(["credit_then_invoice", "credit_only"])
433
+ .describe("Settlement mode for billing. Values: - `credit_then_invoice`: Credits are applied first, then any remainder is invoiced. - `credit_only`: Usage is settled exclusively against credits.");
434
+ export const taxConfigStripe = z
435
+ .object({
436
+ code: z
437
+ .string()
438
+ .regex(new RegExp("^txcd_\\d{8}$"))
439
+ .describe("Product [tax code](https://docs.stripe.com/tax/tax-codes)."),
440
+ })
441
+ .describe("The tax config for Stripe.");
442
+ export const taxConfigExternalInvoicing = z
443
+ .object({
444
+ code: z
445
+ .string()
446
+ .max(64)
447
+ .describe("The tax code should be interpreted by the external invoicing provider."),
448
+ })
449
+ .describe("External invoicing tax config.");
450
+ export const pricePaymentTerm = z
451
+ .union([z.literal("in_advance"), z.literal("in_arrears")])
452
+ .describe("The payment term of a flat price.");
453
+ export const flatFeeDiscounts = z
454
+ .object({
455
+ percentage: z
456
+ .number()
457
+ .nonnegative()
458
+ .lte(100)
459
+ .optional()
460
+ .describe("Percentage discount applied to the price (0–100)."),
461
+ })
462
+ .describe("Discounts applicable to flat fee charges. This is the same as `ProductCatalog.Discounts` but without the `usage` field, which is not applicable to flat fee charges.");
463
+ export const rateCardProrationMode = z
464
+ .enum(["no_proration", "prorate_prices"])
465
+ .describe("The proration mode of the rate card. Values: - `no_proration`: No proration. - `prorate_prices`: Prorate the price based on the time remaining in the billing period.");
466
+ export const subscriptionStatus = z
467
+ .enum(["active", "inactive", "canceled", "scheduled"])
468
+ .describe("Subscription status.");
469
+ export const subscriptionEditTimingEnum = z
470
+ .enum(["immediate", "next_billing_cycle"])
471
+ .describe("Subscription edit timing. When immediate, the requested changes take effect immediately. When next_billing_cycle, the requested changes take effect at the next billing cycle.");
472
+ export const appType = z
473
+ .enum(["sandbox", "stripe", "external_invoicing"])
474
+ .describe("The type of the app.");
475
+ export const appStatus = z
476
+ .enum(["ready", "unauthorized"])
477
+ .describe("Connection status of an installed app.");
478
+ export const taxIdentificationCode = z
479
+ .string()
480
+ .min(1)
481
+ .max(32)
482
+ .describe("Tax identifier code is a normalized tax code shown on the original identity document.");
483
+ export const workflowCollectionAlignmentSubscription = z
484
+ .object({
485
+ type: z.literal("subscription").describe("The type of alignment."),
486
+ })
487
+ .describe("BillingWorkflowCollectionAlignmentSubscription specifies the alignment for collecting the pending line items into an invoice.");
488
+ export const workflowInvoicingSettings = z
489
+ .object({
490
+ auto_advance: z
491
+ .boolean()
492
+ .optional()
493
+ .default(true)
494
+ .describe("Whether to automatically issue the invoice after the draftPeriod has passed."),
495
+ draft_period: z
496
+ .string()
497
+ .optional()
498
+ .default("P0D")
499
+ .describe("The period for the invoice to be kept in draft status for manual reviews."),
500
+ progressive_billing: z
501
+ .boolean()
502
+ .optional()
503
+ .default(true)
504
+ .describe("Should progressive billing be allowed for this workflow?"),
505
+ })
506
+ .describe("Invoice settings for a billing workflow.");
507
+ export const workflowPaymentChargeAutomaticallySettings = z
508
+ .object({
509
+ collection_method: z
510
+ .literal("charge_automatically")
511
+ .describe("The collection method for the invoice."),
512
+ })
513
+ .describe("Payment settings for a billing workflow when the collection method is charge automatically.");
514
+ export const workflowPaymentSendInvoiceSettings = z
515
+ .object({
516
+ collection_method: z
517
+ .literal("send_invoice")
518
+ .describe("The collection method for the invoice."),
519
+ due_after: z
520
+ .string()
521
+ .optional()
522
+ .default("P30D")
523
+ .describe("The period after which the invoice is due. With some payment solutions it's only applicable for manual collection method."),
524
+ })
525
+ .describe("Payment settings for a billing workflow when the collection method is send invoice.");
526
+ export const currencyType = z
527
+ .enum(["fiat", "custom"])
528
+ .describe("Currency type for custom currencies. It should be a unique code but not conflicting with any existing standard currency codes.");
529
+ export const currencyCodeCustom = z
530
+ .string()
531
+ .min(3)
532
+ .max(24)
533
+ .describe("Custom currency code. It should be a unique code but not conflicting with any existing fiat currency codes.");
534
+ export const featureLlmTokenType = z
535
+ .enum([
536
+ "input",
537
+ "output",
538
+ "cache_read",
539
+ "cache_write",
540
+ "reasoning",
541
+ "request",
542
+ "response"
543
+ ])
544
+ .describe("Token type for LLM cost lookup.");
545
+ export const llmCostProvider = z
546
+ .object({
547
+ id: z
548
+ .string()
549
+ .describe("Identifier of the provider, e.g., \"openai\", \"anthropic\"."),
550
+ name: z
551
+ .string()
552
+ .describe("Name of the provider, e.g., \"OpenAI\", \"Anthropic\"."),
553
+ })
554
+ .describe("LLM Provider");
555
+ export const llmCostModel = z
556
+ .object({
557
+ id: z
558
+ .string()
559
+ .describe("Identifier of the model, e.g., \"gpt-4\", \"claude-3-5-sonnet\"."),
560
+ name: z
561
+ .string()
562
+ .describe("Name of the model, e.g., \"GPT-4\", \"Claude 3.5 Sonnet\"."),
563
+ })
564
+ .describe("LLM Model");
565
+ export const llmCostPriceSource = z
566
+ .enum(["manual", "system"])
567
+ .describe("Identifies where an LLM cost price came from.");
568
+ export const planStatus = z
569
+ .enum(["draft", "active", "archived", "scheduled"])
570
+ .describe("The status of a plan. - `draft`: The plan has not yet been published and can be edited. - `active`: The plan is published and can be used in subscriptions. - `archived`: The plan is no longer available for use. - `scheduled`: The plan is scheduled to be published at a future date.");
571
+ export const productCatalogValidationError = z
572
+ .object({
573
+ code: z.string().describe("Machine-readable error code."),
574
+ message: z.string().describe("Human-readable description of the error."),
575
+ attributes: z
576
+ .record(z.string(), z.unknown())
577
+ .optional()
578
+ .describe("Additional structured context."),
579
+ field: z.string().describe("The path to the field."),
580
+ })
581
+ .describe("Validation errors providing detailed description of the issue.");
582
+ export const addonInstanceType = z
583
+ .enum(["single", "multiple"])
584
+ .describe("The instanceType of the add-on. - `single`: Can be added to a subscription only once. - `multiple`: Can be added to a subscription more than once.");
585
+ export const addonStatus = z
586
+ .enum(["draft", "active", "archived"])
587
+ .describe("The status of the add-on defined by the `effective_from` and `effective_to` properties. - `draft`: The add-on has not yet been published and can be edited. - `active`: The add-on is published and available for use. - `archived`: The add-on is no longer available for use.");
588
+ export const governanceQueryRequestCustomers = z
589
+ .object({
590
+ keys: z
591
+ .array(z.string())
592
+ .min(1)
593
+ .max(100)
594
+ .describe("Each entry can be a customer `key` or a usage-attribution subject `key`. Identifiers that cannot be resolved to a customer are reported in the response `errors` array."),
595
+ })
596
+ .describe("List of customer identifiers to evaluate access for.");
597
+ export const governanceQueryRequestFeatures = z
598
+ .object({
599
+ keys: z
600
+ .array(z.string())
601
+ .min(1)
602
+ .max(100)
603
+ .describe("List of feature keys to evaluate access for."),
604
+ })
605
+ .describe("Optional list of feature keys to evaluate access for. If omitted, all features available in the organization are returned. Providing this list is recommended to reduce the response size and the load on the backend services.");
606
+ export const governanceFeatureAccessReasonCode = z
607
+ .enum([
608
+ "unknown",
609
+ "usage_limit_reached",
610
+ "feature_unavailable",
611
+ "feature_not_found",
612
+ "no_credit_available"
613
+ ])
614
+ .describe("Machine-readable reason code for denied feature access.");
615
+ export const governanceQueryErrorCode = z
616
+ .enum(["unknown", "customer_not_found"])
617
+ .describe("Error code for a governance query failure.");
618
+ export const queryFilterInteger = z
619
+ .object({
620
+ eq: z
621
+ .number()
622
+ .int()
623
+ .optional()
624
+ .describe("The attribute equals the provided value."),
625
+ neq: z
626
+ .number()
627
+ .int()
628
+ .optional()
629
+ .describe("The attribute does not equal the provided value."),
630
+ in: z
631
+ .array(z.number().int())
632
+ .min(1)
633
+ .max(100)
634
+ .optional()
635
+ .describe("The attribute is one of the provided values."),
636
+ nin: z
637
+ .array(z.number().int())
638
+ .min(1)
639
+ .max(100)
640
+ .optional()
641
+ .describe("The attribute is not one of the provided values."),
642
+ gt: z
643
+ .number()
644
+ .int()
645
+ .optional()
646
+ .describe("The attribute is greater than the provided value."),
647
+ gte: z
648
+ .number()
649
+ .int()
650
+ .optional()
651
+ .describe("The attribute is greater than or equal to the provided value."),
652
+ lt: z
653
+ .number()
654
+ .int()
655
+ .optional()
656
+ .describe("The attribute is less than the provided value."),
657
+ lte: z
658
+ .number()
659
+ .int()
660
+ .optional()
661
+ .describe("The attribute is less than or equal to the provided value."),
662
+ get and() {
663
+ return z
664
+ .array(queryFilterInteger)
665
+ .min(1)
666
+ .max(10)
667
+ .optional()
668
+ .describe("Combines the provided filters with a logical AND.");
669
+ },
670
+ get or() {
671
+ return z
672
+ .array(queryFilterInteger)
673
+ .min(1)
674
+ .max(10)
675
+ .optional()
676
+ .describe("Combines the provided filters with a logical OR.");
677
+ },
678
+ })
679
+ .describe("A query filter for an integer attribute. Operators are mutually exclusive, only one operator is allowed at a time.");
680
+ export const queryFilterFloat = z
681
+ .object({
682
+ gt: z
683
+ .number()
684
+ .optional()
685
+ .describe("The attribute is greater than the provided value."),
686
+ gte: z
687
+ .number()
688
+ .optional()
689
+ .describe("The attribute is greater than or equal to the provided value."),
690
+ lt: z
691
+ .number()
692
+ .optional()
693
+ .describe("The attribute is less than the provided value."),
694
+ lte: z
695
+ .number()
696
+ .optional()
697
+ .describe("The attribute is less than or equal to the provided value."),
698
+ get and() {
699
+ return z
700
+ .array(queryFilterFloat)
701
+ .min(1)
702
+ .max(10)
703
+ .optional()
704
+ .describe("Combines the provided filters with a logical AND.");
705
+ },
706
+ get or() {
707
+ return z
708
+ .array(queryFilterFloat)
709
+ .min(1)
710
+ .max(10)
711
+ .optional()
712
+ .describe("Combines the provided filters with a logical OR.");
713
+ },
714
+ })
715
+ .describe("A query filter for a float attribute. Operators are mutually exclusive, only one operator is allowed at a time.");
716
+ export const queryFilterBoolean = z
717
+ .object({
718
+ eq: z
719
+ .boolean()
720
+ .optional()
721
+ .describe("The attribute equals the provided value."),
722
+ })
723
+ .describe("A query filter for a boolean attribute. Operators are mutually exclusive, only one operator is allowed at a time.");
724
+ export const pagePaginationQuery = z
725
+ .object({
726
+ page: z
727
+ .object({
728
+ size: z
729
+ .number()
730
+ .int()
731
+ .optional()
732
+ .describe("The number of items to include per page."),
733
+ number: z.number().int().optional().describe("The page number."),
734
+ })
735
+ .optional()
736
+ .describe("Determines which page of the collection to retrieve."),
737
+ })
738
+ .describe("Page pagination query.");
739
+ export const publicLabels = z
740
+ .record(z.string(), z.string())
741
+ .describe("Public labels store information about an entity that can be used for filtering a list of objects.");
742
+ export const booleanFieldFilter = z
743
+ .union([
744
+ z.boolean(),
745
+ z.object({
746
+ eq: z
747
+ .boolean()
748
+ .describe("Value strictly equals the given boolean value."),
749
+ })
750
+ ])
751
+ .describe("Filter by a boolean value (true/false).");
752
+ export const numericFieldFilter = z
753
+ .union([
754
+ z.number(),
755
+ z.object({
756
+ eq: z
757
+ .number()
758
+ .optional()
759
+ .describe("Value strictly equals the given numeric value."),
760
+ neq: z
761
+ .number()
762
+ .optional()
763
+ .describe("Value does not equal the given numeric value."),
764
+ oeq: z
765
+ .array(z.number())
766
+ .optional()
767
+ .describe("Returns entities that match any of the comma-delimited numeric values."),
768
+ lt: z
769
+ .number()
770
+ .optional()
771
+ .describe("Value is less than the given numeric value."),
772
+ lte: z
773
+ .number()
774
+ .optional()
775
+ .describe("Value is less than or equal to the given numeric value."),
776
+ gt: z
777
+ .number()
778
+ .optional()
779
+ .describe("Value is greater than the given numeric value."),
780
+ gte: z
781
+ .number()
782
+ .optional()
783
+ .describe("Value is greater than or equal to the given numeric value."),
784
+ })
785
+ ])
786
+ .describe("Filter by a numeric value. All properties are optional; provide exactly one to specify the comparison.");
787
+ export const chargeType = z
788
+ .enum(["flat_fee", "usage_based"])
789
+ .describe("Type of a charge. Values: - `flat_fee`: A fixed-amount charge. - `usage_based`: A usage-priced charge.");
790
+ export const invoiceNumber = z
791
+ .string()
792
+ .min(1)
793
+ .max(256)
794
+ .describe("InvoiceNumber is a unique identifier for the invoice, generated by the invoicing app. The uniqueness depends on a lot of factors: - app setting (unique per app or unique per customer) - multiple app scenarios (multiple apps generating invoices with the same prefix)");
795
+ export const collectionAlignment = z
796
+ .enum(["subscription", "anchored"])
797
+ .describe("BillingCollectionAlignment specifies when the pending line items should be collected into an invoice.");
798
+ export const collectionMethod = z
799
+ .enum(["charge_automatically", "send_invoice"])
800
+ .describe("Collection method specifies how the invoice should be collected (automatic or manual).");
801
+ export const unitConfigOperation = z
802
+ .enum(["divide", "multiply"])
803
+ .describe("The arithmetic operation used to convert raw metered units into billing units. - `divide`: Divide the metered quantity by the conversion factor (e.g., bytes ÷ 1e9 = GB). - `multiply`: Multiply the metered quantity by the conversion factor (e.g., cost × 1.2 = cost + 20% margin).");
804
+ export const unitConfigRoundingMode = z
805
+ .enum(["ceiling", "floor", "half_up", "none"])
806
+ .describe("The rounding mode applied to the converted quantity for invoicing. Rounding is applied only to the invoiced quantity. Entitlement balance checks use the precise decimal value after conversion. - `ceiling`: Round up to the next integer (typical for package-style billing). - `floor`: Round down to the previous integer. - `half_up`: Round to the nearest integer, with 0.5 rounding up. - `none`: No rounding; the converted value is used as-is.");
807
+ export const priceType = z
808
+ .enum(["free", "flat", "unit", "graduated", "volume"])
809
+ .describe("The type of the price. - `free`: No charge, the rate card is included at no cost. - `flat`: A fixed amount charged once per billing period, regardless of usage. - `unit`: A fixed rate charged per billing unit consumed. - `graduated`: Tiered pricing where each tier's rate applies only to usage within that tier. - `volume`: Tiered pricing where the rate for the highest tier reached applies to all units in the period.");
810
+ export const featureUnitCostType = z
811
+ .enum(["llm", "manual"])
812
+ .describe("The type of unit cost.");
813
+ export const systemAccountAccessToken = z
814
+ .object({
815
+ type: z.literal("http").describe("Http authentication"),
816
+ scheme: z.literal("Bearer").describe("bearer auth scheme"),
817
+ })
818
+ .describe("The system account access token is meant for automations and integrations that are not directly associated with a human identity.");
819
+ export const personalAccessToken = z
820
+ .object({
821
+ type: z.literal("http").describe("Http authentication"),
822
+ scheme: z.literal("Bearer").describe("bearer auth scheme"),
823
+ })
824
+ .describe("The personal access token is meant to be used as an alternative to basic-auth when accessing Konnect via APIs.");
825
+ export const konnectAccessToken = z
826
+ .object({
827
+ type: z.literal("http").describe("Http authentication"),
828
+ scheme: z.literal("Bearer").describe("bearer auth scheme"),
829
+ })
830
+ .describe("The Konnect access token is meant to be used by the Konnect dashboard and the decK CLI authenticate with.");
831
+ export const updateMeterRequest = z
832
+ .object({
833
+ name: z
834
+ .string()
835
+ .min(1)
836
+ .max(256)
837
+ .optional()
838
+ .describe("Display name of the resource. Between 1 and 256 characters."),
839
+ description: z
840
+ .string()
841
+ .max(1024)
842
+ .optional()
843
+ .describe("Optional description of the resource. Maximum 1024 characters."),
844
+ labels: labels.optional(),
845
+ dimensions: z
846
+ .record(z.string(), z.string())
847
+ .optional()
848
+ .describe("Named JSONPath expressions to extract the group by values from the event data. Keys must be unique and consist only alphanumeric and underscore characters."),
849
+ })
850
+ .describe("Meter update request.");
851
+ export const appCustomerDataStripe = z
852
+ .object({
853
+ customer_id: z.string().optional().describe("The Stripe customer ID used."),
854
+ default_payment_method_id: z
855
+ .string()
856
+ .optional()
857
+ .describe("The Stripe default payment method ID."),
858
+ labels: labels.optional(),
859
+ })
860
+ .describe("Stripe customer data.");
861
+ export const appCustomerDataExternalInvoicing = z
862
+ .object({
863
+ labels: labels.optional(),
864
+ })
865
+ .describe("External invoicing customer data.");
866
+ export const billingCurrencyCode = z
867
+ .union([currencyCode])
868
+ .describe("Fiat or custom currency code.");
869
+ export const createCurrencyCode = z
870
+ .union([currencyCode])
871
+ .describe("Fiat or custom currency code.");
872
+ export const listCostBasesParamsFilter = z
873
+ .object({
874
+ fiat_code: currencyCode.optional(),
875
+ })
876
+ .describe("Filter options for listing cost bases.");
877
+ export const priceFlat = z
878
+ .object({
879
+ type: z.literal("flat").describe("The type of the price."),
880
+ amount: numeric,
881
+ })
882
+ .describe("Flat price.");
883
+ export const priceUnit = z
884
+ .object({
885
+ type: z.literal("unit").describe("The type of the price."),
886
+ amount: numeric,
887
+ })
888
+ .describe("Unit price. Charges a fixed rate per billing unit. When UnitConfig is present on the rate card, billing units are the converted quantities (e.g. GB instead of bytes).");
889
+ export const currencyAmount = z
890
+ .object({
891
+ amount: numeric,
892
+ currency: currencyCode,
893
+ })
894
+ .describe("Monetary amount in a specific currency.");
895
+ export const rateCardDiscounts = z
896
+ .object({
897
+ percentage: z
898
+ .number()
899
+ .nonnegative()
900
+ .lte(100)
901
+ .optional()
902
+ .describe("Percentage discount applied to the price (0–100)."),
903
+ usage: numeric.optional(),
904
+ })
905
+ .describe("Discount configuration for a rate card.");
906
+ export const totals = z
907
+ .object({
908
+ amount: numeric,
909
+ taxes_total: numeric,
910
+ taxes_inclusive_total: numeric,
911
+ taxes_exclusive_total: numeric,
912
+ charges_total: numeric,
913
+ discounts_total: numeric,
914
+ credits_total: numeric,
915
+ total: numeric,
916
+ })
917
+ .describe("Totals contains the summaries of all calculations for a billing resource.");
918
+ export const featureManualUnitCost = z
919
+ .object({
920
+ type: z
921
+ .literal("manual")
922
+ .describe("The type discriminator for manual unit cost."),
923
+ amount: numeric,
924
+ })
925
+ .describe("A fixed per-unit cost amount.");
926
+ export const featureLlmUnitCostPricing = z
927
+ .object({
928
+ input_per_token: numeric,
929
+ output_per_token: numeric,
930
+ cache_read_per_token: numeric.optional(),
931
+ reasoning_per_token: numeric.optional(),
932
+ cache_write_per_token: numeric.optional(),
933
+ })
934
+ .describe("Resolved per-token pricing from the LLM cost database.");
935
+ export const llmCostModelPricing = z
936
+ .object({
937
+ input_per_token: numeric,
938
+ output_per_token: numeric,
939
+ cache_read_per_token: numeric.optional(),
940
+ cache_write_per_token: numeric.optional(),
941
+ reasoning_per_token: numeric.optional(),
942
+ })
943
+ .describe("Token pricing for an LLM model, denominated per token.");
944
+ export const spendCommitments = z
945
+ .object({
946
+ minimum_amount: numeric.optional(),
947
+ maximum_amount: numeric.optional(),
948
+ })
949
+ .describe("Spend commitments for a rate card. The customer is committed to spend at least the minimum amount and at most the maximum amount.");
950
+ export const queryFilterNumeric = z
951
+ .object({
952
+ gt: numeric.optional(),
953
+ gte: numeric.optional(),
954
+ lt: numeric.optional(),
955
+ lte: numeric.optional(),
956
+ get and() {
957
+ return z
958
+ .array(queryFilterNumeric)
959
+ .min(1)
960
+ .max(10)
961
+ .optional()
962
+ .describe("Combines the provided filters with a logical AND.");
963
+ },
964
+ get or() {
965
+ return z
966
+ .array(queryFilterNumeric)
967
+ .min(1)
968
+ .max(10)
969
+ .optional()
970
+ .describe("Combines the provided filters with a logical OR.");
971
+ },
972
+ })
973
+ .describe("A query filter for a numeric attribute. Operators are mutually exclusive, only one operator is allowed at a time.");
974
+ export const cursorPaginationQuery = z
975
+ .object({
976
+ page: cursorPaginationQueryPage.optional(),
977
+ })
978
+ .describe("Cursor page query.");
979
+ export const listMetersParamsFilter = z
980
+ .object({
981
+ key: stringFieldFilter.optional(),
982
+ name: stringFieldFilter.optional(),
983
+ })
984
+ .describe("Filter options for listing meters.");
985
+ export const listLlmCostPricesParamsFilter = z
986
+ .object({
987
+ provider: stringFieldFilter.optional(),
988
+ model_id: stringFieldFilter.optional(),
989
+ model_name: stringFieldFilter.optional(),
990
+ currency: stringFieldFilter.optional(),
991
+ source: stringFieldFilter.optional(),
992
+ })
993
+ .describe("Filter options for listing LLM cost prices.");
994
+ export const labelsFieldFilter = z
995
+ .record(z.string(), stringFieldFilter)
996
+ .describe("Filters on the resource's `labels` field. The schema is a map keyed by the label name; each value is a `StringFieldFilter`. Both deepObject forms are accepted: `filter[labels][key]=value` (nested) and `filter[labels.key]=value` (dot-notation).");
997
+ export const ulidFieldFilter = z
998
+ .union([
999
+ ulid,
1000
+ z.object({
1001
+ eq: ulid.optional(),
1002
+ oeq: z
1003
+ .array(ulid)
1004
+ .optional()
1005
+ .describe("Returns entities that exact match any of the comma-delimited ULIDs in the filter string."),
1006
+ neq: ulid.optional(),
1007
+ })
1008
+ ])
1009
+ .describe("Filters on the given ULID field value by exact match. All properties are optional; provide exactly one to specify the comparison.");
1010
+ export const customerReference = z
1011
+ .object({
1012
+ id: ulid,
1013
+ })
1014
+ .describe("Customer reference.");
1015
+ export const profileReference = z
1016
+ .object({
1017
+ id: ulid,
1018
+ })
1019
+ .describe("Billing profile reference.");
1020
+ export const createResourceReference = z
1021
+ .object({
1022
+ id: ulid,
1023
+ })
1024
+ .describe("TaxCode reference.");
1025
+ export const taxCodeReference = z
1026
+ .object({
1027
+ id: ulid,
1028
+ })
1029
+ .describe("TaxCode reference.");
1030
+ export const creditGrantInvoiceReference = z
1031
+ .object({
1032
+ id: ulid.optional(),
1033
+ line: z
1034
+ .object({
1035
+ id: ulid,
1036
+ })
1037
+ .optional()
1038
+ .describe("Identifier of the invoice line associated with the grant."),
1039
+ })
1040
+ .describe("Invoice references for the grant.");
1041
+ export const billingCustomerReference = z
1042
+ .object({
1043
+ id: ulid,
1044
+ })
1045
+ .describe("Customer reference.");
1046
+ export const subscriptionReference = z
1047
+ .object({
1048
+ id: ulid,
1049
+ phase: z
1050
+ .object({
1051
+ id: ulid,
1052
+ item: z
1053
+ .object({
1054
+ id: ulid,
1055
+ })
1056
+ .describe("The item of the phase."),
1057
+ })
1058
+ .describe("The phase of the subscription."),
1059
+ })
1060
+ .describe("Subscription reference represents a reference to the specific subscription item this entity represents.");
1061
+ export const addonReference = z
1062
+ .object({
1063
+ id: ulid,
1064
+ })
1065
+ .describe("Addon reference.");
1066
+ export const appReference = z
1067
+ .object({
1068
+ id: ulid,
1069
+ })
1070
+ .describe("App reference.");
1071
+ export const currencyFiat = z
1072
+ .object({
1073
+ id: ulid,
1074
+ type: z.literal("fiat").describe("The type of the currency."),
1075
+ name: z
1076
+ .string()
1077
+ .min(1)
1078
+ .max(256)
1079
+ .describe("The name of the currency. It should be a human-readable string that represents the name of the currency, such as \"US Dollar\" or \"Euro\"."),
1080
+ description: z
1081
+ .string()
1082
+ .min(1)
1083
+ .max(256)
1084
+ .optional()
1085
+ .describe("Description of the currency."),
1086
+ symbol: z
1087
+ .string()
1088
+ .min(1)
1089
+ .optional()
1090
+ .describe("The symbol of the currency. It should be a string that represents the symbol of the currency, such as \"$\" for US Dollar or \"€\" for Euro."),
1091
+ code: currencyCode,
1092
+ })
1093
+ .describe("Currency describes a currency supported by the billing system.");
1094
+ export const featureReference = z
1095
+ .object({
1096
+ id: ulid,
1097
+ })
1098
+ .describe("Feature reference.");
1099
+ export const dateTimeFieldFilter = z
1100
+ .union([
1101
+ dateTime,
1102
+ z.object({
1103
+ eq: dateTime.optional(),
1104
+ lt: dateTime.optional(),
1105
+ lte: dateTime.optional(),
1106
+ gt: dateTime.optional(),
1107
+ gte: dateTime.optional(),
1108
+ })
1109
+ ])
1110
+ .describe("Filters on the given datetime (RFC-3339) field value. All properties are optional; provide exactly one to specify the comparison.");
1111
+ export const event = z
1112
+ .object({
1113
+ id: z.string().min(1).describe("Identifies the event."),
1114
+ source: z
1115
+ .string()
1116
+ .min(1)
1117
+ .describe("Identifies the context in which an event happened."),
1118
+ specversion: z
1119
+ .string()
1120
+ .min(1)
1121
+ .default("1.0")
1122
+ .describe("The version of the CloudEvents specification which the event uses."),
1123
+ type: z
1124
+ .string()
1125
+ .min(1)
1126
+ .describe("Contains a value describing the type of event related to the originating occurrence."),
1127
+ datacontenttype: z
1128
+ .union([z.literal("application/json"), z.null()])
1129
+ .optional()
1130
+ .describe("Content type of the CloudEvents data value. Only the value \"application/json\" is allowed over HTTP."),
1131
+ dataschema: z
1132
+ .union([z.string(), z.null()])
1133
+ .optional()
1134
+ .describe("Identifies the schema that data adheres to."),
1135
+ subject: z
1136
+ .string()
1137
+ .min(1)
1138
+ .describe("Describes the subject of the event in the context of the event producer (identified by source)."),
1139
+ time: z
1140
+ .union([dateTime, z.null()])
1141
+ .optional()
1142
+ .describe("Timestamp of when the occurrence happened. Must adhere to RFC 3339."),
1143
+ data: z
1144
+ .union([z.record(z.string(), z.unknown()), z.null()])
1145
+ .optional()
1146
+ .describe("The event payload. Optional, if present it must be a JSON object."),
1147
+ })
1148
+ .describe("Metering event following the CloudEvents specification.");
1149
+ export const meterQueryRow = z
1150
+ .object({
1151
+ value: numeric,
1152
+ from: dateTime,
1153
+ to: dateTime,
1154
+ dimensions: z
1155
+ .record(z.string(), z.string())
1156
+ .describe("The dimensions the value is aggregated over. `subject` and `customer_id` are reserved dimensions."),
1157
+ })
1158
+ .describe("A row in the result of a meter query.");
1159
+ export const appStripeCreateCustomerPortalSessionResult = z
1160
+ .object({
1161
+ id: z
1162
+ .string()
1163
+ .describe("The ID of the customer portal session. See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-id"),
1164
+ stripe_customer_id: z.string().describe("The ID of the stripe customer."),
1165
+ configuration_id: z
1166
+ .string()
1167
+ .describe("Configuration used to customize the customer portal. See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-configuration"),
1168
+ livemode: z
1169
+ .boolean()
1170
+ .describe("Livemode. See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-livemode"),
1171
+ created_at: dateTime,
1172
+ return_url: z
1173
+ .string()
1174
+ .describe("Return URL. See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-return_url"),
1175
+ locale: z
1176
+ .string()
1177
+ .describe("The IETF language tag of the locale customer portal is displayed in. See: https://docs.stripe.com/api/customer_portal/sessions/object#portal_session_object-locale"),
1178
+ url: z
1179
+ .string()
1180
+ .describe("The URL to redirect the customer to after they have completed their requested actions."),
1181
+ })
1182
+ .describe("Result of creating a [Stripe Customer Portal Session](https://docs.stripe.com/api/customer_portal/sessions/object). Contains all the information needed to redirect the customer to the Stripe Customer Portal.");
1183
+ export const closedPeriod = z
1184
+ .object({
1185
+ from: dateTime,
1186
+ to: dateTime,
1187
+ })
1188
+ .describe("A period with defined start and end dates. The period is always inclusive at the start and exclusive at the end.");
1189
+ export const costBasis = z
1190
+ .object({
1191
+ id: ulid,
1192
+ fiat_code: currencyCode,
1193
+ rate: numeric,
1194
+ effective_from: dateTime.optional(),
1195
+ created_at: dateTime,
1196
+ })
1197
+ .describe("Describes currency basis supported by billing system.");
1198
+ export const createCostBasisRequest = z
1199
+ .object({
1200
+ fiat_code: currencyCode,
1201
+ rate: numeric,
1202
+ effective_from: dateTime.optional(),
1203
+ })
1204
+ .describe("CostBasis create request.");
1205
+ export const featureCostQueryRow = z
1206
+ .object({
1207
+ usage: numeric,
1208
+ cost: z
1209
+ .union([numeric, z.null()])
1210
+ .describe("The computed cost amount (usage × unit cost). Null when pricing is not available for the given combination of dimensions."),
1211
+ currency: currencyCode,
1212
+ detail: z
1213
+ .string()
1214
+ .optional()
1215
+ .describe("Detail message when cost amount is null, explaining why the cost could not be resolved."),
1216
+ from: dateTime,
1217
+ to: dateTime,
1218
+ dimensions: z
1219
+ .record(z.string(), z.string())
1220
+ .describe("The dimensions the value is aggregated over. `subject` and `customer_id` are reserved dimensions."),
1221
+ })
1222
+ .describe("A row in the result of a feature cost query.");
1223
+ export const resource = z
1224
+ .object({
1225
+ id: ulid,
1226
+ name: z
1227
+ .string()
1228
+ .min(1)
1229
+ .max(256)
1230
+ .describe("Display name of the resource. Between 1 and 256 characters."),
1231
+ description: z
1232
+ .string()
1233
+ .max(1024)
1234
+ .optional()
1235
+ .describe("Optional description of the resource. Maximum 1024 characters."),
1236
+ labels: labels.optional(),
1237
+ created_at: dateTime,
1238
+ updated_at: dateTime,
1239
+ deleted_at: dateTime.optional(),
1240
+ })
1241
+ .describe("Represents common fields of resources.");
1242
+ export const resourceImmutable = z
1243
+ .object({
1244
+ id: ulid,
1245
+ name: z
1246
+ .string()
1247
+ .min(1)
1248
+ .max(256)
1249
+ .describe("Display name of the resource. Between 1 and 256 characters."),
1250
+ description: z
1251
+ .string()
1252
+ .max(1024)
1253
+ .optional()
1254
+ .describe("Optional description of the resource. Maximum 1024 characters."),
1255
+ labels: labels.optional(),
1256
+ created_at: dateTime,
1257
+ })
1258
+ .describe("Represents common fields of immutable resources.");
1259
+ export const queryFilterDateTime = z
1260
+ .object({
1261
+ gt: dateTime.optional(),
1262
+ gte: dateTime.optional(),
1263
+ lt: dateTime.optional(),
1264
+ lte: dateTime.optional(),
1265
+ get and() {
1266
+ return z
1267
+ .array(queryFilterDateTime)
1268
+ .min(1)
1269
+ .max(10)
1270
+ .optional()
1271
+ .describe("Combines the provided filters with a logical AND.");
1272
+ },
1273
+ get or() {
1274
+ return z
1275
+ .array(queryFilterDateTime)
1276
+ .min(1)
1277
+ .max(10)
1278
+ .optional()
1279
+ .describe("Combines the provided filters with a logical OR.");
1280
+ },
1281
+ })
1282
+ .describe("A query filter for a time attribute. Operators are mutually exclusive, only one operator is allowed at a time.");
1283
+ export const cursorMeta = z
1284
+ .object({
1285
+ page: cursorMetaPage,
1286
+ })
1287
+ .describe("Cursor pagination metadata.");
1288
+ export const invalidParameterStandard = z
1289
+ .object({
1290
+ field: z.string().describe("The name of the field that failed validation."),
1291
+ rule: invalidRules.optional(),
1292
+ source: z
1293
+ .string()
1294
+ .optional()
1295
+ .describe("The part of the request the field came from (e.g. `body`, `query`)."),
1296
+ reason: z
1297
+ .string()
1298
+ .describe("A human readable explanation of why the field failed validation."),
1299
+ })
1300
+ .describe("A parameter that failed a standard validation rule.");
1301
+ export const invalidParameterMinimumLength = z
1302
+ .object({
1303
+ field: z.string().describe("The name of the field that failed validation."),
1304
+ rule: invalidParameterMinimumRule,
1305
+ minimum: z.number().int().describe("The minimum allowed value or length."),
1306
+ source: z
1307
+ .string()
1308
+ .optional()
1309
+ .describe("The part of the request the field came from (e.g. `body`, `query`)."),
1310
+ reason: z
1311
+ .string()
1312
+ .describe("A human readable explanation of why the field failed validation."),
1313
+ })
1314
+ .describe("A parameter that failed a minimum-length (or minimum-value) validation rule.");
1315
+ export const invalidParameterMaximumLength = z
1316
+ .object({
1317
+ field: z.string().describe("The name of the field that failed validation."),
1318
+ rule: invalidParameterMaximumRule,
1319
+ maximum: z.number().int().describe("The maximum allowed value or length."),
1320
+ source: z
1321
+ .string()
1322
+ .optional()
1323
+ .describe("The part of the request the field came from (e.g. `body`, `query`)."),
1324
+ reason: z
1325
+ .string()
1326
+ .describe("A human readable explanation of why the field failed validation."),
1327
+ })
1328
+ .describe("A parameter that failed a maximum-length (or maximum-value) validation rule.");
1329
+ export const invalidParameterChoiceItem = z
1330
+ .object({
1331
+ field: z.string().describe("The name of the field that failed validation."),
1332
+ rule: invalidParameterChoiceRule,
1333
+ reason: z
1334
+ .string()
1335
+ .describe("A human readable explanation of why the field failed validation."),
1336
+ choices: z
1337
+ .array(z.unknown())
1338
+ .min(1)
1339
+ .describe("The allowed choices for the field."),
1340
+ source: z
1341
+ .string()
1342
+ .optional()
1343
+ .describe("The part of the request the field came from (e.g. `body`, `query`)."),
1344
+ })
1345
+ .describe("A parameter whose value was not one of the allowed choices.");
1346
+ export const invalidParameterDependentItem = z
1347
+ .object({
1348
+ field: z.string().describe("The name of the field that failed validation."),
1349
+ rule: invalidParameterDependentRule,
1350
+ reason: z
1351
+ .string()
1352
+ .describe("A human readable explanation of why the field failed validation."),
1353
+ dependents: z
1354
+ .array(z.unknown())
1355
+ .describe("The fields that this field depends on."),
1356
+ source: z
1357
+ .string()
1358
+ .optional()
1359
+ .describe("The part of the request the field came from (e.g. `body`, `query`)."),
1360
+ })
1361
+ .describe("A parameter that failed a dependent-fields validation rule.");
1362
+ export const unauthorized = baseError.describe("Unauthorized.");
1363
+ export const forbidden = baseError.describe("Forbidden.");
1364
+ export const notFound = baseError.describe("Not Found.");
1365
+ export const gone = baseError.describe("Gone.");
1366
+ export const conflict = baseError.describe("Conflict.");
1367
+ export const payloadTooLarge = baseError.describe("Payload Too Large.");
1368
+ export const unsupportedMediaType = baseError
1369
+ .describe("Unsupported Media Type.");
1370
+ export const unprocessableContent = baseError
1371
+ .describe("Unprocessable Content.");
1372
+ export const tooManyRequests = baseError.describe("Too Many Requests.");
1373
+ export const internal = baseError.describe("Internal Server Error.");
1374
+ export const notImplemented = baseError.describe("Not Implemented.");
1375
+ export const notAvailable = baseError.describe("Not Available.");
1376
+ export const createCreditGrantFilters = z
1377
+ .object({
1378
+ features: z
1379
+ .array(resourceKey)
1380
+ .optional()
1381
+ .describe("Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature."),
1382
+ })
1383
+ .describe("Filters for the credit grant.");
1384
+ export const creditGrantFilters = z
1385
+ .object({
1386
+ features: z
1387
+ .array(resourceKey)
1388
+ .optional()
1389
+ .describe("Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature."),
1390
+ })
1391
+ .describe("Filters for the credit grant.");
1392
+ export const upsertPlanAddonRequest = z
1393
+ .object({
1394
+ name: z
1395
+ .string()
1396
+ .min(1)
1397
+ .max(256)
1398
+ .describe("Display name of the resource. Between 1 and 256 characters."),
1399
+ description: z
1400
+ .string()
1401
+ .max(1024)
1402
+ .optional()
1403
+ .describe("Optional description of the resource. Maximum 1024 characters."),
1404
+ labels: labels.optional(),
1405
+ from_plan_phase: resourceKey,
1406
+ max_quantity: z
1407
+ .number()
1408
+ .int()
1409
+ .gte(1)
1410
+ .optional()
1411
+ .describe("The maximum number of times the add-on can be purchased for the plan. For single-instance add-ons this field must be omitted. For multi-instance add-ons when omitted, unlimited quantity can be purchased."),
1412
+ })
1413
+ .describe("PlanAddon upsert request.");
1414
+ export const resourceWithKey = z
1415
+ .object({
1416
+ id: ulid,
1417
+ name: z
1418
+ .string()
1419
+ .min(1)
1420
+ .max(256)
1421
+ .describe("Display name of the resource. Between 1 and 256 characters."),
1422
+ description: z
1423
+ .string()
1424
+ .max(1024)
1425
+ .optional()
1426
+ .describe("Optional description of the resource. Maximum 1024 characters."),
1427
+ labels: labels.optional(),
1428
+ created_at: dateTime,
1429
+ updated_at: dateTime,
1430
+ deleted_at: dateTime.optional(),
1431
+ key: resourceKey,
1432
+ })
1433
+ .describe("Represents common fields of resources with a key.");
1434
+ export const ulidOrResourceKey = z
1435
+ .union([ulid, resourceKey])
1436
+ .describe("ULID ID or Resource Key.");
1437
+ export const createMeterRequest = z
1438
+ .object({
1439
+ name: z
1440
+ .string()
1441
+ .min(1)
1442
+ .max(256)
1443
+ .describe("Display name of the resource. Between 1 and 256 characters."),
1444
+ description: z
1445
+ .string()
1446
+ .max(1024)
1447
+ .optional()
1448
+ .describe("Optional description of the resource. Maximum 1024 characters."),
1449
+ labels: labels.optional(),
1450
+ key: resourceKey,
1451
+ aggregation: meterAggregation,
1452
+ event_type: z
1453
+ .string()
1454
+ .min(1)
1455
+ .describe("The event type to include in the aggregation."),
1456
+ events_from: dateTime.optional(),
1457
+ value_property: z
1458
+ .string()
1459
+ .min(1)
1460
+ .optional()
1461
+ .describe("JSONPath expression to extract the value from the ingested event's data property. The ingested value for sum, avg, min, and max aggregations is a number or a string that can be parsed to a number. For unique_count aggregation, the ingested value must be a string. For count aggregation the value_property is ignored."),
1462
+ dimensions: z
1463
+ .record(z.string(), z.string())
1464
+ .optional()
1465
+ .describe("Named JSONPath expressions to extract the group by values from the event data. Keys must be unique and consist only alphanumeric and underscore characters."),
1466
+ })
1467
+ .describe("Meter create request.");
1468
+ export const meter = z
1469
+ .object({
1470
+ id: ulid,
1471
+ name: z
1472
+ .string()
1473
+ .min(1)
1474
+ .max(256)
1475
+ .describe("Display name of the resource. Between 1 and 256 characters."),
1476
+ description: z
1477
+ .string()
1478
+ .max(1024)
1479
+ .optional()
1480
+ .describe("Optional description of the resource. Maximum 1024 characters."),
1481
+ labels: labels.optional(),
1482
+ created_at: dateTime,
1483
+ updated_at: dateTime,
1484
+ deleted_at: dateTime.optional(),
1485
+ key: resourceKey,
1486
+ aggregation: meterAggregation,
1487
+ event_type: z
1488
+ .string()
1489
+ .min(1)
1490
+ .describe("The event type to include in the aggregation."),
1491
+ events_from: dateTime.optional(),
1492
+ value_property: z
1493
+ .string()
1494
+ .min(1)
1495
+ .optional()
1496
+ .describe("JSONPath expression to extract the value from the ingested event's data property. The ingested value for sum, avg, min, and max aggregations is a number or a string that can be parsed to a number. For unique_count aggregation, the ingested value must be a string. For count aggregation the value_property is ignored."),
1497
+ dimensions: z
1498
+ .record(z.string(), z.string())
1499
+ .optional()
1500
+ .describe("Named JSONPath expressions to extract the group by values from the event data. Keys must be unique and consist only alphanumeric and underscore characters."),
1501
+ })
1502
+ .describe("A meter is a configuration that defines how to match and aggregate events.");
1503
+ export const paginatedMeta = z
1504
+ .object({
1505
+ page: pageMeta,
1506
+ })
1507
+ .describe("Pagination metadata.");
1508
+ export const queryFilterStringMapItem = z
1509
+ .object({
1510
+ exists: z.boolean().optional().describe("The attribute exists."),
1511
+ eq: z
1512
+ .string()
1513
+ .optional()
1514
+ .describe("The attribute equals the provided value."),
1515
+ neq: z
1516
+ .string()
1517
+ .optional()
1518
+ .describe("The attribute does not equal the provided value."),
1519
+ in: z
1520
+ .array(z.string())
1521
+ .min(1)
1522
+ .max(100)
1523
+ .optional()
1524
+ .describe("The attribute is one of the provided values."),
1525
+ nin: z
1526
+ .array(z.string())
1527
+ .min(1)
1528
+ .max(100)
1529
+ .optional()
1530
+ .describe("The attribute is not one of the provided values."),
1531
+ contains: z
1532
+ .string()
1533
+ .optional()
1534
+ .describe("The attribute contains the provided value."),
1535
+ ncontains: z
1536
+ .string()
1537
+ .optional()
1538
+ .describe("The attribute does not contain the provided value."),
1539
+ and: z
1540
+ .array(queryFilterString)
1541
+ .min(1)
1542
+ .max(10)
1543
+ .optional()
1544
+ .describe("Combines the provided filters with a logical AND."),
1545
+ or: z
1546
+ .array(queryFilterString)
1547
+ .min(1)
1548
+ .max(10)
1549
+ .optional()
1550
+ .describe("Combines the provided filters with a logical OR."),
1551
+ })
1552
+ .describe("A query filter for an item in a string map attribute. Operators are mutually exclusive, only one operator is allowed at a time.");
1553
+ export const subscriptionCreate = z
1554
+ .object({
1555
+ labels: labels.optional(),
1556
+ customer: z
1557
+ .object({
1558
+ id: ulid.optional(),
1559
+ key: externalResourceKey.optional(),
1560
+ })
1561
+ .describe("The customer to create the subscription for."),
1562
+ plan: z
1563
+ .object({
1564
+ id: ulid.optional(),
1565
+ key: resourceKey.optional(),
1566
+ version: z
1567
+ .number()
1568
+ .int()
1569
+ .optional()
1570
+ .describe("The plan version of the subscription, if any. If not provided, the latest version of the plan will be used."),
1571
+ })
1572
+ .describe("The plan reference of the subscription."),
1573
+ billing_anchor: dateTime.optional(),
1574
+ })
1575
+ .describe("Subscription create request.");
1576
+ export const ulidOrExternalResourceKey = z
1577
+ .union([ulid, externalResourceKey])
1578
+ .describe("ULID ID or External Resource Key.");
1579
+ export const customerKeyReference = z
1580
+ .object({
1581
+ key: externalResourceKey,
1582
+ })
1583
+ .describe("Customer reference by external key.");
1584
+ export const customerUsageAttribution = z
1585
+ .object({
1586
+ subject_keys: z
1587
+ .array(usageAttributionSubjectKey)
1588
+ .describe("The subjects that are attributed to the customer. Can be empty when no usage event subjects are associated with the customer."),
1589
+ })
1590
+ .describe("Mapping to attribute metered usage to the customer. One customer can have zero or more subjects, but one subject can only belong to one customer.");
1591
+ export const billingAddress = z
1592
+ .object({
1593
+ country: countryCode.optional(),
1594
+ postal_code: z.string().optional().describe("Postal code."),
1595
+ state: z.string().optional().describe("State or province."),
1596
+ city: z.string().optional().describe("City."),
1597
+ line1: z.string().optional().describe("First line of the address."),
1598
+ line2: z.string().optional().describe("Second line of the address."),
1599
+ phone_number: z.string().optional().describe("Phone number."),
1600
+ })
1601
+ .describe("Address");
1602
+ export const address = z
1603
+ .object({
1604
+ country: countryCode.optional(),
1605
+ postal_code: z.string().optional().describe("Postal code."),
1606
+ state: z.string().optional().describe("State or province."),
1607
+ city: z.string().optional().describe("City."),
1608
+ line1: z.string().optional().describe("First line of the address."),
1609
+ line2: z.string().optional().describe("Second line of the address."),
1610
+ phone_number: z.string().optional().describe("Phone number."),
1611
+ })
1612
+ .describe("Address");
1613
+ export const appStripeCreateCheckoutSessionCustomerUpdate = z
1614
+ .object({
1615
+ address: appStripeCreateCheckoutSessionCustomerUpdateBehavior
1616
+ .optional()
1617
+ .default("never"),
1618
+ name: appStripeCreateCheckoutSessionCustomerUpdateBehavior
1619
+ .optional()
1620
+ .default("never"),
1621
+ shipping: appStripeCreateCheckoutSessionCustomerUpdateBehavior
1622
+ .optional()
1623
+ .default("never"),
1624
+ })
1625
+ .describe("Controls which customer fields can be updated by the checkout session.");
1626
+ export const appStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement = z
1627
+ .object({
1628
+ position: appStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition
1629
+ .optional(),
1630
+ })
1631
+ .describe("Payment method reuse agreement configuration.");
1632
+ export const appStripeCreateCheckoutSessionTaxIdCollection = z
1633
+ .object({
1634
+ enabled: z
1635
+ .boolean()
1636
+ .optional()
1637
+ .default(false)
1638
+ .describe("Enable tax ID collection during checkout. Defaults to false."),
1639
+ required: appStripeCreateCheckoutSessionTaxIdCollectionRequired
1640
+ .optional()
1641
+ .default("never"),
1642
+ })
1643
+ .describe("Tax ID collection configuration for checkout sessions.");
1644
+ export const appStripeCreateCheckoutSessionResult = z
1645
+ .object({
1646
+ customer_id: ulid,
1647
+ stripe_customer_id: z.string().describe("The Stripe customer ID."),
1648
+ session_id: z.string().describe("The Stripe checkout session ID."),
1649
+ setup_intent_id: z
1650
+ .string()
1651
+ .describe("The setup intent ID created for collecting the payment method."),
1652
+ client_secret: z
1653
+ .string()
1654
+ .optional()
1655
+ .describe("Client secret for initializing Stripe.js on the client side. Required for embedded checkout sessions. See: https://docs.stripe.com/payments/checkout/custom-success-page"),
1656
+ client_reference_id: z
1657
+ .string()
1658
+ .optional()
1659
+ .describe("The client reference ID provided in the request. Useful for reconciling the session with your internal systems."),
1660
+ customer_email: z
1661
+ .string()
1662
+ .optional()
1663
+ .describe("Customer's email address if provided to Stripe."),
1664
+ currency: currencyCode.optional(),
1665
+ created_at: dateTime,
1666
+ expires_at: dateTime.optional(),
1667
+ metadata: z
1668
+ .record(z.string(), z.string())
1669
+ .optional()
1670
+ .describe("Metadata attached to the checkout session."),
1671
+ status: z
1672
+ .string()
1673
+ .optional()
1674
+ .describe("The status of the checkout session. See: https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-status"),
1675
+ url: z
1676
+ .string()
1677
+ .optional()
1678
+ .describe("URL to redirect customers to the checkout page (for hosted mode)."),
1679
+ mode: appStripeCheckoutSessionMode,
1680
+ cancel_url: z
1681
+ .string()
1682
+ .optional()
1683
+ .describe("The cancel URL where customers are redirected if they cancel."),
1684
+ success_url: z
1685
+ .string()
1686
+ .optional()
1687
+ .describe("The success URL where customers are redirected after completion."),
1688
+ return_url: z
1689
+ .string()
1690
+ .optional()
1691
+ .describe("The return URL for embedded sessions after authentication."),
1692
+ })
1693
+ .describe("Result of creating a Stripe Checkout Session. Contains all the information needed to redirect customers to the checkout or initialize an embedded checkout flow.");
1694
+ export const customerStripeCreateCustomerPortalSessionRequest = z
1695
+ .object({
1696
+ stripe_options: appStripeCreateCustomerPortalSessionOptions,
1697
+ })
1698
+ .describe("Request to create a Stripe Customer Portal Session for the customer. Useful to redirect the customer to the Stripe Customer Portal to manage their payment methods, change their billing address and access their invoice history. Only returns URL if the customer billing profile is linked to a stripe app and customer.");
1699
+ export const entitlementAccessResult = z
1700
+ .object({
1701
+ type: entitlementType,
1702
+ feature_key: resourceKey,
1703
+ has_access: z
1704
+ .boolean()
1705
+ .describe("Whether the customer has access to the feature. Always true for `boolean` and `static` entitlements. Depends on balance for `metered` entitlements."),
1706
+ config: z
1707
+ .string()
1708
+ .optional()
1709
+ .describe("Only available for static entitlements. Config is the JSON parsable configuration of the entitlement. Useful to describe per customer configuration."),
1710
+ })
1711
+ .describe("Entitlement access result.");
1712
+ export const createCreditGrantPurchase = z
1713
+ .object({
1714
+ currency: currencyCode,
1715
+ per_unit_cost_basis: numeric.optional().default("1.0"),
1716
+ availability_policy: creditAvailabilityPolicy
1717
+ .optional()
1718
+ .default("on_creation"),
1719
+ })
1720
+ .describe("Purchase and payment terms of the grant.");
1721
+ export const recurringPeriod = z
1722
+ .object({
1723
+ anchor: dateTime,
1724
+ interval: iso8601Duration,
1725
+ })
1726
+ .describe("Recurring period with an anchor and an interval.");
1727
+ export const creditGrantPurchase = z
1728
+ .object({
1729
+ currency: currencyCode,
1730
+ per_unit_cost_basis: numeric.optional().default("1.0"),
1731
+ amount: numeric,
1732
+ availability_policy: creditAvailabilityPolicy
1733
+ .optional()
1734
+ .default("on_creation"),
1735
+ settlement_status: creditPurchasePaymentSettlementStatus.optional(),
1736
+ })
1737
+ .describe("Purchase and payment terms of the grant.");
1738
+ export const updateCreditGrantExternalSettlementRequest = z
1739
+ .object({
1740
+ status: creditPurchasePaymentSettlementStatus,
1741
+ })
1742
+ .describe("Request body for updating the external payment settlement status of a credit grant.");
1743
+ export const listCreditGrantsParamsFilter = z
1744
+ .object({
1745
+ status: creditGrantStatus.optional(),
1746
+ currency: currencyCode.optional(),
1747
+ })
1748
+ .describe("Filter options for listing credit grants.");
1749
+ export const getCreditBalanceParamsFilter = z
1750
+ .object({
1751
+ currency: stringFieldFilterExact.optional(),
1752
+ })
1753
+ .describe("Filter options for getting a credit balance.");
1754
+ export const listChargesParamsFilter = z
1755
+ .object({
1756
+ status: stringFieldFilterExact.optional(),
1757
+ })
1758
+ .describe("Filter options for listing charges.");
1759
+ export const listPlansParamsFilter = z
1760
+ .object({
1761
+ key: stringFieldFilter.optional(),
1762
+ name: stringFieldFilter.optional(),
1763
+ status: stringFieldFilterExact.optional(),
1764
+ currency: stringFieldFilterExact.optional(),
1765
+ })
1766
+ .describe("Filter options for listing plans.");
1767
+ export const rateCardProrationConfiguration = z
1768
+ .object({
1769
+ mode: rateCardProrationMode,
1770
+ })
1771
+ .describe("The proration configuration of the rate card.");
1772
+ export const subscription = z
1773
+ .object({
1774
+ id: ulid,
1775
+ labels: labels.optional(),
1776
+ created_at: dateTime,
1777
+ updated_at: dateTime,
1778
+ deleted_at: dateTime.optional(),
1779
+ customer_id: ulid,
1780
+ plan_id: ulid.optional(),
1781
+ billing_anchor: dateTime,
1782
+ status: subscriptionStatus,
1783
+ })
1784
+ .describe("Subscription.");
1785
+ export const subscriptionEditTiming = z
1786
+ .union([subscriptionEditTimingEnum, dateTime])
1787
+ .describe("Subscription edit timing defined when the changes should take effect. If the provided configuration is not supported by the subscription, an error will be returned.");
1788
+ export const appCatalogItem = z
1789
+ .object({
1790
+ type: appType,
1791
+ name: z.string().describe("Name of the app."),
1792
+ description: z.string().describe("Description of the app."),
1793
+ })
1794
+ .describe("Available apps for billing integrations to connect with third-party services. Apps can have various capabilities like syncing data from or to external systems, integrating with third-party services for tax calculation, delivery of invoices, collection of payments, etc.");
1795
+ export const taxCodeAppMapping = z
1796
+ .object({
1797
+ app_type: appType,
1798
+ tax_code: z.string().describe("Tax code."),
1799
+ })
1800
+ .describe("Mapping of app types to tax codes.");
1801
+ export const partyTaxIdentity = z
1802
+ .object({
1803
+ code: taxIdentificationCode.optional(),
1804
+ })
1805
+ .describe("Identity stores the details required to identify an entity for tax purposes in a specific country.");
1806
+ export const workflowPaymentSettings = z
1807
+ .discriminatedUnion("collection_method", [
1808
+ workflowPaymentChargeAutomaticallySettings,
1809
+ workflowPaymentSendInvoiceSettings
1810
+ ])
1811
+ .describe("Payment settings for a billing workflow.");
1812
+ export const listCurrenciesParamsFilter = z
1813
+ .object({
1814
+ type: currencyType.optional(),
1815
+ code: stringFieldFilter.optional(),
1816
+ })
1817
+ .describe("Filter options for listing currencies.");
1818
+ export const currencyCustom = z
1819
+ .object({
1820
+ id: ulid,
1821
+ type: z.literal("custom").describe("The type of the currency."),
1822
+ name: z
1823
+ .string()
1824
+ .min(1)
1825
+ .max(256)
1826
+ .describe("The name of the currency. It should be a human-readable string that represents the name of the currency, such as \"US Dollar\" or \"Euro\"."),
1827
+ description: z
1828
+ .string()
1829
+ .min(1)
1830
+ .max(256)
1831
+ .optional()
1832
+ .describe("Description of the currency."),
1833
+ symbol: z
1834
+ .string()
1835
+ .min(1)
1836
+ .optional()
1837
+ .describe("The symbol of the currency. It should be a string that represents the symbol of the currency, such as \"$\" for US Dollar or \"€\" for Euro."),
1838
+ code: currencyCodeCustom,
1839
+ created_at: dateTime,
1840
+ })
1841
+ .describe("Describes custom currency.");
1842
+ export const createCurrencyCustomRequest = z
1843
+ .object({
1844
+ name: z
1845
+ .string()
1846
+ .min(1)
1847
+ .max(256)
1848
+ .describe("The name of the currency. It should be a human-readable string that represents the name of the currency, such as \"US Dollar\" or \"Euro\"."),
1849
+ description: z
1850
+ .string()
1851
+ .min(1)
1852
+ .max(256)
1853
+ .optional()
1854
+ .describe("Description of the currency."),
1855
+ symbol: z
1856
+ .string()
1857
+ .min(1)
1858
+ .optional()
1859
+ .describe("The symbol of the currency. It should be a string that represents the symbol of the currency, such as \"$\" for US Dollar or \"€\" for Euro."),
1860
+ code: currencyCodeCustom,
1861
+ })
1862
+ .describe("CurrencyCustom create request.");
1863
+ export const governanceQueryRequest = z
1864
+ .object({
1865
+ include_credits: z
1866
+ .boolean()
1867
+ .optional()
1868
+ .default(false)
1869
+ .describe("Whether to include credit balance availability for each resolved customer. When true, each feature evaluation includes credit balance checks. Defaults to `false`."),
1870
+ customer: governanceQueryRequestCustomers,
1871
+ feature: governanceQueryRequestFeatures.optional(),
1872
+ })
1873
+ .describe("Query to evaluate feature access for a list of customers.");
1874
+ export const governanceFeatureAccessReason = z
1875
+ .object({
1876
+ code: governanceFeatureAccessReasonCode,
1877
+ message: z.string().describe("Human-readable description of the error."),
1878
+ attributes: z
1879
+ .record(z.string(), z.unknown())
1880
+ .optional()
1881
+ .describe("Additional structured context."),
1882
+ })
1883
+ .describe("Reason a feature is not accessible to a customer.");
1884
+ export const governanceQueryError = z
1885
+ .object({
1886
+ code: governanceQueryErrorCode,
1887
+ message: z.string().describe("Human-readable description of the error."),
1888
+ attributes: z
1889
+ .record(z.string(), z.unknown())
1890
+ .optional()
1891
+ .describe("Additional structured context."),
1892
+ customer: z
1893
+ .string()
1894
+ .optional()
1895
+ .describe("The customer identifier from the request that produced this error."),
1896
+ })
1897
+ .describe("Query error within a partially successful governance query response.");
1898
+ export const unitConfig = z
1899
+ .object({
1900
+ operation: unitConfigOperation,
1901
+ conversion_factor: numeric,
1902
+ rounding: unitConfigRoundingMode.optional().default("none"),
1903
+ precision: z
1904
+ .number()
1905
+ .int()
1906
+ .optional()
1907
+ .default(0)
1908
+ .describe("The number of decimal places to retain after rounding. Only meaningful when rounding is not \"none\". Defaults to 0 (round to whole numbers)."),
1909
+ display_unit: z
1910
+ .string()
1911
+ .optional()
1912
+ .describe("A human-readable label for the converted unit shown on invoices and in the customer portal (e.g., \"GB\", \"hours\", \"M tokens\"). Optional. When omitted, no unit label is rendered."),
1913
+ })
1914
+ .describe("Unit conversion configuration. Transforms raw metered quantities into billing-ready units before pricing and entitlement evaluation. Applied at the rate card level so the same feature can be billed in different units across plans. Examples: - Meter bytes, bill GB: operation=divide, conversionFactor=1e9, rounding=ceiling, displayUnit=\"GB\" - Meter seconds, bill hours: operation=divide, conversionFactor=3600, rounding=ceiling, displayUnit=\"hours\" - Cost + 20% margin: operation=multiply, conversionFactor=1.2 - Bill per million tokens: operation=divide, conversionFactor=1e6, rounding=ceiling, displayUnit=\"M\" v1 equivalents: - DynamicPrice(multiplier): operation=multiply, conversionFactor=multiplier + UnitPrice(amount=1) - PackagePrice(amount, quantityPerPkg): operation=divide, conversionFactor=quantityPerPkg, rounding=ceiling + UnitPrice(amount)");
1915
+ export const appCustomerData = z
1916
+ .object({
1917
+ stripe: appCustomerDataStripe.optional(),
1918
+ external_invoicing: appCustomerDataExternalInvoicing.optional(),
1919
+ })
1920
+ .describe("App customer data.");
1921
+ export const upsertAppCustomerDataRequest = z
1922
+ .object({
1923
+ stripe: appCustomerDataStripe.optional(),
1924
+ external_invoicing: appCustomerDataExternalInvoicing.optional(),
1925
+ })
1926
+ .describe("AppCustomerData upsert request.");
1927
+ export const creditAdjustment = z
1928
+ .object({
1929
+ name: z
1930
+ .string()
1931
+ .min(1)
1932
+ .max(256)
1933
+ .describe("Display name of the resource. Between 1 and 256 characters."),
1934
+ description: z
1935
+ .string()
1936
+ .max(1024)
1937
+ .optional()
1938
+ .describe("Optional description of the resource. Maximum 1024 characters."),
1939
+ labels: labels.optional(),
1940
+ currency: billingCurrencyCode,
1941
+ amount: numeric,
1942
+ })
1943
+ .describe("A credit adjustment can be used to make manual adjustments to a customer's credit balance. Supported use-cases: - Usage correction");
1944
+ export const creditBalance = z
1945
+ .object({
1946
+ currency: billingCurrencyCode,
1947
+ pending: numeric,
1948
+ available: numeric,
1949
+ })
1950
+ .describe("The credit balance by currency.");
1951
+ export const createCreditAdjustmentRequest = z
1952
+ .object({
1953
+ name: z
1954
+ .string()
1955
+ .min(1)
1956
+ .max(256)
1957
+ .describe("Display name of the resource. Between 1 and 256 characters."),
1958
+ description: z
1959
+ .string()
1960
+ .max(1024)
1961
+ .optional()
1962
+ .describe("Optional description of the resource. Maximum 1024 characters."),
1963
+ labels: labels.optional(),
1964
+ currency: billingCurrencyCode,
1965
+ amount: numeric,
1966
+ })
1967
+ .describe("CreditAdjustment create request.");
1968
+ export const listCreditTransactionsParamsFilter = z
1969
+ .object({
1970
+ type: creditTransactionType.optional(),
1971
+ currency: billingCurrencyCode.optional(),
1972
+ })
1973
+ .describe("Filter options for listing credit transactions.");
1974
+ export const creditTransaction = z
1975
+ .object({
1976
+ id: ulid,
1977
+ name: z
1978
+ .string()
1979
+ .min(1)
1980
+ .max(256)
1981
+ .describe("Display name of the resource. Between 1 and 256 characters."),
1982
+ description: z
1983
+ .string()
1984
+ .max(1024)
1985
+ .optional()
1986
+ .describe("Optional description of the resource. Maximum 1024 characters."),
1987
+ labels: labels.optional(),
1988
+ created_at: dateTime,
1989
+ booked_at: dateTime,
1990
+ type: creditTransactionType,
1991
+ currency: billingCurrencyCode,
1992
+ amount: numeric,
1993
+ available_balance: z
1994
+ .object({
1995
+ before: numeric,
1996
+ after: numeric,
1997
+ })
1998
+ .describe("The available balance before and after the transaction."),
1999
+ })
2000
+ .describe("A credit transaction represents a single credit movement on the customer's balance. Credit transactions are immutable.");
2001
+ export const priceTier = z
2002
+ .object({
2003
+ up_to_amount: numeric.optional(),
2004
+ flat_price: priceFlat.optional(),
2005
+ unit_price: priceUnit.optional(),
2006
+ })
2007
+ .describe("A price tier used in graduated and volume pricing. At least one price component (flat_price or unit_price) must be set. When UnitConfig is present on the rate card, up_to_amount is expressed in converted billing units.");
2008
+ export const chargeTotals = z
2009
+ .object({
2010
+ booked: totals,
2011
+ realtime: totals.optional(),
2012
+ })
2013
+ .describe("The totals of a change. RealTime is only expanded when the `real_time_usage` expand is used.");
2014
+ export const featureLlmUnitCost = z
2015
+ .object({
2016
+ type: z
2017
+ .literal("llm")
2018
+ .describe("The type discriminator for LLM unit cost."),
2019
+ provider_property: z
2020
+ .string()
2021
+ .optional()
2022
+ .describe("Meter group-by property that holds the LLM provider. Use this when the meter has a group-by dimension for provider. Mutually exclusive with `provider`."),
2023
+ provider: z
2024
+ .string()
2025
+ .optional()
2026
+ .describe("Static LLM provider value (e.g., \"openai\", \"anthropic\"). Use this when the feature tracks a single provider. Mutually exclusive with `provider_property`."),
2027
+ model_property: z
2028
+ .string()
2029
+ .optional()
2030
+ .describe("Meter group-by property that holds the model ID. Use this when the meter has a group-by dimension for model. Mutually exclusive with `model`."),
2031
+ model: z
2032
+ .string()
2033
+ .optional()
2034
+ .describe("Static model ID value (e.g., \"gpt-4\", \"claude-3-5-sonnet\"). Use this when the feature tracks a single model. Mutually exclusive with `model_property`."),
2035
+ token_type_property: z
2036
+ .string()
2037
+ .optional()
2038
+ .describe("Meter group-by property that holds the token type. Use this when the meter has a group-by dimension for token type. Mutually exclusive with `token_type`."),
2039
+ token_type: featureLlmTokenType.optional(),
2040
+ pricing: featureLlmUnitCostPricing.optional(),
2041
+ })
2042
+ .describe("LLM cost lookup configuration. Each dimension (provider, model, token type) can be specified as either a static value or a meter group-by property name (mutually exclusive).");
2043
+ export const llmCostPrice = z
2044
+ .object({
2045
+ id: ulid,
2046
+ provider: llmCostProvider,
2047
+ model: llmCostModel,
2048
+ pricing: llmCostModelPricing,
2049
+ currency: currencyCode,
2050
+ source: llmCostPriceSource,
2051
+ effective_from: dateTime,
2052
+ effective_to: dateTime.optional(),
2053
+ created_at: dateTime,
2054
+ updated_at: dateTime,
2055
+ })
2056
+ .describe("An LLM cost price record, representing the cost per token for a specific model from a specific provider.");
2057
+ export const llmCostOverrideCreate = z
2058
+ .object({
2059
+ provider: z.string().describe("Provider/vendor of the model."),
2060
+ model_id: z.string().describe("Canonical model identifier."),
2061
+ model_name: z.string().optional().describe("Human-readable model name."),
2062
+ pricing: llmCostModelPricing,
2063
+ currency: currencyCode,
2064
+ effective_from: dateTime,
2065
+ effective_to: dateTime.optional(),
2066
+ })
2067
+ .describe("Input for creating a per-namespace price override. Unique per provider, model and currency. If an override already exists for the given provider, model and currency, it will be updated. If an override does not exist, it will be created.");
2068
+ export const listCustomersParamsFilter = z
2069
+ .object({
2070
+ key: stringFieldFilter.optional(),
2071
+ name: stringFieldFilter.optional(),
2072
+ primary_email: stringFieldFilter.optional(),
2073
+ usage_attribution_subject_key: stringFieldFilter.optional(),
2074
+ plan_key: stringFieldFilter.optional(),
2075
+ billing_profile_id: ulidFieldFilter.optional(),
2076
+ })
2077
+ .describe("Filter options for listing customers.");
2078
+ export const listSubscriptionsParamsFilter = z
2079
+ .object({
2080
+ id: ulidFieldFilter.optional(),
2081
+ customer_id: ulidFieldFilter.optional(),
2082
+ status: stringFieldFilterExact.optional(),
2083
+ plan_id: ulidFieldFilter.optional(),
2084
+ plan_key: stringFieldFilterExact.optional(),
2085
+ })
2086
+ .describe("Filter options for listing subscriptions.");
2087
+ export const listFeatureParamsFilter = z
2088
+ .object({
2089
+ meter_id: ulidFieldFilter.optional(),
2090
+ key: stringFieldFilter.optional(),
2091
+ name: stringFieldFilter.optional(),
2092
+ })
2093
+ .describe("Filter options for listing features.");
2094
+ export const listAddonsParamsFilter = z
2095
+ .object({
2096
+ id: ulidFieldFilter.optional(),
2097
+ key: stringFieldFilter.optional(),
2098
+ name: stringFieldFilter.optional(),
2099
+ status: stringFieldFilterExact.optional(),
2100
+ currency: stringFieldFilterExact.optional(),
2101
+ })
2102
+ .describe("Filter options for listing add-ons.");
2103
+ export const createCreditGrantTaxConfig = z
2104
+ .object({
2105
+ behavior: taxBehavior.optional(),
2106
+ tax_code: createResourceReference.optional(),
2107
+ })
2108
+ .describe("Tax configuration for a credit grant. Tax configuration should be provided to ensure correct revenue recognition, including for externally funded grants.");
2109
+ export const creditGrantTaxConfig = z
2110
+ .object({
2111
+ behavior: taxBehavior.optional(),
2112
+ tax_code: taxCodeReference.optional(),
2113
+ })
2114
+ .describe("Tax configuration for a credit grant. Tax configuration should be provided to ensure correct revenue recognition, including for externally funded grants.");
2115
+ export const taxConfig = z
2116
+ .object({
2117
+ behavior: taxBehavior.optional(),
2118
+ stripe: taxConfigStripe.optional(),
2119
+ external_invoicing: taxConfigExternalInvoicing.optional(),
2120
+ tax_code_id: ulid.optional(),
2121
+ tax_code: taxCodeReference.optional(),
2122
+ })
2123
+ .describe("Set of provider specific tax configs.");
2124
+ export const rateCardTaxConfig = z
2125
+ .object({
2126
+ behavior: taxBehavior.optional(),
2127
+ code: taxCodeReference,
2128
+ })
2129
+ .describe("The tax config of the rate card.");
2130
+ export const organizationDefaultTaxCodes = z
2131
+ .object({
2132
+ invoicing_tax_code: taxCodeReference,
2133
+ credit_grant_tax_code: taxCodeReference,
2134
+ created_at: dateTime,
2135
+ updated_at: dateTime,
2136
+ })
2137
+ .describe("Organization-level default tax code references. Stores the default tax codes applied to specific billing contexts for this organization. Provisioned automatically when the organization is created.");
2138
+ export const updateOrganizationDefaultTaxCodesRequest = z
2139
+ .object({
2140
+ invoicing_tax_code: taxCodeReference.optional(),
2141
+ credit_grant_tax_code: taxCodeReference.optional(),
2142
+ })
2143
+ .describe("OrganizationDefaultTaxCodes update request.");
2144
+ export const subscriptionAddon = z
2145
+ .object({
2146
+ id: ulid,
2147
+ name: z
2148
+ .string()
2149
+ .min(1)
2150
+ .max(256)
2151
+ .describe("Display name of the resource. Between 1 and 256 characters."),
2152
+ description: z
2153
+ .string()
2154
+ .max(1024)
2155
+ .optional()
2156
+ .describe("Optional description of the resource. Maximum 1024 characters."),
2157
+ labels: labels.optional(),
2158
+ created_at: dateTime,
2159
+ updated_at: dateTime,
2160
+ deleted_at: dateTime.optional(),
2161
+ addon: addonReference,
2162
+ quantity: z
2163
+ .number()
2164
+ .int()
2165
+ .gte(1)
2166
+ .describe("The quantity of the add-on. Always 1 for single instance add-ons."),
2167
+ quantity_at: dateTime,
2168
+ active_from: dateTime,
2169
+ active_to: dateTime.optional(),
2170
+ })
2171
+ .describe("Addon purchased with a subscription.");
2172
+ export const planAddon = z
2173
+ .object({
2174
+ id: ulid,
2175
+ name: z
2176
+ .string()
2177
+ .min(1)
2178
+ .max(256)
2179
+ .describe("Display name of the resource. Between 1 and 256 characters."),
2180
+ description: z
2181
+ .string()
2182
+ .max(1024)
2183
+ .optional()
2184
+ .describe("Optional description of the resource. Maximum 1024 characters."),
2185
+ labels: labels.optional(),
2186
+ created_at: dateTime,
2187
+ updated_at: dateTime,
2188
+ deleted_at: dateTime.optional(),
2189
+ addon: addonReference,
2190
+ from_plan_phase: resourceKey,
2191
+ max_quantity: z
2192
+ .number()
2193
+ .int()
2194
+ .gte(1)
2195
+ .optional()
2196
+ .describe("The maximum number of times the add-on can be purchased for the plan. For single-instance add-ons this field must be omitted. For multi-instance add-ons when omitted, unlimited quantity can be purchased."),
2197
+ validation_errors: z
2198
+ .array(productCatalogValidationError)
2199
+ .optional()
2200
+ .describe("List of validation errors."),
2201
+ })
2202
+ .describe("PlanAddon represents an association between a plan and an add-on, controlling which add-ons are available for purchase within a plan.");
2203
+ export const createPlanAddonRequest = z
2204
+ .object({
2205
+ name: z
2206
+ .string()
2207
+ .min(1)
2208
+ .max(256)
2209
+ .describe("Display name of the resource. Between 1 and 256 characters."),
2210
+ description: z
2211
+ .string()
2212
+ .max(1024)
2213
+ .optional()
2214
+ .describe("Optional description of the resource. Maximum 1024 characters."),
2215
+ labels: labels.optional(),
2216
+ addon: addonReference,
2217
+ from_plan_phase: resourceKey,
2218
+ max_quantity: z
2219
+ .number()
2220
+ .int()
2221
+ .gte(1)
2222
+ .optional()
2223
+ .describe("The maximum number of times the add-on can be purchased for the plan. For single-instance add-ons this field must be omitted. For multi-instance add-ons when omitted, unlimited quantity can be purchased."),
2224
+ })
2225
+ .describe("PlanAddon create request.");
2226
+ export const profileAppReferences = z
2227
+ .object({
2228
+ tax: appReference,
2229
+ invoicing: appReference,
2230
+ payment: appReference,
2231
+ })
2232
+ .describe("References to the applications used by a billing profile.");
2233
+ export const listEventsParamsFilter = z
2234
+ .object({
2235
+ id: stringFieldFilter.optional(),
2236
+ source: stringFieldFilter.optional(),
2237
+ subject: stringFieldFilter.optional(),
2238
+ type: stringFieldFilter.optional(),
2239
+ customer_id: ulidFieldFilter.optional(),
2240
+ time: dateTimeFieldFilter.optional(),
2241
+ ingested_at: dateTimeFieldFilter.optional(),
2242
+ stored_at: dateTimeFieldFilter.optional(),
2243
+ })
2244
+ .describe("Filter options for listing ingested events.");
2245
+ export const resourceFilters = z
2246
+ .object({
2247
+ name: stringFieldFilter.optional(),
2248
+ labels: labelsFieldFilter.optional(),
2249
+ public_labels: labelsFieldFilter.optional(),
2250
+ created_at: dateTimeFieldFilter.optional(),
2251
+ updated_at: dateTimeFieldFilter.optional(),
2252
+ deleted_at: dateTimeFieldFilter.optional(),
2253
+ })
2254
+ .describe("Resource filters.");
2255
+ export const fieldFilters = z
2256
+ .object({
2257
+ boolean: booleanFieldFilter.optional(),
2258
+ numeric: numericFieldFilter.optional(),
2259
+ string: stringFieldFilter.optional(),
2260
+ string_exact: stringFieldFilterExact.optional(),
2261
+ ulid: ulidFieldFilter.optional(),
2262
+ datetime: dateTimeFieldFilter.optional(),
2263
+ labels: labelsFieldFilter.optional(),
2264
+ })
2265
+ .describe("Field filters with all supported types.");
2266
+ export const ingestedEvent = z
2267
+ .object({
2268
+ event: event,
2269
+ customer: customerReference.optional(),
2270
+ ingested_at: dateTime,
2271
+ stored_at: dateTime,
2272
+ validation_errors: z
2273
+ .array(ingestedEventValidationError)
2274
+ .optional()
2275
+ .describe("The validation errors of the ingested event."),
2276
+ })
2277
+ .describe("An ingested metering event with ingestion metadata.");
2278
+ export const meterQueryResult = z
2279
+ .object({
2280
+ from: dateTime.optional(),
2281
+ to: dateTime.optional(),
2282
+ data: z
2283
+ .array(meterQueryRow)
2284
+ .describe("The usage data. If no data is available, an empty array is returned."),
2285
+ })
2286
+ .describe("Meter query result.");
2287
+ export const featureCostQueryResult = z
2288
+ .object({
2289
+ from: dateTime.optional(),
2290
+ to: dateTime.optional(),
2291
+ data: z.array(featureCostQueryRow).describe("The cost data rows."),
2292
+ })
2293
+ .describe("Result of a feature cost query.");
2294
+ export const invalidParameter = z
2295
+ .union([
2296
+ invalidParameterStandard,
2297
+ invalidParameterMinimumLength,
2298
+ invalidParameterMaximumLength,
2299
+ invalidParameterChoiceItem,
2300
+ invalidParameterDependentItem
2301
+ ])
2302
+ .describe("A parameter that failed validation.");
2303
+ export const meterPagePaginatedResponse = z
2304
+ .object({
2305
+ data: z.array(meter),
2306
+ meta: paginatedMeta,
2307
+ })
2308
+ .describe("Page paginated response.");
2309
+ export const costBasisPagePaginatedResponse = z
2310
+ .object({
2311
+ data: z.array(costBasis),
2312
+ meta: paginatedMeta,
2313
+ })
2314
+ .describe("Page paginated response.");
2315
+ export const meterQueryFilters = z
2316
+ .object({
2317
+ dimensions: z
2318
+ .record(z.string(), queryFilterStringMapItem)
2319
+ .optional()
2320
+ .describe("Filters to apply to the dimensions of the query. For `subject` and `customer_id` only equals (\"eq\", \"in\") comparisons are supported."),
2321
+ })
2322
+ .describe("Filters to apply to a meter query.");
2323
+ export const featureMeterReference = z
2324
+ .object({
2325
+ id: ulid,
2326
+ filters: z
2327
+ .record(z.string(), queryFilterStringMapItem)
2328
+ .optional()
2329
+ .describe("Filters to apply to the dimensions of the meter."),
2330
+ })
2331
+ .describe("Reference to a meter associated with a feature.");
2332
+ export const createCustomerRequest = z
2333
+ .object({
2334
+ name: z
2335
+ .string()
2336
+ .min(1)
2337
+ .max(256)
2338
+ .describe("Display name of the resource. Between 1 and 256 characters."),
2339
+ description: z
2340
+ .string()
2341
+ .max(1024)
2342
+ .optional()
2343
+ .describe("Optional description of the resource. Maximum 1024 characters."),
2344
+ labels: labels.optional(),
2345
+ key: externalResourceKey,
2346
+ usage_attribution: customerUsageAttribution.optional(),
2347
+ primary_email: z
2348
+ .string()
2349
+ .optional()
2350
+ .describe("The primary email address of the customer."),
2351
+ currency: currencyCode.optional(),
2352
+ billing_address: billingAddress.optional(),
2353
+ })
2354
+ .describe("Customer create request.");
2355
+ export const customer = z
2356
+ .object({
2357
+ id: ulid,
2358
+ name: z
2359
+ .string()
2360
+ .min(1)
2361
+ .max(256)
2362
+ .describe("Display name of the resource. Between 1 and 256 characters."),
2363
+ description: z
2364
+ .string()
2365
+ .max(1024)
2366
+ .optional()
2367
+ .describe("Optional description of the resource. Maximum 1024 characters."),
2368
+ labels: labels.optional(),
2369
+ created_at: dateTime,
2370
+ updated_at: dateTime,
2371
+ deleted_at: dateTime.optional(),
2372
+ key: externalResourceKey,
2373
+ usage_attribution: customerUsageAttribution.optional(),
2374
+ primary_email: z
2375
+ .string()
2376
+ .optional()
2377
+ .describe("The primary email address of the customer."),
2378
+ currency: currencyCode.optional(),
2379
+ billing_address: billingAddress.optional(),
2380
+ })
2381
+ .describe("Customers can be individuals or organizations that can subscribe to plans and have access to features.");
2382
+ export const upsertCustomerRequest = z
2383
+ .object({
2384
+ name: z
2385
+ .string()
2386
+ .min(1)
2387
+ .max(256)
2388
+ .describe("Display name of the resource. Between 1 and 256 characters."),
2389
+ description: z
2390
+ .string()
2391
+ .max(1024)
2392
+ .optional()
2393
+ .describe("Optional description of the resource. Maximum 1024 characters."),
2394
+ labels: labels.optional(),
2395
+ usage_attribution: customerUsageAttribution.optional(),
2396
+ primary_email: z
2397
+ .string()
2398
+ .optional()
2399
+ .describe("The primary email address of the customer."),
2400
+ currency: currencyCode.optional(),
2401
+ billing_address: billingAddress.optional(),
2402
+ })
2403
+ .describe("Customer upsert request.");
2404
+ export const partyAddresses = z
2405
+ .object({
2406
+ billing_address: address,
2407
+ })
2408
+ .describe("A collection of addresses for the party.");
2409
+ export const appStripeCreateCheckoutSessionConsentCollection = z
2410
+ .object({
2411
+ payment_method_reuse_agreement: appStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement
2412
+ .optional(),
2413
+ promotions: appStripeCreateCheckoutSessionConsentCollectionPromotions
2414
+ .optional(),
2415
+ terms_of_service: appStripeCreateCheckoutSessionConsentCollectionTermsOfService
2416
+ .optional(),
2417
+ })
2418
+ .describe("Checkout Session consent collection configuration.");
2419
+ export const listCustomerEntitlementAccessResponseData = z
2420
+ .object({
2421
+ data: z
2422
+ .array(entitlementAccessResult)
2423
+ .describe("The list of entitlement access results."),
2424
+ })
2425
+ .describe("List customer entitlement access response data.");
2426
+ export const workflowCollectionAlignmentAnchored = z
2427
+ .object({
2428
+ type: z.literal("anchored").describe("The type of alignment."),
2429
+ recurring_period: recurringPeriod,
2430
+ })
2431
+ .describe("BillingWorkflowCollectionAlignmentAnchored specifies the alignment for collecting the pending line items into an invoice.");
2432
+ export const subscriptionPagePaginatedResponse = z
2433
+ .object({
2434
+ data: z.array(subscription),
2435
+ meta: paginatedMeta,
2436
+ })
2437
+ .describe("Page paginated response.");
2438
+ export const subscriptionChangeResponse = z
2439
+ .object({
2440
+ current: subscription,
2441
+ next: subscription,
2442
+ })
2443
+ .describe("Response for changing a subscription.");
2444
+ export const subscriptionCancel = z
2445
+ .object({
2446
+ timing: subscriptionEditTiming.optional().default("immediate"),
2447
+ })
2448
+ .describe("Request for canceling a subscription.");
2449
+ export const subscriptionChange = z
2450
+ .object({
2451
+ labels: labels.optional(),
2452
+ customer: z
2453
+ .object({
2454
+ id: ulid.optional(),
2455
+ key: externalResourceKey.optional(),
2456
+ })
2457
+ .describe("The customer to create the subscription for."),
2458
+ plan: z
2459
+ .object({
2460
+ id: ulid.optional(),
2461
+ key: resourceKey.optional(),
2462
+ version: z
2463
+ .number()
2464
+ .int()
2465
+ .optional()
2466
+ .describe("The plan version of the subscription, if any. If not provided, the latest version of the plan will be used."),
2467
+ })
2468
+ .describe("The plan reference of the subscription."),
2469
+ billing_anchor: dateTime.optional(),
2470
+ timing: subscriptionEditTiming,
2471
+ })
2472
+ .describe("Request for changing a subscription.");
2473
+ export const appStripe = z
2474
+ .object({
2475
+ id: ulid,
2476
+ name: z
2477
+ .string()
2478
+ .min(1)
2479
+ .max(256)
2480
+ .describe("Display name of the resource. Between 1 and 256 characters."),
2481
+ description: z
2482
+ .string()
2483
+ .max(1024)
2484
+ .optional()
2485
+ .describe("Optional description of the resource. Maximum 1024 characters."),
2486
+ labels: labels.optional(),
2487
+ created_at: dateTime,
2488
+ updated_at: dateTime,
2489
+ deleted_at: dateTime.optional(),
2490
+ type: z.literal("stripe").describe("The app type."),
2491
+ definition: appCatalogItem,
2492
+ status: appStatus,
2493
+ account_id: z
2494
+ .string()
2495
+ .describe("The Stripe account ID associated with the connected Stripe account."),
2496
+ livemode: z
2497
+ .boolean()
2498
+ .describe("Indicates whether the app is connected to a live Stripe account."),
2499
+ masked_api_key: z
2500
+ .string()
2501
+ .describe("The masked Stripe API key that only exposes the first and last few characters."),
2502
+ secret_api_key: z
2503
+ .string()
2504
+ .optional()
2505
+ .describe("The Stripe secret API key used to authenticate API requests."),
2506
+ })
2507
+ .describe("Stripe app.");
2508
+ export const appSandbox = z
2509
+ .object({
2510
+ id: ulid,
2511
+ name: z
2512
+ .string()
2513
+ .min(1)
2514
+ .max(256)
2515
+ .describe("Display name of the resource. Between 1 and 256 characters."),
2516
+ description: z
2517
+ .string()
2518
+ .max(1024)
2519
+ .optional()
2520
+ .describe("Optional description of the resource. Maximum 1024 characters."),
2521
+ labels: labels.optional(),
2522
+ created_at: dateTime,
2523
+ updated_at: dateTime,
2524
+ deleted_at: dateTime.optional(),
2525
+ type: z.literal("sandbox").describe("The app type."),
2526
+ definition: appCatalogItem,
2527
+ status: appStatus,
2528
+ })
2529
+ .describe("Sandbox app can be used for testing billing features.");
2530
+ export const appExternalInvoicing = z
2531
+ .object({
2532
+ id: ulid,
2533
+ name: z
2534
+ .string()
2535
+ .min(1)
2536
+ .max(256)
2537
+ .describe("Display name of the resource. Between 1 and 256 characters."),
2538
+ description: z
2539
+ .string()
2540
+ .max(1024)
2541
+ .optional()
2542
+ .describe("Optional description of the resource. Maximum 1024 characters."),
2543
+ labels: labels.optional(),
2544
+ created_at: dateTime,
2545
+ updated_at: dateTime,
2546
+ deleted_at: dateTime.optional(),
2547
+ type: z.literal("external_invoicing").describe("The app type."),
2548
+ definition: appCatalogItem,
2549
+ status: appStatus,
2550
+ enable_draft_sync_hook: z
2551
+ .boolean()
2552
+ .describe("Enable draft synchronization hook. When enabled, invoices will pause at the draft state and wait for the integration to call the draft synchronized endpoint before progressing to the issuing state. This allows the external system to validate and prepare the invoice data. When disabled, invoices automatically progress through the draft state based on the configured workflow timing."),
2553
+ enable_issuing_sync_hook: z
2554
+ .boolean()
2555
+ .describe("Enable issuing synchronization hook. When enabled, invoices will pause at the issuing state and wait for the integration to call the issuing synchronized endpoint before progressing to the issued state. This ensures the external invoicing system has successfully created and finalized the invoice before it is marked as issued. When disabled, invoices automatically progress through the issuing state and are immediately marked as issued."),
2556
+ })
2557
+ .describe("External Invoicing app enables integration with third-party invoicing or payment system. The app supports a bi-directional synchronization pattern where OpenMeter Billing manages the invoice lifecycle while the external system handles invoice presentation and payment collection. Integration workflow: 1. The billing system creates invoices and transitions them through lifecycle states (draft → issuing → issued) 2. The integration receives webhook notifications about invoice state changes 3. The integration calls back to provide external system IDs and metadata 4. The integration reports payment events back via the payment status API State synchronization is controlled by hooks that pause invoice progression until the external system confirms synchronization via API callbacks.");
2558
+ export const createTaxCodeRequest = z
2559
+ .object({
2560
+ name: z
2561
+ .string()
2562
+ .min(1)
2563
+ .max(256)
2564
+ .describe("Display name of the resource. Between 1 and 256 characters."),
2565
+ description: z
2566
+ .string()
2567
+ .max(1024)
2568
+ .optional()
2569
+ .describe("Optional description of the resource. Maximum 1024 characters."),
2570
+ labels: labels.optional(),
2571
+ key: resourceKey,
2572
+ app_mappings: z
2573
+ .array(taxCodeAppMapping)
2574
+ .describe("Mapping of app types to tax codes."),
2575
+ })
2576
+ .describe("TaxCode create request.");
2577
+ export const taxCode = z
2578
+ .object({
2579
+ id: ulid,
2580
+ name: z
2581
+ .string()
2582
+ .min(1)
2583
+ .max(256)
2584
+ .describe("Display name of the resource. Between 1 and 256 characters."),
2585
+ description: z
2586
+ .string()
2587
+ .max(1024)
2588
+ .optional()
2589
+ .describe("Optional description of the resource. Maximum 1024 characters."),
2590
+ labels: labels.optional(),
2591
+ created_at: dateTime,
2592
+ updated_at: dateTime,
2593
+ deleted_at: dateTime.optional(),
2594
+ key: resourceKey,
2595
+ app_mappings: z
2596
+ .array(taxCodeAppMapping)
2597
+ .describe("Mapping of app types to tax codes."),
2598
+ })
2599
+ .describe("Tax codes by provider.");
2600
+ export const upsertTaxCodeRequest = z
2601
+ .object({
2602
+ name: z
2603
+ .string()
2604
+ .min(1)
2605
+ .max(256)
2606
+ .describe("Display name of the resource. Between 1 and 256 characters."),
2607
+ description: z
2608
+ .string()
2609
+ .max(1024)
2610
+ .optional()
2611
+ .describe("Optional description of the resource. Maximum 1024 characters."),
2612
+ labels: labels.optional(),
2613
+ app_mappings: z
2614
+ .array(taxCodeAppMapping)
2615
+ .describe("Mapping of app types to tax codes."),
2616
+ })
2617
+ .describe("TaxCode upsert request.");
2618
+ export const currency = z
2619
+ .discriminatedUnion("type", [currencyFiat, currencyCustom])
2620
+ .describe("Fiat or custom currency.");
2621
+ export const governanceFeatureAccess = z
2622
+ .object({
2623
+ has_access: z
2624
+ .boolean()
2625
+ .describe("Whether the customer currently has access to the feature. `true` for boolean and static entitlements that are available, and for metered entitlements with remaining balance. `false` when the feature is unavailable, the usage limit has been reached, or (when applicable) credits have been exhausted."),
2626
+ reason: governanceFeatureAccessReason.optional(),
2627
+ })
2628
+ .describe("Access status for a single feature.");
2629
+ export const invoiceUsageQuantityDetail = z
2630
+ .object({
2631
+ raw_quantity: numeric,
2632
+ converted_quantity: numeric,
2633
+ invoiced_quantity: numeric,
2634
+ display_unit: z
2635
+ .string()
2636
+ .optional()
2637
+ .describe("The display unit label (e.g., \"GB\", \"hours\", \"M tokens\")."),
2638
+ applied_unit_config: unitConfig,
2639
+ })
2640
+ .describe("Usage quantity details on an invoice line item when UnitConfig is in effect. Provides the full audit trail from raw meter output to the invoiced amount.");
2641
+ export const customerData = z
2642
+ .object({
2643
+ billing_profile: profileReference.optional(),
2644
+ app_data: appCustomerData.optional(),
2645
+ })
2646
+ .describe("Billing customer data.");
2647
+ export const upsertCustomerBillingDataRequest = z
2648
+ .object({
2649
+ billing_profile: profileReference.optional(),
2650
+ app_data: appCustomerData.optional(),
2651
+ })
2652
+ .describe("CustomerBillingData upsert request.");
2653
+ export const creditBalances = z
2654
+ .object({
2655
+ retrieved_at: dateTime,
2656
+ balances: z.array(creditBalance).describe("The balances by currencies."),
2657
+ })
2658
+ .describe("The balances of the credits of a customer.");
2659
+ export const creditTransactionPaginatedResponse = z
2660
+ .object({
2661
+ data: z.array(creditTransaction),
2662
+ meta: cursorMeta,
2663
+ })
2664
+ .describe("Cursor paginated response.");
2665
+ export const priceGraduated = z
2666
+ .object({
2667
+ type: z.literal("graduated").describe("The type of the price."),
2668
+ tiers: z
2669
+ .array(priceTier)
2670
+ .min(1)
2671
+ .describe("The tiers of the graduated price. At least one tier is required."),
2672
+ })
2673
+ .describe("Graduated tiered price. Each tier's rate applies only to the usage within that tier. Pricing can change as cumulative usage crosses tier boundaries. When UnitConfig is present on the rate card, tier boundaries (up_to_amount) are expressed in converted billing units.");
2674
+ export const priceVolume = z
2675
+ .object({
2676
+ type: z.literal("volume").describe("The type of the price."),
2677
+ tiers: z
2678
+ .array(priceTier)
2679
+ .min(1)
2680
+ .describe("The tiers of the volume price. At least one tier is required."),
2681
+ })
2682
+ .describe("Volume tiered price. The maximum quantity within a period determines the per-unit price for all units in that period. When UnitConfig is present on the rate card, tier boundaries (up_to_amount) are expressed in converted billing units.");
2683
+ export const featureUnitCost = z
2684
+ .discriminatedUnion("type", [featureManualUnitCost, featureLlmUnitCost])
2685
+ .describe("Per-unit cost configuration for a feature. Either a fixed manual amount or a dynamic LLM cost lookup.");
2686
+ export const pricePagePaginatedResponse = z
2687
+ .object({
2688
+ data: z.array(llmCostPrice),
2689
+ meta: paginatedMeta,
2690
+ })
2691
+ .describe("Page paginated response.");
2692
+ export const createCreditGrantRequest = z
2693
+ .object({
2694
+ name: z
2695
+ .string()
2696
+ .min(1)
2697
+ .max(256)
2698
+ .describe("Display name of the resource. Between 1 and 256 characters."),
2699
+ description: z
2700
+ .string()
2701
+ .max(1024)
2702
+ .optional()
2703
+ .describe("Optional description of the resource. Maximum 1024 characters."),
2704
+ labels: createLabels.optional(),
2705
+ funding_method: creditFundingMethod,
2706
+ currency: createCurrencyCode,
2707
+ amount: numeric,
2708
+ purchase: createCreditGrantPurchase.optional(),
2709
+ tax_config: createCreditGrantTaxConfig.optional(),
2710
+ filters: createCreditGrantFilters.optional(),
2711
+ priority: z.coerce
2712
+ .bigint()
2713
+ .gte(1n)
2714
+ .lte(1000n)
2715
+ .optional()
2716
+ .default(10n)
2717
+ .describe("Draw-down priority of the grant. Lower values have higher priority."),
2718
+ expires_after: iso8601Duration.optional(),
2719
+ })
2720
+ .describe("CreditGrant create request.");
2721
+ export const creditGrant = z
2722
+ .object({
2723
+ id: ulid,
2724
+ name: z
2725
+ .string()
2726
+ .min(1)
2727
+ .max(256)
2728
+ .describe("Display name of the resource. Between 1 and 256 characters."),
2729
+ description: z
2730
+ .string()
2731
+ .max(1024)
2732
+ .optional()
2733
+ .describe("Optional description of the resource. Maximum 1024 characters."),
2734
+ labels: labels.optional(),
2735
+ created_at: dateTime,
2736
+ updated_at: dateTime,
2737
+ deleted_at: dateTime.optional(),
2738
+ funding_method: creditFundingMethod,
2739
+ currency: billingCurrencyCode,
2740
+ amount: numeric,
2741
+ purchase: creditGrantPurchase.optional(),
2742
+ tax_config: creditGrantTaxConfig.optional(),
2743
+ invoice: creditGrantInvoiceReference.optional(),
2744
+ filters: creditGrantFilters.optional(),
2745
+ priority: z.coerce
2746
+ .bigint()
2747
+ .gte(1n)
2748
+ .lte(1000n)
2749
+ .optional()
2750
+ .default(10n)
2751
+ .describe("Draw-down priority of the grant. Lower values have higher priority."),
2752
+ expires_after: iso8601Duration.optional(),
2753
+ expires_at: dateTime.optional(),
2754
+ voided_at: dateTime.optional(),
2755
+ status: creditGrantStatus,
2756
+ })
2757
+ .describe("A credit grant allocates credits to a customer. Credits are drawn down against charges according to the settlement mode configured on the rate card.");
2758
+ export const workflowTaxSettings = z
2759
+ .object({
2760
+ enabled: z
2761
+ .boolean()
2762
+ .optional()
2763
+ .default(true)
2764
+ .describe("Enable automatic tax calculation when tax is supported by the app. For example, with Stripe Invoicing when enabled, tax is calculated via Stripe Tax."),
2765
+ enforced: z
2766
+ .boolean()
2767
+ .optional()
2768
+ .default(false)
2769
+ .describe("Enforce tax calculation when tax is supported by the app. When enabled, the billing system will not allow to create an invoice without tax calculation. Enforcement is different per apps, for example, Stripe app requires customer to have a tax location when starting a paid subscription."),
2770
+ default_tax_config: taxConfig.optional(),
2771
+ })
2772
+ .describe("Tax settings for a billing workflow.");
2773
+ export const subscriptionAddonPagePaginatedResponse = z
2774
+ .object({
2775
+ data: z.array(subscriptionAddon),
2776
+ meta: paginatedMeta,
2777
+ })
2778
+ .describe("Page paginated response.");
2779
+ export const planAddonPagePaginatedResponse = z
2780
+ .object({
2781
+ data: z.array(planAddon),
2782
+ meta: paginatedMeta,
2783
+ })
2784
+ .describe("Page paginated response.");
2785
+ export const ingestedEventPaginatedResponse = z
2786
+ .object({
2787
+ data: z.array(ingestedEvent),
2788
+ meta: cursorMeta,
2789
+ })
2790
+ .describe("Cursor paginated response.");
2791
+ export const invalidParameters = z
2792
+ .array(invalidParameter)
2793
+ .min(1)
2794
+ .describe("The list of parameters that failed validation.");
2795
+ export const meterQueryRequest = z
2796
+ .object({
2797
+ from: dateTime.optional(),
2798
+ to: dateTime.optional(),
2799
+ granularity: meterQueryGranularity.optional(),
2800
+ time_zone: z
2801
+ .string()
2802
+ .optional()
2803
+ .default("UTC")
2804
+ .describe("The value is the name of the time zone as defined in the IANA Time Zone Database (http://www.iana.org/time-zones). The time zone is used to determine the start and end of the time buckets. If not specified, the UTC timezone will be used."),
2805
+ group_by_dimensions: z
2806
+ .array(z.string())
2807
+ .max(100)
2808
+ .optional()
2809
+ .describe("The dimensions to group the results by."),
2810
+ filters: meterQueryFilters.optional(),
2811
+ })
2812
+ .describe("A meter query request.");
2813
+ export const customerPagePaginatedResponse = z
2814
+ .object({
2815
+ data: z.array(customer),
2816
+ meta: paginatedMeta,
2817
+ })
2818
+ .describe("Page paginated response.");
2819
+ export const party = z
2820
+ .object({
2821
+ id: z.string().optional().describe("Unique identifier for the party."),
2822
+ key: externalResourceKey.optional(),
2823
+ name: z
2824
+ .string()
2825
+ .optional()
2826
+ .describe("Legal name or representation of the party."),
2827
+ tax_id: partyTaxIdentity.optional(),
2828
+ addresses: partyAddresses.optional(),
2829
+ })
2830
+ .describe("Party represents a person or business entity.");
2831
+ export const appStripeCreateCheckoutSessionRequestOptions = z
2832
+ .object({
2833
+ billing_address_collection: appStripeCreateCheckoutSessionBillingAddressCollection
2834
+ .optional()
2835
+ .default("auto"),
2836
+ cancel_url: z
2837
+ .string()
2838
+ .optional()
2839
+ .describe("URL to redirect customers who cancel the checkout session. Not allowed when ui_mode is \"embedded\"."),
2840
+ client_reference_id: z
2841
+ .string()
2842
+ .optional()
2843
+ .describe("Unique reference string for reconciling sessions with internal systems. Can be a customer ID, cart ID, or any other identifier."),
2844
+ customer_update: appStripeCreateCheckoutSessionCustomerUpdate.optional(),
2845
+ consent_collection: appStripeCreateCheckoutSessionConsentCollection
2846
+ .optional(),
2847
+ currency: currencyCode.optional(),
2848
+ custom_text: appStripeCheckoutSessionCustomTextParams.optional(),
2849
+ expires_at: z.coerce
2850
+ .bigint()
2851
+ .gte(-9223372036854775808n)
2852
+ .lte(9223372036854775807n)
2853
+ .optional()
2854
+ .describe("Unix timestamp when the checkout session expires. Can be 30 minutes to 24 hours from creation. Defaults to 24 hours."),
2855
+ locale: z
2856
+ .string()
2857
+ .optional()
2858
+ .describe("IETF language tag for the checkout UI locale. If blank or \"auto\", uses the browser's locale. Example: \"en\", \"fr\", \"de\"."),
2859
+ metadata: z
2860
+ .record(z.string(), z.string())
2861
+ .optional()
2862
+ .describe("Set of key-value pairs to attach to the checkout session. Useful for storing additional structured information."),
2863
+ return_url: z
2864
+ .string()
2865
+ .optional()
2866
+ .describe("Return URL for embedded checkout sessions after payment authentication. Required if ui_mode is \"embedded\" and redirect-based payment methods are enabled."),
2867
+ success_url: z
2868
+ .string()
2869
+ .optional()
2870
+ .describe("Success URL to redirect customers after completing payment or setup. Not allowed when ui_mode is \"embedded\". See: https://docs.stripe.com/payments/checkout/custom-success-page"),
2871
+ ui_mode: appStripeCheckoutSessionUiMode.optional().default("hosted"),
2872
+ payment_method_types: z
2873
+ .array(z.string())
2874
+ .optional()
2875
+ .describe("List of payment method types to enable (e.g., \"card\", \"us_bank_account\"). If not specified, Stripe enables all relevant payment methods."),
2876
+ redirect_on_completion: appStripeCreateCheckoutSessionRedirectOnCompletion
2877
+ .optional(),
2878
+ tax_id_collection: appStripeCreateCheckoutSessionTaxIdCollection.optional(),
2879
+ })
2880
+ .describe("Configuration options for creating a Stripe Checkout Session. Based on Stripe's [Checkout Session API parameters](https://docs.stripe.com/api/checkout/sessions/create).");
2881
+ export const workflowCollectionAlignment = z
2882
+ .discriminatedUnion("type", [
2883
+ workflowCollectionAlignmentSubscription,
2884
+ workflowCollectionAlignmentAnchored
2885
+ ])
2886
+ .describe("The alignment for collecting the pending line items into an invoice. Defaults to subscription, which means that we are to create a new invoice every time the a subscription period starts (for in advance items) or ends (for in arrears items).");
2887
+ export const app = z
2888
+ .discriminatedUnion("type", [appStripe, appSandbox, appExternalInvoicing])
2889
+ .describe("Installed application.");
2890
+ export const taxCodePagePaginatedResponse = z
2891
+ .object({
2892
+ data: z.array(taxCode),
2893
+ meta: paginatedMeta,
2894
+ })
2895
+ .describe("Page paginated response.");
2896
+ export const currencyPagePaginatedResponse = z
2897
+ .object({
2898
+ data: z.array(currency),
2899
+ meta: paginatedMeta,
2900
+ })
2901
+ .describe("Page paginated response.");
2902
+ export const governanceQueryResult = z
2903
+ .object({
2904
+ matched: z
2905
+ .array(z.string())
2906
+ .describe("The list of identifiers from the request that resolved to this customer. Each entry is either the customer `key` or one of its usage-attribution subject `key`s. Duplicate or aliased identifiers that resolve to the same customer collapse to a single result entry, with every requested identifier listed here."),
2907
+ customer: customer,
2908
+ features: z
2909
+ .record(z.string(), governanceFeatureAccess)
2910
+ .describe("Map of features with their access status. Map keys are the feature keys requested in `feature.keys`, or every feature `key` available in the organization when the feature filter was omitted."),
2911
+ updated_at: dateTime,
2912
+ })
2913
+ .describe("Access evaluation result for a single resolved customer.");
2914
+ export const price = z
2915
+ .discriminatedUnion("type", [priceFree, priceFlat, priceUnit, priceGraduated, priceVolume])
2916
+ .describe("Price.");
2917
+ export const priceUsageBased = z
2918
+ .discriminatedUnion("type", [priceUnit, priceGraduated, priceVolume])
2919
+ .describe("Usage-based price types that can appear on a usage-based rate card. When UnitConfig is present on the rate card, these price types operate on billing units (i.e. post-conversion quantities), not raw metered units.");
2920
+ export const feature = z
2921
+ .object({
2922
+ id: ulid,
2923
+ name: z
2924
+ .string()
2925
+ .min(1)
2926
+ .max(256)
2927
+ .describe("Display name of the resource. Between 1 and 256 characters."),
2928
+ description: z
2929
+ .string()
2930
+ .max(1024)
2931
+ .optional()
2932
+ .describe("Optional description of the resource. Maximum 1024 characters."),
2933
+ labels: labels.optional(),
2934
+ created_at: dateTime,
2935
+ updated_at: dateTime,
2936
+ deleted_at: dateTime.optional(),
2937
+ key: resourceKey,
2938
+ meter: featureMeterReference.optional(),
2939
+ unit_cost: featureUnitCost.optional(),
2940
+ })
2941
+ .describe("A capability or billable dimension offered by a provider.");
2942
+ export const createFeatureRequest = z
2943
+ .object({
2944
+ name: z
2945
+ .string()
2946
+ .min(1)
2947
+ .max(256)
2948
+ .describe("Display name of the resource. Between 1 and 256 characters."),
2949
+ description: z
2950
+ .string()
2951
+ .max(1024)
2952
+ .optional()
2953
+ .describe("Optional description of the resource. Maximum 1024 characters."),
2954
+ labels: labels.optional(),
2955
+ key: resourceKey,
2956
+ meter: featureMeterReference.optional(),
2957
+ unit_cost: featureUnitCost.optional(),
2958
+ })
2959
+ .describe("Feature create request.");
2960
+ export const updateFeatureRequest = z
2961
+ .object({
2962
+ unit_cost: z
2963
+ .union([featureUnitCost, z.null()])
2964
+ .optional()
2965
+ .describe("Optional per-unit cost configuration. Use \"manual\" for a fixed per-unit cost, or \"llm\" to look up cost from the LLM cost database based on meter group-by properties. Set to `null` to clear the existing unit cost; omit to leave it unchanged."),
2966
+ })
2967
+ .describe("Request body for updating a feature. Currently only the unit_cost field can be updated.");
2968
+ export const creditGrantPagePaginatedResponse = z
2969
+ .object({
2970
+ data: z.array(creditGrant),
2971
+ meta: paginatedMeta,
2972
+ })
2973
+ .describe("Page paginated response.");
2974
+ export const badRequest = z
2975
+ .intersection(baseError, z.object({
2976
+ invalid_parameters: invalidParameters,
2977
+ }))
2978
+ .describe("Bad Request.");
2979
+ export const customerStripeCreateCheckoutSessionRequest = z
2980
+ .object({
2981
+ stripe_options: appStripeCreateCheckoutSessionRequestOptions,
2982
+ })
2983
+ .describe("Request to create a Stripe Checkout Session for the customer. Checkout Sessions are used to collect payment method information from customers in a secure, Stripe-hosted interface. This integration uses setup mode to collect payment methods that can be charged later for subscription billing.");
2984
+ export const workflowCollectionSettings = z
2985
+ .object({
2986
+ alignment: workflowCollectionAlignment
2987
+ .optional()
2988
+ .default({
2989
+ type: "subscription",
2990
+ }),
2991
+ interval: z
2992
+ .string()
2993
+ .optional()
2994
+ .default("PT1H")
2995
+ .describe("This grace period can be used to delay the collection of the pending line items specified in alignment. This is useful, in case of multiple subscriptions having slightly different billing periods."),
2996
+ })
2997
+ .describe("Workflow collection specifies how to collect the pending line items for an invoice.");
2998
+ export const appPagePaginatedResponse = z
2999
+ .object({
3000
+ data: z.array(app),
3001
+ meta: paginatedMeta,
3002
+ })
3003
+ .describe("Page paginated response.");
3004
+ export const profileApps = z
3005
+ .object({
3006
+ tax: app,
3007
+ invoicing: app,
3008
+ payment: app,
3009
+ })
3010
+ .describe("Applications used by a billing profile.");
3011
+ export const governanceQueryResponse = z
3012
+ .object({
3013
+ data: z
3014
+ .array(governanceQueryResult)
3015
+ .describe("Access evaluation results, one entry per resolved customer."),
3016
+ errors: z
3017
+ .array(governanceQueryError)
3018
+ .describe("Partial errors encountered while processing the request."),
3019
+ meta: cursorMeta,
3020
+ })
3021
+ .describe("Response of the governance query.");
3022
+ export const flatFeeCharge = z
3023
+ .object({
3024
+ id: ulid,
3025
+ name: z
3026
+ .string()
3027
+ .min(1)
3028
+ .max(256)
3029
+ .describe("Display name of the resource. Between 1 and 256 characters."),
3030
+ description: z
3031
+ .string()
3032
+ .max(1024)
3033
+ .optional()
3034
+ .describe("Optional description of the resource. Maximum 1024 characters."),
3035
+ labels: labels.optional(),
3036
+ created_at: dateTime,
3037
+ updated_at: dateTime,
3038
+ deleted_at: dateTime.optional(),
3039
+ type: z.literal("flat_fee").describe("The type of the charge."),
3040
+ customer: billingCustomerReference,
3041
+ managed_by: resourceManagedBy,
3042
+ subscription: subscriptionReference.optional(),
3043
+ currency: currencyCode,
3044
+ status: chargeStatus,
3045
+ invoice_at: dateTime,
3046
+ service_period: closedPeriod,
3047
+ full_service_period: closedPeriod,
3048
+ billing_period: closedPeriod,
3049
+ advance_after: dateTime.optional(),
3050
+ price: price,
3051
+ unique_reference_id: z
3052
+ .string()
3053
+ .optional()
3054
+ .describe("Unique reference ID of the charge."),
3055
+ settlement_mode: settlementMode,
3056
+ tax_config: taxConfig.optional(),
3057
+ payment_term: pricePaymentTerm,
3058
+ discounts: flatFeeDiscounts.optional(),
3059
+ feature_key: z
3060
+ .string()
3061
+ .optional()
3062
+ .describe("The feature associated with the charge, when applicable."),
3063
+ proration_configuration: rateCardProrationConfiguration,
3064
+ amount_after_proration: currencyAmount,
3065
+ })
3066
+ .describe("A flat fee charge for a customer.");
3067
+ export const usageBasedCharge = z
3068
+ .object({
3069
+ id: ulid,
3070
+ name: z
3071
+ .string()
3072
+ .min(1)
3073
+ .max(256)
3074
+ .describe("Display name of the resource. Between 1 and 256 characters."),
3075
+ description: z
3076
+ .string()
3077
+ .max(1024)
3078
+ .optional()
3079
+ .describe("Optional description of the resource. Maximum 1024 characters."),
3080
+ labels: labels.optional(),
3081
+ created_at: dateTime,
3082
+ updated_at: dateTime,
3083
+ deleted_at: dateTime.optional(),
3084
+ type: z.literal("usage_based").describe("The type of the charge."),
3085
+ customer: billingCustomerReference,
3086
+ managed_by: resourceManagedBy,
3087
+ subscription: subscriptionReference.optional(),
3088
+ currency: currencyCode,
3089
+ status: chargeStatus,
3090
+ invoice_at: dateTime,
3091
+ service_period: closedPeriod,
3092
+ full_service_period: closedPeriod,
3093
+ billing_period: closedPeriod,
3094
+ advance_after: dateTime.optional(),
3095
+ price: price,
3096
+ unique_reference_id: z
3097
+ .string()
3098
+ .optional()
3099
+ .describe("Unique reference ID of the charge."),
3100
+ settlement_mode: settlementMode,
3101
+ tax_config: taxConfig.optional(),
3102
+ discounts: rateCardDiscounts.optional(),
3103
+ feature_key: z.string().describe("The feature associated with the charge."),
3104
+ totals: chargeTotals,
3105
+ })
3106
+ .describe("A usage-based charge for a customer.");
3107
+ export const rateCard = z
3108
+ .object({
3109
+ name: z
3110
+ .string()
3111
+ .min(1)
3112
+ .max(256)
3113
+ .describe("Display name of the resource. Between 1 and 256 characters."),
3114
+ description: z
3115
+ .string()
3116
+ .max(1024)
3117
+ .optional()
3118
+ .describe("Optional description of the resource. Maximum 1024 characters."),
3119
+ labels: labels.optional(),
3120
+ key: resourceKey,
3121
+ feature: featureReference.optional(),
3122
+ billing_cadence: iso8601Duration.optional(),
3123
+ price: price,
3124
+ payment_term: pricePaymentTerm.optional().default("in_arrears"),
3125
+ commitments: spendCommitments.optional(),
3126
+ discounts: rateCardDiscounts.optional(),
3127
+ tax_config: rateCardTaxConfig.optional(),
3128
+ })
3129
+ .describe("A rate card defines the pricing and entitlement of a feature or service.");
3130
+ export const featurePagePaginatedResponse = z
3131
+ .object({
3132
+ data: z.array(feature),
3133
+ meta: paginatedMeta,
3134
+ })
3135
+ .describe("Page paginated response.");
3136
+ export const workflow = z
3137
+ .object({
3138
+ collection: workflowCollectionSettings.optional(),
3139
+ invoicing: workflowInvoicingSettings.optional(),
3140
+ payment: workflowPaymentSettings.optional(),
3141
+ tax: workflowTaxSettings.optional(),
3142
+ })
3143
+ .describe("Billing workflow settings.");
3144
+ export const charge = z
3145
+ .discriminatedUnion("type", [flatFeeCharge, usageBasedCharge])
3146
+ .describe("Customer charge.");
3147
+ export const planPhase = z
3148
+ .object({
3149
+ name: z
3150
+ .string()
3151
+ .min(1)
3152
+ .max(256)
3153
+ .describe("Display name of the resource. Between 1 and 256 characters."),
3154
+ description: z
3155
+ .string()
3156
+ .max(1024)
3157
+ .optional()
3158
+ .describe("Optional description of the resource. Maximum 1024 characters."),
3159
+ labels: labels.optional(),
3160
+ key: resourceKey,
3161
+ duration: iso8601Duration.optional(),
3162
+ rate_cards: z.array(rateCard).describe("The rate cards of the plan."),
3163
+ })
3164
+ .describe("The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses.");
3165
+ export const addon = z
3166
+ .object({
3167
+ id: ulid,
3168
+ name: z
3169
+ .string()
3170
+ .min(1)
3171
+ .max(256)
3172
+ .describe("Display name of the resource. Between 1 and 256 characters."),
3173
+ description: z
3174
+ .string()
3175
+ .max(1024)
3176
+ .optional()
3177
+ .describe("Optional description of the resource. Maximum 1024 characters."),
3178
+ labels: labels.optional(),
3179
+ created_at: dateTime,
3180
+ updated_at: dateTime,
3181
+ deleted_at: dateTime.optional(),
3182
+ key: resourceKey,
3183
+ version: z
3184
+ .number()
3185
+ .int()
3186
+ .gte(1)
3187
+ .default(1)
3188
+ .describe("Version of the add-on. Incremented when the add-on is updated."),
3189
+ instance_type: addonInstanceType,
3190
+ currency: billingCurrencyCode,
3191
+ effective_from: dateTime.optional(),
3192
+ effective_to: dateTime.optional(),
3193
+ status: addonStatus,
3194
+ rate_cards: z.array(rateCard).describe("The rate cards of the add-on."),
3195
+ validation_errors: z
3196
+ .array(productCatalogValidationError)
3197
+ .optional()
3198
+ .describe("List of validation errors."),
3199
+ })
3200
+ .describe("Add-on allows extending subscriptions with compatible plans with additional ratecards.");
3201
+ export const createAddonRequest = z
3202
+ .object({
3203
+ name: z
3204
+ .string()
3205
+ .min(1)
3206
+ .max(256)
3207
+ .describe("Display name of the resource. Between 1 and 256 characters."),
3208
+ description: z
3209
+ .string()
3210
+ .max(1024)
3211
+ .optional()
3212
+ .describe("Optional description of the resource. Maximum 1024 characters."),
3213
+ labels: labels.optional(),
3214
+ key: resourceKey,
3215
+ instance_type: addonInstanceType,
3216
+ currency: billingCurrencyCode,
3217
+ rate_cards: z.array(rateCard).describe("The rate cards of the add-on."),
3218
+ })
3219
+ .describe("Addon create request.");
3220
+ export const upsertAddonRequest = z
3221
+ .object({
3222
+ name: z
3223
+ .string()
3224
+ .min(1)
3225
+ .max(256)
3226
+ .describe("Display name of the resource. Between 1 and 256 characters."),
3227
+ description: z
3228
+ .string()
3229
+ .max(1024)
3230
+ .optional()
3231
+ .describe("Optional description of the resource. Maximum 1024 characters."),
3232
+ labels: labels.optional(),
3233
+ instance_type: addonInstanceType,
3234
+ rate_cards: z.array(rateCard).describe("The rate cards of the add-on."),
3235
+ })
3236
+ .describe("Addon upsert request.");
3237
+ export const profile = z
3238
+ .object({
3239
+ id: ulid,
3240
+ name: z
3241
+ .string()
3242
+ .min(1)
3243
+ .max(256)
3244
+ .describe("Display name of the resource. Between 1 and 256 characters."),
3245
+ description: z
3246
+ .string()
3247
+ .max(1024)
3248
+ .optional()
3249
+ .describe("Optional description of the resource. Maximum 1024 characters."),
3250
+ labels: labels.optional(),
3251
+ created_at: dateTime,
3252
+ updated_at: dateTime,
3253
+ deleted_at: dateTime.optional(),
3254
+ supplier: party,
3255
+ workflow: workflow,
3256
+ apps: profileAppReferences,
3257
+ default: z.boolean().describe("Whether this is the default profile."),
3258
+ })
3259
+ .describe("Billing profiles contain the settings for billing and controls invoice generation.");
3260
+ export const createBillingProfileRequest = z
3261
+ .object({
3262
+ name: z
3263
+ .string()
3264
+ .min(1)
3265
+ .max(256)
3266
+ .describe("Display name of the resource. Between 1 and 256 characters."),
3267
+ description: z
3268
+ .string()
3269
+ .max(1024)
3270
+ .optional()
3271
+ .describe("Optional description of the resource. Maximum 1024 characters."),
3272
+ labels: labels.optional(),
3273
+ supplier: party,
3274
+ workflow: workflow,
3275
+ apps: profileAppReferences,
3276
+ default: z.boolean().describe("Whether this is the default profile."),
3277
+ })
3278
+ .describe("BillingProfile create request.");
3279
+ export const upsertBillingProfileRequest = z
3280
+ .object({
3281
+ name: z
3282
+ .string()
3283
+ .min(1)
3284
+ .max(256)
3285
+ .describe("Display name of the resource. Between 1 and 256 characters."),
3286
+ description: z
3287
+ .string()
3288
+ .max(1024)
3289
+ .optional()
3290
+ .describe("Optional description of the resource. Maximum 1024 characters."),
3291
+ labels: labels.optional(),
3292
+ supplier: party,
3293
+ workflow: workflow,
3294
+ default: z.boolean().describe("Whether this is the default profile."),
3295
+ })
3296
+ .describe("BillingProfile upsert request.");
3297
+ export const chargePagePaginatedResponse = z
3298
+ .object({
3299
+ data: z.array(charge),
3300
+ meta: paginatedMeta,
3301
+ })
3302
+ .describe("Page paginated response.");
3303
+ export const plan = z
3304
+ .object({
3305
+ id: ulid,
3306
+ name: z
3307
+ .string()
3308
+ .min(1)
3309
+ .max(256)
3310
+ .describe("Display name of the resource. Between 1 and 256 characters."),
3311
+ description: z
3312
+ .string()
3313
+ .max(1024)
3314
+ .optional()
3315
+ .describe("Optional description of the resource. Maximum 1024 characters."),
3316
+ labels: labels.optional(),
3317
+ created_at: dateTime,
3318
+ updated_at: dateTime,
3319
+ deleted_at: dateTime.optional(),
3320
+ key: resourceKey,
3321
+ version: z
3322
+ .number()
3323
+ .int()
3324
+ .gte(1)
3325
+ .default(1)
3326
+ .describe("Plans are versioned to allow you to make changes without affecting running subscriptions."),
3327
+ currency: currencyCode,
3328
+ billing_cadence: iso8601Duration,
3329
+ pro_rating_enabled: z
3330
+ .boolean()
3331
+ .optional()
3332
+ .default(true)
3333
+ .describe("Whether pro-rating is enabled for this plan."),
3334
+ effective_from: dateTime.optional(),
3335
+ effective_to: dateTime.optional(),
3336
+ status: planStatus,
3337
+ phases: z
3338
+ .array(planPhase)
3339
+ .min(1)
3340
+ .describe("The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required."),
3341
+ validation_errors: z
3342
+ .array(productCatalogValidationError)
3343
+ .optional()
3344
+ .describe("List of validation errors in `draft` state that prevent the plan from being published."),
3345
+ })
3346
+ .describe("Plans provide a template for subscriptions.");
3347
+ export const createPlanRequest = z
3348
+ .object({
3349
+ name: z
3350
+ .string()
3351
+ .min(1)
3352
+ .max(256)
3353
+ .describe("Display name of the resource. Between 1 and 256 characters."),
3354
+ description: z
3355
+ .string()
3356
+ .max(1024)
3357
+ .optional()
3358
+ .describe("Optional description of the resource. Maximum 1024 characters."),
3359
+ labels: labels.optional(),
3360
+ key: resourceKey,
3361
+ currency: currencyCode,
3362
+ billing_cadence: iso8601Duration,
3363
+ pro_rating_enabled: z
3364
+ .boolean()
3365
+ .optional()
3366
+ .default(true)
3367
+ .describe("Whether pro-rating is enabled for this plan."),
3368
+ phases: z
3369
+ .array(planPhase)
3370
+ .min(1)
3371
+ .describe("The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required."),
3372
+ })
3373
+ .describe("Plan create request.");
3374
+ export const upsertPlanRequest = z
3375
+ .object({
3376
+ name: z
3377
+ .string()
3378
+ .min(1)
3379
+ .max(256)
3380
+ .describe("Display name of the resource. Between 1 and 256 characters."),
3381
+ description: z
3382
+ .string()
3383
+ .max(1024)
3384
+ .optional()
3385
+ .describe("Optional description of the resource. Maximum 1024 characters."),
3386
+ labels: labels.optional(),
3387
+ pro_rating_enabled: z
3388
+ .boolean()
3389
+ .optional()
3390
+ .default(true)
3391
+ .describe("Whether pro-rating is enabled for this plan."),
3392
+ phases: z
3393
+ .array(planPhase)
3394
+ .min(1)
3395
+ .describe("The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required."),
3396
+ })
3397
+ .describe("Plan upsert request.");
3398
+ export const addonPagePaginatedResponse = z
3399
+ .object({
3400
+ data: z.array(addon),
3401
+ meta: paginatedMeta,
3402
+ })
3403
+ .describe("Page paginated response.");
3404
+ export const profilePagePaginatedResponse = z
3405
+ .object({
3406
+ data: z.array(profile),
3407
+ meta: paginatedMeta,
3408
+ })
3409
+ .describe("Page paginated response.");
3410
+ export const planPagePaginatedResponse = z
3411
+ .object({
3412
+ data: z.array(plan),
3413
+ meta: paginatedMeta,
3414
+ })
3415
+ .describe("Page paginated response.");
3416
+ ;
3417
+ export const listMeteringEventsQueryParams = z.object({
3418
+ page: cursorPaginationQueryPage.optional(),
3419
+ filter: listEventsParamsFilter.optional(),
3420
+ sort: sortQuery.optional(),
3421
+ });
3422
+ export const listMeteringEventsResponse = z.object({
3423
+ data: z.array(ingestedEvent),
3424
+ meta: cursorMeta,
3425
+ });
3426
+ export const ingestMeteringEventsBody = event;
3427
+ export const createMeterBody = createMeterRequest;
3428
+ export const createMeterResponse = meter;
3429
+ export const getMeterPathParams = z.object({
3430
+ meterId: ulid,
3431
+ });
3432
+ export const getMeterResponse = meter;
3433
+ export const listMetersQueryParams = z.object({
3434
+ page: z
3435
+ .object({
3436
+ size: z.coerce
3437
+ .number()
3438
+ .int()
3439
+ .optional()
3440
+ .describe("The number of items to include per page."),
3441
+ number: z.coerce.number().int().optional().describe("The page number."),
3442
+ })
3443
+ .optional()
3444
+ .describe("Determines which page of the collection to retrieve."),
3445
+ sort: sortQuery.optional(),
3446
+ filter: listMetersParamsFilter.optional(),
3447
+ });
3448
+ export const listMetersResponse = z.object({
3449
+ data: z.array(meter),
3450
+ meta: paginatedMeta,
3451
+ });
3452
+ export const updateMeterPathParams = z.object({
3453
+ meterId: ulid,
3454
+ });
3455
+ export const updateMeterBody = updateMeterRequest;
3456
+ export const updateMeterResponse = meter;
3457
+ export const deleteMeterPathParams = z.object({
3458
+ meterId: ulid,
3459
+ });
3460
+ export const queryMeterPathParams = z.object({
3461
+ meterId: ulid,
3462
+ });
3463
+ export const queryMeterBody = meterQueryRequest;
3464
+ export const queryMeterResponse = meterQueryResult;
3465
+ export const createCustomerBody = createCustomerRequest;
3466
+ export const createCustomerResponse = customer;
3467
+ export const getCustomerPathParams = z.object({
3468
+ customerId: ulid,
3469
+ });
3470
+ export const getCustomerResponse = customer;
3471
+ export const listCustomersQueryParams = z.object({
3472
+ page: z
3473
+ .object({
3474
+ size: z.coerce
3475
+ .number()
3476
+ .int()
3477
+ .optional()
3478
+ .describe("The number of items to include per page."),
3479
+ number: z.coerce.number().int().optional().describe("The page number."),
3480
+ })
3481
+ .optional()
3482
+ .describe("Determines which page of the collection to retrieve."),
3483
+ sort: sortQuery.optional(),
3484
+ filter: listCustomersParamsFilter.optional(),
3485
+ });
3486
+ export const listCustomersResponse = z.object({
3487
+ data: z.array(customer),
3488
+ meta: paginatedMeta,
3489
+ });
3490
+ export const upsertCustomerPathParams = z.object({
3491
+ customerId: ulid,
3492
+ });
3493
+ export const upsertCustomerBody = upsertCustomerRequest;
3494
+ export const upsertCustomerResponse = customer;
3495
+ export const deleteCustomerPathParams = z.object({
3496
+ customerId: ulid,
3497
+ });
3498
+ export const getCustomerBillingPathParams = z.object({
3499
+ customerId: ulid,
3500
+ });
3501
+ export const getCustomerBillingResponse = customerData;
3502
+ export const updateCustomerBillingPathParams = z.object({
3503
+ customerId: ulid,
3504
+ });
3505
+ export const updateCustomerBillingBody = upsertCustomerBillingDataRequest;
3506
+ export const updateCustomerBillingResponse = customerData;
3507
+ export const updateCustomerBillingAppDataPathParams = z.object({
3508
+ customerId: ulid,
3509
+ });
3510
+ export const updateCustomerBillingAppDataBody = upsertAppCustomerDataRequest;
3511
+ export const updateCustomerBillingAppDataResponse = appCustomerData;
3512
+ export const createCustomerStripeCheckoutSessionPathParams = z.object({
3513
+ customerId: ulid,
3514
+ });
3515
+ export const createCustomerStripeCheckoutSessionBody = customerStripeCreateCheckoutSessionRequest;
3516
+ export const createCustomerStripeCheckoutSessionResponse = appStripeCreateCheckoutSessionResult;
3517
+ export const createCustomerStripePortalSessionPathParams = z.object({
3518
+ customerId: ulid,
3519
+ });
3520
+ export const createCustomerStripePortalSessionBody = customerStripeCreateCustomerPortalSessionRequest;
3521
+ export const createCustomerStripePortalSessionResponse = appStripeCreateCustomerPortalSessionResult;
3522
+ export const listCustomerEntitlementAccessPathParams = z.object({
3523
+ customerId: ulid,
3524
+ });
3525
+ export const listCustomerEntitlementAccessResponse = listCustomerEntitlementAccessResponseData;
3526
+ export const createCreditGrantPathParams = z.object({
3527
+ customerId: ulid,
3528
+ });
3529
+ export const createCreditGrantBody = createCreditGrantRequest;
3530
+ export const createCreditGrantResponse = creditGrant;
3531
+ export const getCreditGrantPathParams = z.object({
3532
+ customerId: ulid,
3533
+ creditGrantId: ulid,
3534
+ });
3535
+ export const getCreditGrantResponse = creditGrant;
3536
+ export const listCreditGrantsPathParams = z.object({
3537
+ customerId: ulid,
3538
+ });
3539
+ export const listCreditGrantsQueryParams = z.object({
3540
+ page: z
3541
+ .object({
3542
+ size: z.coerce
3543
+ .number()
3544
+ .int()
3545
+ .optional()
3546
+ .describe("The number of items to include per page."),
3547
+ number: z.coerce.number().int().optional().describe("The page number."),
3548
+ })
3549
+ .optional()
3550
+ .describe("Determines which page of the collection to retrieve."),
3551
+ filter: listCreditGrantsParamsFilter.optional(),
3552
+ });
3553
+ export const listCreditGrantsResponse = z.object({
3554
+ data: z.array(creditGrant),
3555
+ meta: paginatedMeta,
3556
+ });
3557
+ export const getCustomerCreditBalancePathParams = z.object({
3558
+ customerId: ulid,
3559
+ });
3560
+ export const getCustomerCreditBalanceQueryParams = z.object({
3561
+ timestamp: dateTime.optional(),
3562
+ filter: getCreditBalanceParamsFilter.optional(),
3563
+ });
3564
+ export const getCustomerCreditBalanceResponse = creditBalances;
3565
+ export const createCreditAdjustmentPathParams = z.object({
3566
+ customerId: ulid,
3567
+ });
3568
+ export const createCreditAdjustmentBody = createCreditAdjustmentRequest;
3569
+ export const createCreditAdjustmentResponse = creditAdjustment;
3570
+ export const updateCreditGrantExternalSettlementPathParams = z.object({
3571
+ customerId: ulid,
3572
+ creditGrantId: ulid,
3573
+ });
3574
+ export const updateCreditGrantExternalSettlementBody = updateCreditGrantExternalSettlementRequest;
3575
+ export const updateCreditGrantExternalSettlementResponse = creditGrant;
3576
+ export const listCreditTransactionsPathParams = z.object({
3577
+ customerId: ulid,
3578
+ });
3579
+ export const listCreditTransactionsQueryParams = z.object({
3580
+ page: cursorPaginationQueryPage.optional(),
3581
+ filter: listCreditTransactionsParamsFilter.optional(),
3582
+ });
3583
+ export const listCreditTransactionsResponse = z.object({
3584
+ data: z.array(creditTransaction),
3585
+ meta: cursorMeta,
3586
+ });
3587
+ export const listCustomerChargesPathParams = z.object({
3588
+ customerId: ulid,
3589
+ });
3590
+ export const listCustomerChargesQueryParams = z.object({
3591
+ page: z
3592
+ .object({
3593
+ size: z.coerce
3594
+ .number()
3595
+ .int()
3596
+ .optional()
3597
+ .describe("The number of items to include per page."),
3598
+ number: z.coerce.number().int().optional().describe("The page number."),
3599
+ })
3600
+ .optional()
3601
+ .describe("Determines which page of the collection to retrieve."),
3602
+ sort: sortQuery.optional(),
3603
+ filter: listChargesParamsFilter.optional(),
3604
+ expand: z
3605
+ .array(chargesExpand)
3606
+ .optional()
3607
+ .describe("Expand full objects for referenced entities. Supported values are: - `real_time_usage`: Expand the charge's real-time usage."),
3608
+ });
3609
+ export const listCustomerChargesResponse = z.object({
3610
+ data: z.array(charge),
3611
+ meta: paginatedMeta,
3612
+ });
3613
+ export const createSubscriptionBody = subscriptionCreate;
3614
+ export const createSubscriptionResponse = subscription;
3615
+ export const listSubscriptionsQueryParams = z.object({
3616
+ page: z
3617
+ .object({
3618
+ size: z.coerce
3619
+ .number()
3620
+ .int()
3621
+ .optional()
3622
+ .describe("The number of items to include per page."),
3623
+ number: z.coerce.number().int().optional().describe("The page number."),
3624
+ })
3625
+ .optional()
3626
+ .describe("Determines which page of the collection to retrieve."),
3627
+ sort: sortQuery.optional(),
3628
+ filter: listSubscriptionsParamsFilter.optional(),
3629
+ });
3630
+ export const listSubscriptionsResponse = z.object({
3631
+ data: z.array(subscription),
3632
+ meta: paginatedMeta,
3633
+ });
3634
+ export const getSubscriptionPathParams = z.object({
3635
+ subscriptionId: ulid,
3636
+ });
3637
+ export const getSubscriptionResponse = subscription;
3638
+ export const cancelSubscriptionPathParams = z.object({
3639
+ subscriptionId: ulid,
3640
+ });
3641
+ export const cancelSubscriptionBody = subscriptionCancel;
3642
+ export const cancelSubscriptionResponse = subscription;
3643
+ export const unscheduleCancelationPathParams = z.object({
3644
+ subscriptionId: ulid,
3645
+ });
3646
+ export const unscheduleCancelationResponse = subscription;
3647
+ export const changeSubscriptionPathParams = z.object({
3648
+ subscriptionId: ulid,
3649
+ });
3650
+ export const changeSubscriptionBody = subscriptionChange;
3651
+ export const changeSubscriptionResponse = subscriptionChangeResponse;
3652
+ export const listSubscriptionAddonsPathParams = z.object({
3653
+ subscriptionId: ulid,
3654
+ });
3655
+ export const listSubscriptionAddonsQueryParams = z.object({
3656
+ page: z
3657
+ .object({
3658
+ size: z.coerce
3659
+ .number()
3660
+ .int()
3661
+ .optional()
3662
+ .describe("The number of items to include per page."),
3663
+ number: z.coerce.number().int().optional().describe("The page number."),
3664
+ })
3665
+ .optional()
3666
+ .describe("Determines which page of the collection to retrieve."),
3667
+ sort: sortQuery.optional(),
3668
+ });
3669
+ export const listSubscriptionAddonsResponse = z.object({
3670
+ data: z.array(subscriptionAddon),
3671
+ meta: paginatedMeta,
3672
+ });
3673
+ export const getSubscriptionAddonPathParams = z.object({
3674
+ subscriptionId: ulid,
3675
+ subscriptionAddonId: ulid,
3676
+ });
3677
+ export const getSubscriptionAddonResponse = subscriptionAddon;
3678
+ export const listAppsQueryParams = z.object({
3679
+ page: z
3680
+ .object({
3681
+ size: z.coerce
3682
+ .number()
3683
+ .int()
3684
+ .optional()
3685
+ .describe("The number of items to include per page."),
3686
+ number: z.coerce.number().int().optional().describe("The page number."),
3687
+ })
3688
+ .optional()
3689
+ .describe("Determines which page of the collection to retrieve."),
3690
+ });
3691
+ export const listAppsResponse = z.object({
3692
+ data: z.array(app),
3693
+ meta: paginatedMeta,
3694
+ });
3695
+ export const getAppPathParams = z.object({
3696
+ appId: ulid,
3697
+ });
3698
+ export const getAppResponse = app;
3699
+ export const listBillingProfilesQueryParams = z.object({
3700
+ page: z
3701
+ .object({
3702
+ size: z.coerce
3703
+ .number()
3704
+ .int()
3705
+ .optional()
3706
+ .describe("The number of items to include per page."),
3707
+ number: z.coerce.number().int().optional().describe("The page number."),
3708
+ })
3709
+ .optional()
3710
+ .describe("Determines which page of the collection to retrieve."),
3711
+ });
3712
+ export const listBillingProfilesResponse = z.object({
3713
+ data: z.array(profile),
3714
+ meta: paginatedMeta,
3715
+ });
3716
+ export const createBillingProfileBody = createBillingProfileRequest;
3717
+ export const createBillingProfileResponse = profile;
3718
+ export const getBillingProfilePathParams = z.object({
3719
+ id: ulid,
3720
+ });
3721
+ export const getBillingProfileResponse = profile;
3722
+ export const updateBillingProfilePathParams = z.object({
3723
+ id: ulid,
3724
+ });
3725
+ export const updateBillingProfileBody = upsertBillingProfileRequest;
3726
+ export const updateBillingProfileResponse = profile;
3727
+ export const deleteBillingProfilePathParams = z.object({
3728
+ id: ulid,
3729
+ });
3730
+ export const createTaxCodeBody = createTaxCodeRequest;
3731
+ export const createTaxCodeResponse = taxCode;
3732
+ export const getTaxCodePathParams = z.object({
3733
+ taxCodeId: ulid,
3734
+ });
3735
+ export const getTaxCodeResponse = taxCode;
3736
+ export const listTaxCodesQueryParams = z.object({
3737
+ page: z
3738
+ .object({
3739
+ size: z.coerce
3740
+ .number()
3741
+ .int()
3742
+ .optional()
3743
+ .describe("The number of items to include per page."),
3744
+ number: z.coerce.number().int().optional().describe("The page number."),
3745
+ })
3746
+ .optional()
3747
+ .describe("Determines which page of the collection to retrieve."),
3748
+ include_deleted: z.coerce
3749
+ .boolean()
3750
+ .optional()
3751
+ .describe("Include deleted tax codes in the response."),
3752
+ });
3753
+ export const listTaxCodesResponse = z.object({
3754
+ data: z.array(taxCode),
3755
+ meta: paginatedMeta,
3756
+ });
3757
+ export const upsertTaxCodePathParams = z.object({
3758
+ taxCodeId: ulid,
3759
+ });
3760
+ export const upsertTaxCodeBody = upsertTaxCodeRequest;
3761
+ export const upsertTaxCodeResponse = taxCode;
3762
+ export const deleteTaxCodePathParams = z.object({
3763
+ taxCodeId: ulid,
3764
+ });
3765
+ export const listCurrenciesQueryParams = z.object({
3766
+ page: z
3767
+ .object({
3768
+ size: z.coerce
3769
+ .number()
3770
+ .int()
3771
+ .optional()
3772
+ .describe("The number of items to include per page."),
3773
+ number: z.coerce.number().int().optional().describe("The page number."),
3774
+ })
3775
+ .optional()
3776
+ .describe("Determines which page of the collection to retrieve."),
3777
+ sort: sortQuery.optional(),
3778
+ filter: listCurrenciesParamsFilter.optional(),
3779
+ });
3780
+ export const listCurrenciesResponse = z.object({
3781
+ data: z.array(currency),
3782
+ meta: paginatedMeta,
3783
+ });
3784
+ export const createCustomCurrencyBody = createCurrencyCustomRequest;
3785
+ export const createCustomCurrencyResponse = currencyCustom;
3786
+ export const listCostBasesPathParams = z.object({
3787
+ currencyId: ulid,
3788
+ });
3789
+ export const listCostBasesQueryParams = z.object({
3790
+ filter: listCostBasesParamsFilter.optional(),
3791
+ page: z
3792
+ .object({
3793
+ size: z.coerce
3794
+ .number()
3795
+ .int()
3796
+ .optional()
3797
+ .describe("The number of items to include per page."),
3798
+ number: z.coerce.number().int().optional().describe("The page number."),
3799
+ })
3800
+ .optional()
3801
+ .describe("Determines which page of the collection to retrieve."),
3802
+ });
3803
+ export const listCostBasesResponse = z.object({
3804
+ data: z.array(costBasis),
3805
+ meta: paginatedMeta,
3806
+ });
3807
+ export const createCostBasisPathParams = z.object({
3808
+ currencyId: ulid,
3809
+ });
3810
+ export const createCostBasisBody = createCostBasisRequest;
3811
+ export const createCostBasisResponse = costBasis;
3812
+ export const listFeaturesQueryParams = z.object({
3813
+ page: z
3814
+ .object({
3815
+ size: z.coerce
3816
+ .number()
3817
+ .int()
3818
+ .optional()
3819
+ .describe("The number of items to include per page."),
3820
+ number: z.coerce.number().int().optional().describe("The page number."),
3821
+ })
3822
+ .optional()
3823
+ .describe("Determines which page of the collection to retrieve."),
3824
+ sort: sortQuery.optional(),
3825
+ filter: listFeatureParamsFilter.optional(),
3826
+ });
3827
+ export const listFeaturesResponse = z.object({
3828
+ data: z.array(feature),
3829
+ meta: paginatedMeta,
3830
+ });
3831
+ export const createFeatureBody = createFeatureRequest;
3832
+ export const createFeatureResponse = feature;
3833
+ export const getFeaturePathParams = z.object({
3834
+ featureId: ulid,
3835
+ });
3836
+ export const getFeatureResponse = feature;
3837
+ export const updateFeaturePathParams = z.object({
3838
+ featureId: ulid,
3839
+ });
3840
+ export const updateFeatureBody = updateFeatureRequest;
3841
+ export const updateFeatureResponse = feature;
3842
+ export const deleteFeaturePathParams = z.object({
3843
+ featureId: ulid,
3844
+ });
3845
+ export const queryFeatureCostPathParams = z.object({
3846
+ featureId: ulid,
3847
+ });
3848
+ export const queryFeatureCostBody = meterQueryRequest;
3849
+ export const queryFeatureCostResponse = featureCostQueryResult;
3850
+ export const listLlmCostPricesQueryParams = z.object({
3851
+ filter: listLlmCostPricesParamsFilter.optional(),
3852
+ sort: sortQuery.optional(),
3853
+ page: z
3854
+ .object({
3855
+ size: z.coerce
3856
+ .number()
3857
+ .int()
3858
+ .optional()
3859
+ .describe("The number of items to include per page."),
3860
+ number: z.coerce.number().int().optional().describe("The page number."),
3861
+ })
3862
+ .optional()
3863
+ .describe("Determines which page of the collection to retrieve."),
3864
+ });
3865
+ export const listLlmCostPricesResponse = z.object({
3866
+ data: z.array(llmCostPrice),
3867
+ meta: paginatedMeta,
3868
+ });
3869
+ export const getLlmCostPricePathParams = z.object({
3870
+ priceId: ulid,
3871
+ });
3872
+ export const getLlmCostPriceResponse = llmCostPrice;
3873
+ export const listLlmCostOverridesQueryParams = z.object({
3874
+ filter: listLlmCostPricesParamsFilter.optional(),
3875
+ page: z
3876
+ .object({
3877
+ size: z.coerce
3878
+ .number()
3879
+ .int()
3880
+ .optional()
3881
+ .describe("The number of items to include per page."),
3882
+ number: z.coerce.number().int().optional().describe("The page number."),
3883
+ })
3884
+ .optional()
3885
+ .describe("Determines which page of the collection to retrieve."),
3886
+ });
3887
+ export const listLlmCostOverridesResponse = z.object({
3888
+ data: z.array(llmCostPrice),
3889
+ meta: paginatedMeta,
3890
+ });
3891
+ export const createLlmCostOverrideBody = llmCostOverrideCreate;
3892
+ export const createLlmCostOverrideResponse = llmCostPrice;
3893
+ export const deleteLlmCostOverridePathParams = z.object({
3894
+ priceId: ulid,
3895
+ });
3896
+ export const listPlansQueryParams = z.object({
3897
+ page: z
3898
+ .object({
3899
+ size: z.coerce
3900
+ .number()
3901
+ .int()
3902
+ .optional()
3903
+ .describe("The number of items to include per page."),
3904
+ number: z.coerce.number().int().optional().describe("The page number."),
3905
+ })
3906
+ .optional()
3907
+ .describe("Determines which page of the collection to retrieve."),
3908
+ sort: sortQuery.optional(),
3909
+ filter: listPlansParamsFilter.optional(),
3910
+ });
3911
+ export const listPlansResponse = z.object({
3912
+ data: z.array(plan),
3913
+ meta: paginatedMeta,
3914
+ });
3915
+ export const createPlanBody = createPlanRequest;
3916
+ export const createPlanResponse = plan;
3917
+ export const updatePlanPathParams = z.object({
3918
+ planId: ulid,
3919
+ });
3920
+ export const updatePlanBody = upsertPlanRequest;
3921
+ export const updatePlanResponse = plan;
3922
+ export const getPlanPathParams = z.object({
3923
+ planId: ulid,
3924
+ });
3925
+ export const getPlanResponse = plan;
3926
+ export const deletePlanPathParams = z.object({
3927
+ planId: ulid,
3928
+ });
3929
+ export const archivePlanPathParams = z.object({
3930
+ planId: ulid,
3931
+ });
3932
+ export const archivePlanResponse = plan;
3933
+ export const publishPlanPathParams = z.object({
3934
+ planId: ulid,
3935
+ });
3936
+ export const publishPlanResponse = plan;
3937
+ export const listAddonsQueryParams = z.object({
3938
+ page: z
3939
+ .object({
3940
+ size: z.coerce
3941
+ .number()
3942
+ .int()
3943
+ .optional()
3944
+ .describe("The number of items to include per page."),
3945
+ number: z.coerce.number().int().optional().describe("The page number."),
3946
+ })
3947
+ .optional()
3948
+ .describe("Determines which page of the collection to retrieve."),
3949
+ sort: sortQuery.optional(),
3950
+ filter: listAddonsParamsFilter.optional(),
3951
+ });
3952
+ export const listAddonsResponse = z.object({
3953
+ data: z.array(addon),
3954
+ meta: paginatedMeta,
3955
+ });
3956
+ export const createAddonBody = createAddonRequest;
3957
+ export const createAddonResponse = addon;
3958
+ export const updateAddonPathParams = z.object({
3959
+ addonId: ulid,
3960
+ });
3961
+ export const updateAddonBody = upsertAddonRequest;
3962
+ export const updateAddonResponse = addon;
3963
+ export const getAddonPathParams = z.object({
3964
+ addonId: ulid,
3965
+ });
3966
+ export const getAddonResponse = addon;
3967
+ export const deleteAddonPathParams = z.object({
3968
+ addonId: ulid,
3969
+ });
3970
+ export const archiveAddonPathParams = z.object({
3971
+ addonId: ulid,
3972
+ });
3973
+ export const archiveAddonResponse = addon;
3974
+ export const publishAddonPathParams = z.object({
3975
+ addonId: ulid,
3976
+ });
3977
+ export const publishAddonResponse = addon;
3978
+ export const listPlanAddonsPathParams = z.object({
3979
+ planId: ulid,
3980
+ });
3981
+ export const listPlanAddonsQueryParams = z.object({
3982
+ page: z
3983
+ .object({
3984
+ size: z.coerce
3985
+ .number()
3986
+ .int()
3987
+ .optional()
3988
+ .describe("The number of items to include per page."),
3989
+ number: z.coerce.number().int().optional().describe("The page number."),
3990
+ })
3991
+ .optional()
3992
+ .describe("Determines which page of the collection to retrieve."),
3993
+ });
3994
+ export const listPlanAddonsResponse = z.object({
3995
+ data: z.array(planAddon),
3996
+ meta: paginatedMeta,
3997
+ });
3998
+ export const createPlanAddonPathParams = z.object({
3999
+ planId: ulid,
4000
+ });
4001
+ export const createPlanAddonBody = createPlanAddonRequest;
4002
+ export const createPlanAddonResponse = planAddon;
4003
+ export const getPlanAddonPathParams = z.object({
4004
+ planId: ulid,
4005
+ planAddonId: ulid,
4006
+ });
4007
+ export const getPlanAddonResponse = planAddon;
4008
+ export const updatePlanAddonPathParams = z.object({
4009
+ planId: ulid,
4010
+ planAddonId: ulid,
4011
+ });
4012
+ export const updatePlanAddonBody = upsertPlanAddonRequest;
4013
+ export const updatePlanAddonResponse = planAddon;
4014
+ export const deletePlanAddonPathParams = z.object({
4015
+ planId: ulid,
4016
+ planAddonId: ulid,
4017
+ });
4018
+ export const getOrganizationDefaultTaxCodesResponse = organizationDefaultTaxCodes;
4019
+ export const updateOrganizationDefaultTaxCodesBody = updateOrganizationDefaultTaxCodesRequest;
4020
+ export const updateOrganizationDefaultTaxCodesResponse = organizationDefaultTaxCodes;
4021
+ export const queryGovernanceAccessQueryParams = z.object({
4022
+ page: cursorPaginationQueryPage.optional(),
4023
+ });
4024
+ export const queryGovernanceAccessBody = governanceQueryRequest;
4025
+ export const queryGovernanceAccessResponse = governanceQueryResponse;
4026
+ //# sourceMappingURL=schemas.js.map