@leaflow/sdk 0.129.1 → 0.130.0

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 (163) hide show
  1. package/dist/billing/type/order/v1/generated/models.d.ts +241 -85
  2. package/dist/billing/type/order/v1/generated/models.js +19 -4
  3. package/dist/billing/type/order/v1/generated/validators/paymentResult.zod.d.ts +1 -0
  4. package/dist/billing/type/order/v1/generated/validators/refund.zod.d.ts +1 -0
  5. package/dist/billing/type/order/v1/generated/validators/refundList.zod.d.ts +1 -0
  6. package/dist/billing/type/order/v1/generated/validators/transaction.zod.d.ts +1 -0
  7. package/dist/billing/type/order/v1/generated/validators/transactionList.zod.d.ts +1 -0
  8. package/dist/billing/type/order/v1/generated/validators/transactionType.zod.d.ts +1 -0
  9. package/dist/billing/type/order/v1/generated/validators/transactionType.zod.js +1 -1
  10. package/dist/billing/type/order/v1/generated/validators/withdrawal.zod.d.ts +40 -0
  11. package/dist/billing/type/order/v1/generated/validators/withdrawal.zod.js +43 -0
  12. package/dist/billing/type/order/v1/generated/validators/withdrawalAllocation.zod.d.ts +19 -0
  13. package/dist/billing/type/order/v1/generated/validators/withdrawalAllocation.zod.js +17 -0
  14. package/dist/billing/type/order/v1/generated/validators/withdrawalCreate.zod.d.ts +25 -0
  15. package/dist/billing/type/order/v1/generated/validators/withdrawalCreate.zod.js +19 -0
  16. package/dist/billing/type/order/v1/generated/validators/withdrawalItem.zod.d.ts +46 -0
  17. package/dist/billing/type/order/v1/generated/validators/withdrawalItem.zod.js +37 -0
  18. package/dist/billing/type/order/v1/generated/validators/withdrawalItemList.zod.d.ts +48 -0
  19. package/dist/billing/type/order/v1/generated/validators/withdrawalItemList.zod.js +14 -0
  20. package/dist/billing/type/order/v1/generated/validators/withdrawalList.zod.d.ts +39 -0
  21. package/dist/billing/type/order/v1/generated/validators/withdrawalList.zod.js +14 -0
  22. package/dist/billing/type/order/v1/generated/validators/withdrawalPreview.zod.d.ts +40 -0
  23. package/dist/billing/type/order/v1/generated/validators/withdrawalPreview.zod.js +25 -0
  24. package/dist/billing/type/order/v1/generated/validators/withdrawalPreviewItem.zod.d.ts +28 -0
  25. package/dist/billing/type/order/v1/generated/validators/withdrawalPreviewItem.zod.js +19 -0
  26. package/dist/billing/type/order/v1/generated/validators/withdrawalPreviewRequest.zod.d.ts +15 -0
  27. package/dist/billing/type/order/v1/generated/validators/withdrawalPreviewRequest.zod.js +13 -0
  28. package/dist/billing/type/order/v1/generated/validators/withdrawalSource.zod.d.ts +23 -0
  29. package/dist/billing/type/order/v1/generated/validators/withdrawalSource.zod.js +23 -0
  30. package/dist/billing/v1/generated/functions.d.ts +106 -1
  31. package/dist/billing/v1/generated/functions.js +132 -0
  32. package/dist/billing/v1/generated/models.d.ts +194 -9
  33. package/dist/billing/v1/generated/models.js +15 -0
  34. package/dist/billing/v1/generated/schemas.zod.d.ts +59 -0
  35. package/dist/billing/v1/generated/schemas.zod.js +67 -0
  36. package/dist/billing/v1/generated/validators/listWithdrawalItemsParams.zod.d.ts +18 -0
  37. package/dist/billing/v1/generated/validators/listWithdrawalItemsParams.zod.js +24 -0
  38. package/dist/billing/v1/generated/validators/listWithdrawalsParams.zod.d.ts +19 -0
  39. package/dist/billing/v1/generated/validators/listWithdrawalsParams.zod.js +25 -0
  40. package/dist/billing/v1/generated/validators/paymentResult.zod.d.ts +1 -0
  41. package/dist/billing/v1/generated/validators/refund.zod.d.ts +1 -0
  42. package/dist/billing/v1/generated/validators/refundList.zod.d.ts +1 -0
  43. package/dist/billing/v1/generated/validators/transaction.zod.d.ts +1 -0
  44. package/dist/billing/v1/generated/validators/transactionList.zod.d.ts +1 -0
  45. package/dist/billing/v1/generated/validators/transactionType.zod.d.ts +1 -0
  46. package/dist/billing/v1/generated/validators/transactionType.zod.js +1 -1
  47. package/dist/billing/v1/generated/validators/withdrawal.zod.d.ts +40 -0
  48. package/dist/billing/v1/generated/validators/withdrawal.zod.js +43 -0
  49. package/dist/billing/v1/generated/validators/withdrawalAllocation.zod.d.ts +19 -0
  50. package/dist/billing/v1/generated/validators/withdrawalAllocation.zod.js +17 -0
  51. package/dist/billing/v1/generated/validators/withdrawalCreate.zod.d.ts +25 -0
  52. package/dist/billing/v1/generated/validators/withdrawalCreate.zod.js +19 -0
  53. package/dist/billing/v1/generated/validators/withdrawalItem.zod.d.ts +46 -0
  54. package/dist/billing/v1/generated/validators/withdrawalItem.zod.js +37 -0
  55. package/dist/billing/v1/generated/validators/withdrawalItemList.zod.d.ts +48 -0
  56. package/dist/billing/v1/generated/validators/withdrawalItemList.zod.js +14 -0
  57. package/dist/billing/v1/generated/validators/withdrawalList.zod.d.ts +39 -0
  58. package/dist/billing/v1/generated/validators/withdrawalList.zod.js +14 -0
  59. package/dist/billing/v1/generated/validators/withdrawalPreview.zod.d.ts +40 -0
  60. package/dist/billing/v1/generated/validators/withdrawalPreview.zod.js +25 -0
  61. package/dist/billing/v1/generated/validators/withdrawalPreviewItem.zod.d.ts +28 -0
  62. package/dist/billing/v1/generated/validators/withdrawalPreviewItem.zod.js +19 -0
  63. package/dist/billing/v1/generated/validators/withdrawalPreviewRequest.zod.d.ts +15 -0
  64. package/dist/billing/v1/generated/validators/withdrawalPreviewRequest.zod.js +13 -0
  65. package/dist/billing/v1/generated/validators/withdrawalSource.zod.d.ts +23 -0
  66. package/dist/billing/v1/generated/validators/withdrawalSource.zod.js +23 -0
  67. package/dist/canopy/v1/generated/models.d.ts +241 -85
  68. package/dist/canopy/v1/generated/models.js +19 -4
  69. package/dist/canopy/v1/generated/validators/paymentResult.zod.d.ts +1 -0
  70. package/dist/canopy/v1/generated/validators/refund.zod.d.ts +1 -0
  71. package/dist/canopy/v1/generated/validators/refundList.zod.d.ts +1 -0
  72. package/dist/canopy/v1/generated/validators/transaction.zod.d.ts +1 -0
  73. package/dist/canopy/v1/generated/validators/transactionList.zod.d.ts +1 -0
  74. package/dist/canopy/v1/generated/validators/transactionType.zod.d.ts +1 -0
  75. package/dist/canopy/v1/generated/validators/transactionType.zod.js +1 -1
  76. package/dist/canopy/v1/generated/validators/withdrawal.zod.d.ts +63 -0
  77. package/dist/canopy/v1/generated/validators/withdrawal.zod.js +66 -0
  78. package/dist/canopy/v1/generated/validators/withdrawalAllocation.zod.d.ts +42 -0
  79. package/dist/canopy/v1/generated/validators/withdrawalAllocation.zod.js +40 -0
  80. package/dist/canopy/v1/generated/validators/withdrawalCreate.zod.d.ts +48 -0
  81. package/dist/canopy/v1/generated/validators/withdrawalCreate.zod.js +42 -0
  82. package/dist/canopy/v1/generated/validators/withdrawalItem.zod.d.ts +69 -0
  83. package/dist/canopy/v1/generated/validators/withdrawalItem.zod.js +60 -0
  84. package/dist/canopy/v1/generated/validators/withdrawalItemList.zod.d.ts +71 -0
  85. package/dist/canopy/v1/generated/validators/withdrawalItemList.zod.js +37 -0
  86. package/dist/canopy/v1/generated/validators/withdrawalList.zod.d.ts +62 -0
  87. package/dist/canopy/v1/generated/validators/withdrawalList.zod.js +37 -0
  88. package/dist/canopy/v1/generated/validators/withdrawalPreview.zod.d.ts +63 -0
  89. package/dist/canopy/v1/generated/validators/withdrawalPreview.zod.js +48 -0
  90. package/dist/canopy/v1/generated/validators/withdrawalPreviewItem.zod.d.ts +51 -0
  91. package/dist/canopy/v1/generated/validators/withdrawalPreviewItem.zod.js +42 -0
  92. package/dist/canopy/v1/generated/validators/withdrawalPreviewRequest.zod.d.ts +38 -0
  93. package/dist/canopy/v1/generated/validators/withdrawalPreviewRequest.zod.js +36 -0
  94. package/dist/canopy/v1/generated/validators/withdrawalSource.zod.d.ts +46 -0
  95. package/dist/canopy/v1/generated/validators/withdrawalSource.zod.js +46 -0
  96. package/dist/compute/v1/generated/models.d.ts +241 -85
  97. package/dist/compute/v1/generated/models.js +19 -4
  98. package/dist/compute/v1/generated/validators/paymentResult.zod.d.ts +1 -0
  99. package/dist/compute/v1/generated/validators/refund.zod.d.ts +1 -0
  100. package/dist/compute/v1/generated/validators/refundList.zod.d.ts +1 -0
  101. package/dist/compute/v1/generated/validators/transaction.zod.d.ts +1 -0
  102. package/dist/compute/v1/generated/validators/transactionList.zod.d.ts +1 -0
  103. package/dist/compute/v1/generated/validators/transactionType.zod.d.ts +1 -0
  104. package/dist/compute/v1/generated/validators/transactionType.zod.js +1 -1
  105. package/dist/compute/v1/generated/validators/withdrawal.zod.d.ts +56 -0
  106. package/dist/compute/v1/generated/validators/withdrawal.zod.js +59 -0
  107. package/dist/compute/v1/generated/validators/withdrawalAllocation.zod.d.ts +35 -0
  108. package/dist/compute/v1/generated/validators/withdrawalAllocation.zod.js +33 -0
  109. package/dist/compute/v1/generated/validators/withdrawalCreate.zod.d.ts +41 -0
  110. package/dist/compute/v1/generated/validators/withdrawalCreate.zod.js +35 -0
  111. package/dist/compute/v1/generated/validators/withdrawalItem.zod.d.ts +62 -0
  112. package/dist/compute/v1/generated/validators/withdrawalItem.zod.js +53 -0
  113. package/dist/compute/v1/generated/validators/withdrawalItemList.zod.d.ts +64 -0
  114. package/dist/compute/v1/generated/validators/withdrawalItemList.zod.js +30 -0
  115. package/dist/compute/v1/generated/validators/withdrawalList.zod.d.ts +55 -0
  116. package/dist/compute/v1/generated/validators/withdrawalList.zod.js +30 -0
  117. package/dist/compute/v1/generated/validators/withdrawalPreview.zod.d.ts +56 -0
  118. package/dist/compute/v1/generated/validators/withdrawalPreview.zod.js +41 -0
  119. package/dist/compute/v1/generated/validators/withdrawalPreviewItem.zod.d.ts +44 -0
  120. package/dist/compute/v1/generated/validators/withdrawalPreviewItem.zod.js +35 -0
  121. package/dist/compute/v1/generated/validators/withdrawalPreviewRequest.zod.d.ts +31 -0
  122. package/dist/compute/v1/generated/validators/withdrawalPreviewRequest.zod.js +29 -0
  123. package/dist/compute/v1/generated/validators/withdrawalSource.zod.d.ts +39 -0
  124. package/dist/compute/v1/generated/validators/withdrawalSource.zod.js +39 -0
  125. package/dist/membership/v1/generated/models.d.ts +247 -85
  126. package/dist/membership/v1/generated/models.js +19 -4
  127. package/dist/membership/v1/generated/validators/grant.zod.d.ts +2 -0
  128. package/dist/membership/v1/generated/validators/grant.zod.js +5 -0
  129. package/dist/membership/v1/generated/validators/membership.zod.d.ts +2 -0
  130. package/dist/membership/v1/generated/validators/membershipList.zod.d.ts +2 -0
  131. package/dist/membership/v1/generated/validators/membershipPurchase.zod.d.ts +2 -0
  132. package/dist/membership/v1/generated/validators/paymentResult.zod.d.ts +1 -0
  133. package/dist/membership/v1/generated/validators/period.zod.d.ts +2 -0
  134. package/dist/membership/v1/generated/validators/periodList.zod.d.ts +2 -0
  135. package/dist/membership/v1/generated/validators/refund.zod.d.ts +1 -0
  136. package/dist/membership/v1/generated/validators/refundList.zod.d.ts +1 -0
  137. package/dist/membership/v1/generated/validators/transaction.zod.d.ts +1 -0
  138. package/dist/membership/v1/generated/validators/transactionList.zod.d.ts +1 -0
  139. package/dist/membership/v1/generated/validators/transactionType.zod.d.ts +1 -0
  140. package/dist/membership/v1/generated/validators/transactionType.zod.js +1 -1
  141. package/dist/membership/v1/generated/validators/withdrawal.zod.d.ts +40 -0
  142. package/dist/membership/v1/generated/validators/withdrawal.zod.js +43 -0
  143. package/dist/membership/v1/generated/validators/withdrawalAllocation.zod.d.ts +19 -0
  144. package/dist/membership/v1/generated/validators/withdrawalAllocation.zod.js +17 -0
  145. package/dist/membership/v1/generated/validators/withdrawalCreate.zod.d.ts +25 -0
  146. package/dist/membership/v1/generated/validators/withdrawalCreate.zod.js +19 -0
  147. package/dist/membership/v1/generated/validators/withdrawalItem.zod.d.ts +46 -0
  148. package/dist/membership/v1/generated/validators/withdrawalItem.zod.js +37 -0
  149. package/dist/membership/v1/generated/validators/withdrawalItemList.zod.d.ts +48 -0
  150. package/dist/membership/v1/generated/validators/withdrawalItemList.zod.js +14 -0
  151. package/dist/membership/v1/generated/validators/withdrawalList.zod.d.ts +39 -0
  152. package/dist/membership/v1/generated/validators/withdrawalList.zod.js +14 -0
  153. package/dist/membership/v1/generated/validators/withdrawalPreview.zod.d.ts +40 -0
  154. package/dist/membership/v1/generated/validators/withdrawalPreview.zod.js +25 -0
  155. package/dist/membership/v1/generated/validators/withdrawalPreviewItem.zod.d.ts +28 -0
  156. package/dist/membership/v1/generated/validators/withdrawalPreviewItem.zod.js +19 -0
  157. package/dist/membership/v1/generated/validators/withdrawalPreviewRequest.zod.d.ts +15 -0
  158. package/dist/membership/v1/generated/validators/withdrawalPreviewRequest.zod.js +13 -0
  159. package/dist/membership/v1/generated/validators/withdrawalSource.zod.d.ts +23 -0
  160. package/dist/membership/v1/generated/validators/withdrawalSource.zod.js +23 -0
  161. package/dist/routes.d.ts +40 -0
  162. package/dist/routes.js +45 -0
  163. package/package.json +1 -1
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Management of API keys, together with the models available and the usage recorded against them.
6
+ *
7
+ * **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
8
+ *
9
+ * ```
10
+ * POST /v1/chat/completions OpenAI
11
+ * POST /v1/messages Anthropic
12
+ * POST /v1beta/models/{model}:generateContent Gemini
13
+ * ```
14
+ *
15
+ * ## Authentication
16
+ *
17
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
18
+ *
19
+ * These endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
20
+ *
21
+ * ## Conventions
22
+ *
23
+ * - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
24
+ * - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
25
+ * - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
26
+ * - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
27
+ * - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
28
+ * - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
29
+ * OpenAPI spec version: 1.0.0
30
+ */
31
+ import * as zod from "zod";
32
+ import { WithdrawalSource } from "./withdrawalSource.zod.js";
33
+ export const withdrawalPreviewItemAmountRegExp = new RegExp("^[0-9]{1,15}([.][0-9]{1,10})?$");
34
+ export const withdrawalPreviewItemFeeAmountRegExp = new RegExp("^[0-9]{1,15}([.][0-9]{1,10})?$");
35
+ export const withdrawalPreviewItemRefundAmountRegExp = new RegExp("^[0-9]{1,15}([.][0-9]{1,10})?$");
36
+ export const WithdrawalPreviewItem = zod.strictObject({
37
+ source_transaction_id: zod.uuid(),
38
+ amount: zod.string().regex(withdrawalPreviewItemAmountRegExp),
39
+ fee_amount: zod.string().regex(withdrawalPreviewItemFeeAmountRegExp),
40
+ refund_amount: zod.string().regex(withdrawalPreviewItemRefundAmountRegExp),
41
+ source: WithdrawalSource,
42
+ });
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Management of API keys, together with the models available and the usage recorded against them.
6
+ *
7
+ * **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
8
+ *
9
+ * ```
10
+ * POST /v1/chat/completions OpenAI
11
+ * POST /v1/messages Anthropic
12
+ * POST /v1beta/models/{model}:generateContent Gemini
13
+ * ```
14
+ *
15
+ * ## Authentication
16
+ *
17
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
18
+ *
19
+ * These endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
20
+ *
21
+ * ## Conventions
22
+ *
23
+ * - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
24
+ * - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
25
+ * - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
26
+ * - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
27
+ * - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
28
+ * - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
29
+ * OpenAPI spec version: 1.0.0
30
+ */
31
+ import * as zod from "zod";
32
+ export declare const withdrawalPreviewRequestAmountRegExp: RegExp;
33
+ export declare const WithdrawalPreviewRequest: zod.ZodObject<{
34
+ billing_account_id: zod.ZodInt;
35
+ amount: zod.ZodOptional<zod.ZodString>;
36
+ }, zod.z.core.$strict>;
37
+ export type WithdrawalPreviewRequest = zod.input<typeof WithdrawalPreviewRequest>;
38
+ export type WithdrawalPreviewRequestOutput = zod.output<typeof WithdrawalPreviewRequest>;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Management of API keys, together with the models available and the usage recorded against them.
6
+ *
7
+ * **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
8
+ *
9
+ * ```
10
+ * POST /v1/chat/completions OpenAI
11
+ * POST /v1/messages Anthropic
12
+ * POST /v1beta/models/{model}:generateContent Gemini
13
+ * ```
14
+ *
15
+ * ## Authentication
16
+ *
17
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
18
+ *
19
+ * These endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
20
+ *
21
+ * ## Conventions
22
+ *
23
+ * - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
24
+ * - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
25
+ * - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
26
+ * - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
27
+ * - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
28
+ * - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
29
+ * OpenAPI spec version: 1.0.0
30
+ */
31
+ import * as zod from "zod";
32
+ export const withdrawalPreviewRequestAmountRegExp = new RegExp("^[0-9]{1,15}([.][0-9]{1,10})?$");
33
+ export const WithdrawalPreviewRequest = zod.strictObject({
34
+ billing_account_id: zod.int(),
35
+ amount: zod.string().regex(withdrawalPreviewRequestAmountRegExp).optional(),
36
+ });
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Management of API keys, together with the models available and the usage recorded against them.
6
+ *
7
+ * **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
8
+ *
9
+ * ```
10
+ * POST /v1/chat/completions OpenAI
11
+ * POST /v1/messages Anthropic
12
+ * POST /v1beta/models/{model}:generateContent Gemini
13
+ * ```
14
+ *
15
+ * ## Authentication
16
+ *
17
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
18
+ *
19
+ * These endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
20
+ *
21
+ * ## Conventions
22
+ *
23
+ * - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
24
+ * - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
25
+ * - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
26
+ * - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
27
+ * - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
28
+ * - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
29
+ * OpenAPI spec version: 1.0.0
30
+ */
31
+ import * as zod from "zod";
32
+ export declare const withdrawalSourceAmountRegExp: RegExp;
33
+ export declare const withdrawalSourceCurrencyMin = 3;
34
+ export declare const withdrawalSourceCurrencyMax = 3;
35
+ export declare const withdrawalSourceCardLast4RegExp: RegExp;
36
+ export declare const WithdrawalSource: zod.ZodObject<{
37
+ amount: zod.ZodString;
38
+ currency: zod.ZodString;
39
+ received_at: zod.z.ZodISODateTime;
40
+ payment_gateway: zod.ZodString;
41
+ method_type: zod.ZodString;
42
+ card_brand: zod.ZodOptional<zod.ZodString>;
43
+ card_last4: zod.ZodOptional<zod.ZodString>;
44
+ }, zod.z.core.$strict>;
45
+ export type WithdrawalSource = zod.input<typeof WithdrawalSource>;
46
+ export type WithdrawalSourceOutput = zod.output<typeof WithdrawalSource>;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Management of API keys, together with the models available and the usage recorded against them.
6
+ *
7
+ * **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
8
+ *
9
+ * ```
10
+ * POST /v1/chat/completions OpenAI
11
+ * POST /v1/messages Anthropic
12
+ * POST /v1beta/models/{model}:generateContent Gemini
13
+ * ```
14
+ *
15
+ * ## Authentication
16
+ *
17
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
18
+ *
19
+ * These endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
20
+ *
21
+ * ## Conventions
22
+ *
23
+ * - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
24
+ * - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
25
+ * - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
26
+ * - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
27
+ * - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
28
+ * - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
29
+ * OpenAPI spec version: 1.0.0
30
+ */
31
+ import * as zod from "zod";
32
+ export const withdrawalSourceAmountRegExp = new RegExp("^[0-9]{1,15}([.][0-9]{1,10})?$");
33
+ export const withdrawalSourceCurrencyMin = 3;
34
+ export const withdrawalSourceCurrencyMax = 3;
35
+ export const withdrawalSourceCardLast4RegExp = new RegExp("^[0-9]{4}$");
36
+ export const WithdrawalSource = zod
37
+ .strictObject({
38
+ amount: zod.string().regex(withdrawalSourceAmountRegExp),
39
+ currency: zod.string().min(withdrawalSourceCurrencyMin).max(withdrawalSourceCurrencyMax),
40
+ received_at: zod.iso.datetime({ offset: true }),
41
+ payment_gateway: zod.string(),
42
+ method_type: zod.string(),
43
+ card_brand: zod.string().optional(),
44
+ card_last4: zod.string().regex(withdrawalSourceCardLast4RegExp).optional(),
45
+ })
46
+ .describe("The original top-up and its refund destination. Card details are included when the original payment method was saved; missing card details do not change the original refund route.");
@@ -2531,108 +2531,159 @@ export interface CursorPagination {
2531
2531
  /** @nullable */
2532
2532
  next_cursor?: string | null;
2533
2533
  }
2534
+ export interface WithdrawalAllocation {
2535
+ source_transaction_id: string;
2536
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2537
+ amount: string;
2538
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2539
+ fee_amount: string;
2540
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2541
+ refund_amount: string;
2542
+ }
2543
+ export type WithdrawalItemStatus = (typeof WithdrawalItemStatus)[keyof typeof WithdrawalItemStatus];
2544
+ export declare const WithdrawalItemStatus: {
2545
+ readonly pending: "pending";
2546
+ readonly succeeded: "succeeded";
2547
+ readonly failed: "failed";
2548
+ readonly reversed: "reversed";
2549
+ };
2534
2550
  /**
2535
- * How tax applies to the customer, as in Stripe. `none` taxes normally. `exempt` charges no tax.
2536
- * `reverse` charges no tax and leaves it to the customer under the reverse-charge mechanism;
2537
- * invoices state this. Only operators change it.
2551
+ * The original top-up and its refund destination. Card details are included when the original payment method was saved; missing card details do not change the original refund route.
2538
2552
  */
2539
- export type ContactTaxExempt = (typeof ContactTaxExempt)[keyof typeof ContactTaxExempt];
2540
- export declare const ContactTaxExempt: {
2541
- readonly none: "none";
2542
- readonly exempt: "exempt";
2543
- readonly reverse: "reverse";
2544
- };
2553
+ export interface WithdrawalSource {
2554
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2555
+ amount: string;
2556
+ /**
2557
+ * @minLength 3
2558
+ * @maxLength 3
2559
+ */
2560
+ currency: string;
2561
+ received_at: string;
2562
+ payment_gateway: string;
2563
+ method_type: string;
2564
+ card_brand?: string;
2565
+ /** @pattern ^[0-9]{4}$ */
2566
+ card_last4?: string;
2567
+ }
2545
2568
  /**
2546
- * A billing-account contact profile with one address. An account can hold multiple contacts; this is not a login identity.
2569
+ * The fixed principal deduction, withdrawal fee and exact refund obligation for one original top-up. Each item has its own refund; payment_gateway and method_type identify the original route.
2547
2570
  */
2548
- export interface Contact {
2571
+ export interface WithdrawalItem {
2572
+ source_transaction_id: string;
2573
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2574
+ amount: string;
2575
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2576
+ fee_amount: string;
2577
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2578
+ refund_amount: string;
2549
2579
  id: string;
2580
+ withdrawal_id: string;
2550
2581
  billing_account_id: number;
2551
2582
  /**
2552
- * @minLength 1
2553
- * @maxLength 255
2583
+ * @minLength 3
2584
+ * @maxLength 3
2554
2585
  */
2555
- name: string;
2556
- /** @maxLength 255 */
2557
- legal_name?: string;
2558
- /** @maxLength 255 */
2559
- email?: string;
2560
- /** @maxLength 64 */
2561
- tax_id?: string;
2562
- /** @maxLength 255 */
2563
- address_line1?: string;
2564
- /** @maxLength 255 */
2565
- address_line2?: string;
2566
- /** @maxLength 128 */
2567
- address_city?: string;
2568
- /** @maxLength 128 */
2569
- address_state?: string;
2570
- /** @maxLength 32 */
2571
- address_postal_code?: string;
2572
- /** @pattern ^([A-Z]{2})?$ */
2573
- address_country?: string;
2586
+ currency: string;
2587
+ refund_id: string;
2588
+ fee_transaction_id?: string;
2589
+ status: WithdrawalItemStatus;
2590
+ completed_at?: string;
2591
+ payment_gateway: string;
2592
+ method_type: string;
2593
+ source: WithdrawalSource;
2594
+ /** The original gateway failure code when a refund failed, or refund_reversed when a completed refund was reversed. Absent while pending or successful. */
2595
+ failure_code?: string;
2596
+ }
2597
+ export type WithdrawalStatus = (typeof WithdrawalStatus)[keyof typeof WithdrawalStatus];
2598
+ export declare const WithdrawalStatus: {
2599
+ readonly pending: "pending";
2600
+ readonly processing: "processing";
2601
+ readonly succeeded: "succeeded";
2602
+ readonly partially_completed: "partially_completed";
2603
+ readonly failed: "failed";
2604
+ readonly reversed: "reversed";
2605
+ };
2606
+ /**
2607
+ * An account withdrawal to the original payment methods of its unused top-ups. Accepted amounts are fixed. deducted_amount, settled_amount and charged_fee_amount report completed source items. Failed items release their principal and fee reservations; successful items are retained when another source fails.
2608
+ */
2609
+ export interface Withdrawal {
2610
+ id: string;
2611
+ billing_account_id: number;
2574
2612
  /**
2575
- * How tax applies to the customer, as in Stripe. `none` taxes normally. `exempt` charges no tax.
2576
- * `reverse` charges no tax and leaves it to the customer under the reverse-charge mechanism;
2577
- * invoices state this. Only operators change it.
2613
+ * @minLength 3
2614
+ * @maxLength 3
2578
2615
  */
2579
- tax_exempt: ContactTaxExempt;
2580
- active: boolean;
2616
+ currency: string;
2617
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2618
+ amount: string;
2619
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2620
+ fee_amount: string;
2621
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2622
+ refund_amount: string;
2623
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2624
+ deducted_amount: string;
2625
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2626
+ settled_amount: string;
2627
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2628
+ charged_fee_amount: string;
2629
+ status: WithdrawalStatus;
2581
2630
  created_at: string;
2582
- }
2583
- export interface ContactCreate {
2631
+ completed_at?: string;
2632
+ /** Identity that submitted this withdrawal. It can differ from the billing account owner. */
2633
+ created_by?: string;
2634
+ }
2635
+ export interface WithdrawalPreviewItem {
2636
+ source_transaction_id: string;
2637
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2638
+ amount: string;
2639
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2640
+ fee_amount: string;
2641
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2642
+ refund_amount: string;
2643
+ source: WithdrawalSource;
2644
+ }
2645
+ export interface WithdrawalPreview {
2646
+ billing_account_id: number;
2584
2647
  /**
2585
- * @minLength 1
2586
- * @maxLength 255
2648
+ * @minLength 3
2649
+ * @maxLength 3
2587
2650
  */
2588
- name: string;
2589
- /** @maxLength 255 */
2590
- legal_name?: string;
2591
- /** @maxLength 255 */
2592
- email?: string;
2593
- /** @maxLength 64 */
2594
- tax_id?: string;
2595
- /** @maxLength 255 */
2596
- address_line1?: string;
2597
- /** @maxLength 255 */
2598
- address_line2?: string;
2599
- /** @maxLength 128 */
2600
- address_city?: string;
2601
- /** @maxLength 128 */
2602
- address_state?: string;
2603
- /** @maxLength 32 */
2604
- address_postal_code?: string;
2605
- /** @pattern ^([A-Z]{2})?$ */
2606
- address_country?: string;
2651
+ currency: string;
2652
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2653
+ available_amount: string;
2654
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2655
+ amount: string;
2656
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2657
+ fee_amount: string;
2658
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2659
+ refund_amount: string;
2660
+ /** @maxItems 200 */
2661
+ items: WithdrawalPreviewItem[];
2662
+ }
2663
+ export interface WithdrawalPreviewRequest {
2664
+ billing_account_id: number;
2665
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2666
+ amount?: string;
2607
2667
  }
2608
- export interface ContactUpdate {
2668
+ export interface WithdrawalCreate {
2669
+ id: string;
2670
+ billing_account_id: number;
2671
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2672
+ amount: string;
2673
+ /** @pattern ^[0-9]{1,15}([.][0-9]{1,10})?$ */
2674
+ expected_refund_amount: string;
2609
2675
  /**
2610
- * @minLength 1
2611
- * @maxLength 255
2676
+ * @minItems 1
2677
+ * @maxItems 200
2612
2678
  */
2613
- name?: string;
2614
- /** @maxLength 255 */
2615
- legal_name?: string;
2616
- /** @maxLength 255 */
2617
- email?: string;
2618
- /** @maxLength 64 */
2619
- tax_id?: string;
2620
- /** @maxLength 255 */
2621
- address_line1?: string;
2622
- /** @maxLength 255 */
2623
- address_line2?: string;
2624
- /** @maxLength 128 */
2625
- address_city?: string;
2626
- /** @maxLength 128 */
2627
- address_state?: string;
2628
- /** @maxLength 32 */
2629
- address_postal_code?: string;
2630
- /** @pattern ^([A-Z]{2})?$ */
2631
- address_country?: string;
2632
- active?: boolean;
2679
+ expected_items: WithdrawalAllocation[];
2633
2680
  }
2634
- export interface ContactList {
2635
- items: Contact[];
2681
+ export interface WithdrawalList {
2682
+ items: Withdrawal[];
2683
+ pagination: OffsetPagination;
2684
+ }
2685
+ export interface WithdrawalItemList {
2686
+ items: WithdrawalItem[];
2636
2687
  pagination: OffsetPagination;
2637
2688
  }
2638
2689
  /**
@@ -3695,6 +3746,7 @@ export declare const TransactionType: {
3695
3746
  readonly payment: "payment";
3696
3747
  readonly refund: "refund";
3697
3748
  readonly adjustment: "adjustment";
3749
+ readonly fee: "fee";
3698
3750
  };
3699
3751
  /**
3700
3752
  * A funds operation. Each payment has one source; refunds identify the original successful transaction. Unknown gateway results remain pending. Payments from the balance or a gateway are distinct from credit-grant payments.
@@ -5306,6 +5358,110 @@ export interface QuoteRequest {
5306
5358
  promotion_code?: string;
5307
5359
  refund?: OrderRefundQuoteInput;
5308
5360
  }
5361
+ /**
5362
+ * How tax applies to the customer, as in Stripe. `none` taxes normally. `exempt` charges no tax.
5363
+ * `reverse` charges no tax and leaves it to the customer under the reverse-charge mechanism;
5364
+ * invoices state this. Only operators change it.
5365
+ */
5366
+ export type ContactTaxExempt = (typeof ContactTaxExempt)[keyof typeof ContactTaxExempt];
5367
+ export declare const ContactTaxExempt: {
5368
+ readonly none: "none";
5369
+ readonly exempt: "exempt";
5370
+ readonly reverse: "reverse";
5371
+ };
5372
+ /**
5373
+ * A billing-account contact profile with one address. An account can hold multiple contacts; this is not a login identity.
5374
+ */
5375
+ export interface Contact {
5376
+ id: string;
5377
+ billing_account_id: number;
5378
+ /**
5379
+ * @minLength 1
5380
+ * @maxLength 255
5381
+ */
5382
+ name: string;
5383
+ /** @maxLength 255 */
5384
+ legal_name?: string;
5385
+ /** @maxLength 255 */
5386
+ email?: string;
5387
+ /** @maxLength 64 */
5388
+ tax_id?: string;
5389
+ /** @maxLength 255 */
5390
+ address_line1?: string;
5391
+ /** @maxLength 255 */
5392
+ address_line2?: string;
5393
+ /** @maxLength 128 */
5394
+ address_city?: string;
5395
+ /** @maxLength 128 */
5396
+ address_state?: string;
5397
+ /** @maxLength 32 */
5398
+ address_postal_code?: string;
5399
+ /** @pattern ^([A-Z]{2})?$ */
5400
+ address_country?: string;
5401
+ /**
5402
+ * How tax applies to the customer, as in Stripe. `none` taxes normally. `exempt` charges no tax.
5403
+ * `reverse` charges no tax and leaves it to the customer under the reverse-charge mechanism;
5404
+ * invoices state this. Only operators change it.
5405
+ */
5406
+ tax_exempt: ContactTaxExempt;
5407
+ active: boolean;
5408
+ created_at: string;
5409
+ }
5410
+ export interface ContactCreate {
5411
+ /**
5412
+ * @minLength 1
5413
+ * @maxLength 255
5414
+ */
5415
+ name: string;
5416
+ /** @maxLength 255 */
5417
+ legal_name?: string;
5418
+ /** @maxLength 255 */
5419
+ email?: string;
5420
+ /** @maxLength 64 */
5421
+ tax_id?: string;
5422
+ /** @maxLength 255 */
5423
+ address_line1?: string;
5424
+ /** @maxLength 255 */
5425
+ address_line2?: string;
5426
+ /** @maxLength 128 */
5427
+ address_city?: string;
5428
+ /** @maxLength 128 */
5429
+ address_state?: string;
5430
+ /** @maxLength 32 */
5431
+ address_postal_code?: string;
5432
+ /** @pattern ^([A-Z]{2})?$ */
5433
+ address_country?: string;
5434
+ }
5435
+ export interface ContactUpdate {
5436
+ /**
5437
+ * @minLength 1
5438
+ * @maxLength 255
5439
+ */
5440
+ name?: string;
5441
+ /** @maxLength 255 */
5442
+ legal_name?: string;
5443
+ /** @maxLength 255 */
5444
+ email?: string;
5445
+ /** @maxLength 64 */
5446
+ tax_id?: string;
5447
+ /** @maxLength 255 */
5448
+ address_line1?: string;
5449
+ /** @maxLength 255 */
5450
+ address_line2?: string;
5451
+ /** @maxLength 128 */
5452
+ address_city?: string;
5453
+ /** @maxLength 128 */
5454
+ address_state?: string;
5455
+ /** @maxLength 32 */
5456
+ address_postal_code?: string;
5457
+ /** @pattern ^([A-Z]{2})?$ */
5458
+ address_country?: string;
5459
+ active?: boolean;
5460
+ }
5461
+ export interface ContactList {
5462
+ items: Contact[];
5463
+ pagination: OffsetPagination;
5464
+ }
5309
5465
  export interface CancelSubscriptionRequest {
5310
5466
  mode: TerminationPolicyBfdab9f;
5311
5467
  /** For immediate cancellation, the quoted whole-second refund basis. Now when omitted. */
@@ -352,10 +352,19 @@ export const BackupCapacityPackFailureReason = {
352
352
  order_expired: "order_expired",
353
353
  provisioning_failed: "provisioning_failed",
354
354
  };
355
- export const ContactTaxExempt = {
356
- none: "none",
357
- exempt: "exempt",
358
- reverse: "reverse",
355
+ export const WithdrawalItemStatus = {
356
+ pending: "pending",
357
+ succeeded: "succeeded",
358
+ failed: "failed",
359
+ reversed: "reversed",
360
+ };
361
+ export const WithdrawalStatus = {
362
+ pending: "pending",
363
+ processing: "processing",
364
+ succeeded: "succeeded",
365
+ partially_completed: "partially_completed",
366
+ failed: "failed",
367
+ reversed: "reversed",
359
368
  };
360
369
  export const TerminationPolicyBfdab9f = {
361
370
  immediate: "immediate",
@@ -490,6 +499,7 @@ export const TransactionType = {
490
499
  payment: "payment",
491
500
  refund: "refund",
492
501
  adjustment: "adjustment",
502
+ fee: "fee",
493
503
  };
494
504
  export const InvoiceCustomerTaxExempt = {
495
505
  none: "none",
@@ -700,6 +710,11 @@ export const ActiveResourceStatus = {
700
710
  closing: "closing",
701
711
  closed: "closed",
702
712
  };
713
+ export const ContactTaxExempt = {
714
+ none: "none",
715
+ exempt: "exempt",
716
+ reverse: "reverse",
717
+ };
703
718
  export const StatementStatus = {
704
719
  open: "open",
705
720
  closed: "closed",
@@ -59,6 +59,7 @@ export declare const PaymentResult: zod.ZodObject<{
59
59
  payment: "payment";
60
60
  refund: "refund";
61
61
  adjustment: "adjustment";
62
+ fee: "fee";
62
63
  }>;
63
64
  amount: zod.ZodString;
64
65
  remaining_amount: zod.ZodString;
@@ -61,6 +61,7 @@ export declare const Refund: zod.ZodObject<{
61
61
  payment: "payment";
62
62
  refund: "refund";
63
63
  adjustment: "adjustment";
64
+ fee: "fee";
64
65
  }>;
65
66
  amount: zod.ZodString;
66
67
  remaining_amount: zod.ZodString;
@@ -62,6 +62,7 @@ export declare const RefundList: zod.ZodObject<{
62
62
  payment: "payment";
63
63
  refund: "refund";
64
64
  adjustment: "adjustment";
65
+ fee: "fee";
65
66
  }>;
66
67
  amount: zod.ZodString;
67
68
  remaining_amount: zod.ZodString;
@@ -58,6 +58,7 @@ export declare const Transaction: zod.ZodObject<{
58
58
  payment: "payment";
59
59
  refund: "refund";
60
60
  adjustment: "adjustment";
61
+ fee: "fee";
61
62
  }>;
62
63
  amount: zod.ZodString;
63
64
  remaining_amount: zod.ZodString;