@leaflow/sdk 0.172.0 → 0.173.1

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 (92) hide show
  1. package/dist/account/v1/generated/models.d.ts +52 -10
  2. package/dist/account/v1/generated/validators/error.zod.d.ts +13 -4
  3. package/dist/account/v1/generated/validators/error.zod.js +6 -9
  4. package/dist/account/v1/generated/validators/errorStatus.zod.d.ts +41 -0
  5. package/dist/account/v1/generated/validators/errorStatus.zod.js +56 -0
  6. package/dist/account/v1/generated/validators/fieldViolation.zod.d.ts +32 -0
  7. package/dist/account/v1/generated/validators/fieldViolation.zod.js +35 -0
  8. package/dist/assistant/v1/generated/models.d.ts +52 -10
  9. package/dist/assistant/v1/generated/validators/error.zod.d.ts +13 -4
  10. package/dist/assistant/v1/generated/validators/error.zod.js +6 -9
  11. package/dist/assistant/v1/generated/validators/errorStatus.zod.d.ts +40 -0
  12. package/dist/assistant/v1/generated/validators/errorStatus.zod.js +55 -0
  13. package/dist/assistant/v1/generated/validators/fieldViolation.zod.d.ts +31 -0
  14. package/dist/assistant/v1/generated/validators/fieldViolation.zod.js +34 -0
  15. package/dist/billing/v1/generated/models.d.ts +52 -10
  16. package/dist/billing/v1/generated/validators/error.zod.d.ts +13 -4
  17. package/dist/billing/v1/generated/validators/error.zod.js +6 -9
  18. package/dist/billing/v1/generated/validators/errorStatus.zod.d.ts +23 -0
  19. package/dist/billing/v1/generated/validators/errorStatus.zod.js +38 -0
  20. package/dist/billing/v1/generated/validators/fieldViolation.zod.d.ts +14 -0
  21. package/dist/billing/v1/generated/validators/fieldViolation.zod.js +17 -0
  22. package/dist/canopy/v1/generated/models.d.ts +52 -10
  23. package/dist/canopy/v1/generated/validators/error.zod.d.ts +13 -4
  24. package/dist/canopy/v1/generated/validators/error.zod.js +6 -9
  25. package/dist/canopy/v1/generated/validators/errorStatus.zod.d.ts +56 -0
  26. package/dist/canopy/v1/generated/validators/errorStatus.zod.js +71 -0
  27. package/dist/canopy/v1/generated/validators/fieldViolation.zod.d.ts +47 -0
  28. package/dist/canopy/v1/generated/validators/fieldViolation.zod.js +50 -0
  29. package/dist/compute/v2/generated/models.d.ts +52 -10
  30. package/dist/compute/v2/generated/validators/error.zod.d.ts +13 -4
  31. package/dist/compute/v2/generated/validators/error.zod.js +6 -9
  32. package/dist/compute/v2/generated/validators/errorStatus.zod.d.ts +50 -0
  33. package/dist/compute/v2/generated/validators/errorStatus.zod.js +65 -0
  34. package/dist/compute/v2/generated/validators/fieldViolation.zod.d.ts +41 -0
  35. package/dist/compute/v2/generated/validators/fieldViolation.zod.js +44 -0
  36. package/dist/dns/v1/generated/models.d.ts +52 -10
  37. package/dist/dns/v1/generated/validators/error.zod.d.ts +13 -4
  38. package/dist/dns/v1/generated/validators/error.zod.js +6 -9
  39. package/dist/dns/v1/generated/validators/errorStatus.zod.d.ts +66 -0
  40. package/dist/dns/v1/generated/validators/errorStatus.zod.js +81 -0
  41. package/dist/dns/v1/generated/validators/fieldViolation.zod.d.ts +57 -0
  42. package/dist/dns/v1/generated/validators/fieldViolation.zod.js +60 -0
  43. package/dist/iam/v1/generated/models.d.ts +52 -10
  44. package/dist/iam/v1/generated/validators/error.zod.d.ts +13 -4
  45. package/dist/iam/v1/generated/validators/error.zod.js +6 -9
  46. package/dist/iam/v1/generated/validators/errorStatus.zod.d.ts +30 -0
  47. package/dist/iam/v1/generated/validators/errorStatus.zod.js +45 -0
  48. package/dist/iam/v1/generated/validators/fieldViolation.zod.d.ts +21 -0
  49. package/dist/iam/v1/generated/validators/fieldViolation.zod.js +24 -0
  50. package/dist/membership/v1/generated/models.d.ts +52 -10
  51. package/dist/membership/v1/generated/validators/error.zod.d.ts +13 -4
  52. package/dist/membership/v1/generated/validators/error.zod.js +6 -9
  53. package/dist/membership/v1/generated/validators/errorStatus.zod.d.ts +23 -0
  54. package/dist/membership/v1/generated/validators/errorStatus.zod.js +38 -0
  55. package/dist/membership/v1/generated/validators/fieldViolation.zod.d.ts +14 -0
  56. package/dist/membership/v1/generated/validators/fieldViolation.zod.js +17 -0
  57. package/dist/monitoring/v1/generated/models.d.ts +52 -10
  58. package/dist/monitoring/v1/generated/validators/error.zod.d.ts +13 -4
  59. package/dist/monitoring/v1/generated/validators/error.zod.js +6 -9
  60. package/dist/monitoring/v1/generated/validators/errorStatus.zod.d.ts +36 -0
  61. package/dist/monitoring/v1/generated/validators/errorStatus.zod.js +51 -0
  62. package/dist/monitoring/v1/generated/validators/fieldViolation.zod.d.ts +27 -0
  63. package/dist/monitoring/v1/generated/validators/fieldViolation.zod.js +30 -0
  64. package/dist/notification/v1/generated/models.d.ts +52 -10
  65. package/dist/notification/v1/generated/validators/error.zod.d.ts +13 -4
  66. package/dist/notification/v1/generated/validators/error.zod.js +6 -9
  67. package/dist/notification/v1/generated/validators/errorStatus.zod.d.ts +77 -0
  68. package/dist/notification/v1/generated/validators/errorStatus.zod.js +92 -0
  69. package/dist/notification/v1/generated/validators/fieldViolation.zod.d.ts +68 -0
  70. package/dist/notification/v1/generated/validators/fieldViolation.zod.js +71 -0
  71. package/dist/support/v1/generated/models.d.ts +52 -10
  72. package/dist/support/v1/generated/validators/error.zod.d.ts +13 -4
  73. package/dist/support/v1/generated/validators/error.zod.js +6 -9
  74. package/dist/support/v1/generated/validators/errorStatus.zod.d.ts +66 -0
  75. package/dist/support/v1/generated/validators/errorStatus.zod.js +81 -0
  76. package/dist/support/v1/generated/validators/fieldViolation.zod.d.ts +57 -0
  77. package/dist/support/v1/generated/validators/fieldViolation.zod.js +60 -0
  78. package/dist/swas/v1/generated/models.d.ts +52 -10
  79. package/dist/swas/v1/generated/validators/error.zod.d.ts +13 -4
  80. package/dist/swas/v1/generated/validators/error.zod.js +6 -9
  81. package/dist/swas/v1/generated/validators/errorStatus.zod.d.ts +23 -0
  82. package/dist/swas/v1/generated/validators/errorStatus.zod.js +38 -0
  83. package/dist/swas/v1/generated/validators/fieldViolation.zod.d.ts +14 -0
  84. package/dist/swas/v1/generated/validators/fieldViolation.zod.js +17 -0
  85. package/dist/type/error/v1/generated/models.d.ts +52 -10
  86. package/dist/type/error/v1/generated/validators/error.zod.d.ts +13 -4
  87. package/dist/type/error/v1/generated/validators/error.zod.js +6 -9
  88. package/dist/type/error/v1/generated/validators/errorStatus.zod.d.ts +24 -0
  89. package/dist/type/error/v1/generated/validators/errorStatus.zod.js +39 -0
  90. package/dist/type/error/v1/generated/validators/fieldViolation.zod.d.ts +15 -0
  91. package/dist/type/error/v1/generated/validators/fieldViolation.zod.js +18 -0
  92. package/package.json +1 -1
@@ -7,10 +7,19 @@
7
7
  */
8
8
  import * as zod from "zod";
9
9
  export declare const Error: zod.ZodObject<{
10
- code: zod.ZodOptional<zod.ZodString>;
11
- message: zod.ZodString;
12
- meta: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
13
- status: zod.ZodInt;
10
+ error: zod.ZodObject<{
11
+ code: zod.ZodInt;
12
+ status: zod.ZodString;
13
+ message: zod.ZodString;
14
+ reason: zod.ZodOptional<zod.ZodString>;
15
+ metadata: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodString>>;
16
+ field_violations: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
17
+ field: zod.ZodString;
18
+ reason: zod.ZodOptional<zod.ZodString>;
19
+ }, zod.z.core.$strict>>>;
20
+ retry_delay: zod.ZodOptional<zod.ZodString>;
21
+ request_id: zod.ZodOptional<zod.ZodString>;
22
+ }, zod.z.core.$strict>;
14
23
  }, zod.z.core.$strict>;
15
24
  export type Error = zod.input<typeof Error>;
16
25
  export type ErrorOutput = zod.output<typeof Error>;
@@ -6,12 +6,9 @@
6
6
  * OpenAPI spec version: v1
7
7
  */
8
8
  import * as zod from "zod";
9
- export const Error = zod.strictObject({
10
- code: zod.string().optional(),
11
- message: zod.string(),
12
- meta: zod
13
- .record(zod.string(), zod.unknown())
14
- .optional()
15
- .describe("What a given `code` carries alongside the message. The keys depend on the code,\nand a client that does not recognise one ignores it."),
16
- status: zod.int(),
17
- });
9
+ import { ErrorStatus } from "./errorStatus.zod.js";
10
+ export const Error = zod
11
+ .strictObject({
12
+ error: ErrorStatus,
13
+ })
14
+ .describe("A failed request. The envelope follows the Google REST error format: `code` is the HTTP\nstatus, `status` is its canonical name, and `reason` is the stable machine-readable code\nthat identifies the failure.");
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Operations on a billing account require an account access token. The account, its balance, payment options and quotes are also readable by members of the projects it currently pays for; changing the account and moving its funds need the owner. Members of a project, as each operation states, can also read the project's billing account, subscriptions and orders, complete and pay for its purchases, quote purchases, changes and renewals, preview cancellations, and, with the project permission `billing:finance.manage` granted in IAM, renew, cancel and turn automatic renewal of its subscriptions on or off, change its billing account and read its costs. A member without the permission an operation needs is refused with 403 `PERMISSION_DENIED` and `meta.permission`; a caller who is not a member, with 403 `IAM_NOT_PROJECT_MEMBER`. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const ErrorStatus: zod.ZodObject<{
10
+ code: zod.ZodInt;
11
+ status: zod.ZodString;
12
+ message: zod.ZodString;
13
+ reason: zod.ZodOptional<zod.ZodString>;
14
+ metadata: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodString>>;
15
+ field_violations: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
16
+ field: zod.ZodString;
17
+ reason: zod.ZodOptional<zod.ZodString>;
18
+ }, zod.z.core.$strict>>>;
19
+ retry_delay: zod.ZodOptional<zod.ZodString>;
20
+ request_id: zod.ZodOptional<zod.ZodString>;
21
+ }, zod.z.core.$strict>;
22
+ export type ErrorStatus = zod.input<typeof ErrorStatus>;
23
+ export type ErrorStatusOutput = zod.output<typeof ErrorStatus>;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Operations on a billing account require an account access token. The account, its balance, payment options and quotes are also readable by members of the projects it currently pays for; changing the account and moving its funds need the owner. Members of a project, as each operation states, can also read the project's billing account, subscriptions and orders, complete and pay for its purchases, quote purchases, changes and renewals, preview cancellations, and, with the project permission `billing:finance.manage` granted in IAM, renew, cancel and turn automatic renewal of its subscriptions on or off, change its billing account and read its costs. A member without the permission an operation needs is refused with 403 `PERMISSION_DENIED` and `meta.permission`; a caller who is not a member, with 403 `IAM_NOT_PROJECT_MEMBER`. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ import { FieldViolation } from "./fieldViolation.zod.js";
10
+ export const ErrorStatus = zod.strictObject({
11
+ code: zod.int().describe("The HTTP status code of the response."),
12
+ status: zod
13
+ .string()
14
+ .describe("The canonical name of the status, such as `INVALID_ARGUMENT` or `UNAVAILABLE`."),
15
+ message: zod
16
+ .string()
17
+ .describe("A description of the failure for developers. It is always English and is not meant\nto be shown to end users as is."),
18
+ reason: zod
19
+ .string()
20
+ .optional()
21
+ .describe("A stable machine-readable code identifying the failure. Clients branch on this value\nand render their own text; it does not change once published."),
22
+ metadata: zod
23
+ .record(zod.string(), zod.string())
24
+ .optional()
25
+ .describe("Values that belong to `reason`, one set per reason. Clients use them to fill in\nlocalized text and never parse `message` to obtain them. Keys are documented per\nreason; a key that has appeared once keeps appearing."),
26
+ field_violations: zod
27
+ .array(FieldViolation)
28
+ .optional()
29
+ .describe("Request fields rejected by the request's constraints. Present on validation\nfailures; one request may violate several fields."),
30
+ retry_delay: zod
31
+ .string()
32
+ .optional()
33
+ .describe("How long the client should wait before retrying, as a duration string such as\n`30s`. Present only when waiting can succeed."),
34
+ request_id: zod
35
+ .string()
36
+ .optional()
37
+ .describe("The identifier of the request in the service's logs. Quote it when reporting a\nfailure."),
38
+ });
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Operations on a billing account require an account access token. The account, its balance, payment options and quotes are also readable by members of the projects it currently pays for; changing the account and moving its funds need the owner. Members of a project, as each operation states, can also read the project's billing account, subscriptions and orders, complete and pay for its purchases, quote purchases, changes and renewals, preview cancellations, and, with the project permission `billing:finance.manage` granted in IAM, renew, cancel and turn automatic renewal of its subscriptions on or off, change its billing account and read its costs. A member without the permission an operation needs is refused with 403 `PERMISSION_DENIED` and `meta.permission`; a caller who is not a member, with 403 `IAM_NOT_PROJECT_MEMBER`. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const FieldViolation: zod.ZodObject<{
10
+ field: zod.ZodString;
11
+ reason: zod.ZodOptional<zod.ZodString>;
12
+ }, zod.z.core.$strict>;
13
+ export type FieldViolation = zod.input<typeof FieldViolation>;
14
+ export type FieldViolationOutput = zod.output<typeof FieldViolation>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Billing API
5
+ * Products, prices, orders, subscriptions and account billing. Operations on a billing account require an account access token. The account, its balance, payment options and quotes are also readable by members of the projects it currently pays for; changing the account and moving its funds need the owner. Members of a project, as each operation states, can also read the project's billing account, subscriptions and orders, complete and pay for its purchases, quote purchases, changes and renewals, preview cancellations, and, with the project permission `billing:finance.manage` granted in IAM, renew, cancel and turn automatic renewal of its subscriptions on or off, change its billing account and read its costs. A member without the permission an operation needs is refused with 403 `PERMISSION_DENIED` and `meta.permission`; a caller who is not a member, with 403 `IAM_NOT_PROJECT_MEMBER`. Public catalogue operations declare no security requirement.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export const FieldViolation = zod.strictObject({
10
+ field: zod
11
+ .string()
12
+ .describe("The path to the rejected field in the request body, such as `items[2].price_id`."),
13
+ reason: zod
14
+ .string()
15
+ .optional()
16
+ .describe("Why the field was rejected, such as `REQUIRED` or `OUT_OF_RANGE`."),
17
+ });
@@ -184,22 +184,64 @@ export type InferenceErrorError = {
184
184
  export interface InferenceError {
185
185
  error: InferenceErrorError;
186
186
  }
187
+ export interface FieldViolation {
188
+ /** The path to the rejected field in the request body, such as `items[2].price_id`. */
189
+ field: string;
190
+ /** Why the field was rejected, such as `REQUIRED` or `OUT_OF_RANGE`. */
191
+ reason?: string;
192
+ }
187
193
  /**
188
- * What a given `code` carries alongside the message. The keys depend on the code,
189
- * and a client that does not recognise one ignores it.
194
+ * Values that belong to `reason`, one set per reason. Clients use them to fill in
195
+ * localized text and never parse `message` to obtain them. Keys are documented per
196
+ * reason; a key that has appeared once keeps appearing.
190
197
  */
191
- export type ErrorMeta = {
192
- [key: string]: unknown;
198
+ export type ErrorStatusMetadata = {
199
+ [key: string]: string;
193
200
  };
194
- export interface Error {
195
- code?: string;
201
+ export interface ErrorStatus {
202
+ /** The HTTP status code of the response. */
203
+ code: number;
204
+ /** The canonical name of the status, such as `INVALID_ARGUMENT` or `UNAVAILABLE`. */
205
+ status: string;
206
+ /**
207
+ * A description of the failure for developers. It is always English and is not meant
208
+ * to be shown to end users as is.
209
+ */
196
210
  message: string;
197
211
  /**
198
- * What a given `code` carries alongside the message. The keys depend on the code,
199
- * and a client that does not recognise one ignores it.
212
+ * A stable machine-readable code identifying the failure. Clients branch on this value
213
+ * and render their own text; it does not change once published.
214
+ */
215
+ reason?: string;
216
+ /**
217
+ * Values that belong to `reason`, one set per reason. Clients use them to fill in
218
+ * localized text and never parse `message` to obtain them. Keys are documented per
219
+ * reason; a key that has appeared once keeps appearing.
220
+ */
221
+ metadata?: ErrorStatusMetadata;
222
+ /**
223
+ * Request fields rejected by the request's constraints. Present on validation
224
+ * failures; one request may violate several fields.
225
+ */
226
+ field_violations?: FieldViolation[];
227
+ /**
228
+ * How long the client should wait before retrying, as a duration string such as
229
+ * `30s`. Present only when waiting can succeed.
230
+ */
231
+ retry_delay?: string;
232
+ /**
233
+ * The identifier of the request in the service's logs. Quote it when reporting a
234
+ * failure.
200
235
  */
201
- meta?: ErrorMeta;
202
- status: number;
236
+ request_id?: string;
237
+ }
238
+ /**
239
+ * A failed request. The envelope follows the Google REST error format: `code` is the HTTP
240
+ * status, `status` is its canonical name, and `reason` is the stable machine-readable code
241
+ * that identifies the failure.
242
+ */
243
+ export interface Error {
244
+ error: ErrorStatus;
203
245
  }
204
246
  export type APIKeyResourceStatus = (typeof APIKeyResourceStatus)[keyof typeof APIKeyResourceStatus];
205
247
  export declare const APIKeyResourceStatus: {
@@ -40,10 +40,19 @@
40
40
  */
41
41
  import * as zod from "zod";
42
42
  export declare const Error: zod.ZodObject<{
43
- code: zod.ZodOptional<zod.ZodString>;
44
- message: zod.ZodString;
45
- meta: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
46
- status: zod.ZodInt;
43
+ error: zod.ZodObject<{
44
+ code: zod.ZodInt;
45
+ status: zod.ZodString;
46
+ message: zod.ZodString;
47
+ reason: zod.ZodOptional<zod.ZodString>;
48
+ metadata: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodString>>;
49
+ field_violations: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
50
+ field: zod.ZodString;
51
+ reason: zod.ZodOptional<zod.ZodString>;
52
+ }, zod.z.core.$strict>>>;
53
+ retry_delay: zod.ZodOptional<zod.ZodString>;
54
+ request_id: zod.ZodOptional<zod.ZodString>;
55
+ }, zod.z.core.$strict>;
47
56
  }, zod.z.core.$strict>;
48
57
  export type Error = zod.input<typeof Error>;
49
58
  export type ErrorOutput = zod.output<typeof Error>;
@@ -39,12 +39,9 @@
39
39
  * OpenAPI spec version: 1.0.0
40
40
  */
41
41
  import * as zod from "zod";
42
- export const Error = zod.strictObject({
43
- code: zod.string().optional(),
44
- message: zod.string(),
45
- meta: zod
46
- .record(zod.string(), zod.unknown())
47
- .optional()
48
- .describe("What a given `code` carries alongside the message. The keys depend on the code,\nand a client that does not recognise one ignores it."),
49
- status: zod.int(),
50
- });
42
+ import { ErrorStatus } from "./errorStatus.zod.js";
43
+ export const Error = zod
44
+ .strictObject({
45
+ error: ErrorStatus,
46
+ })
47
+ .describe("A failed request. The envelope follows the Google REST error format: `code` is the HTTP\nstatus, `status` is its canonical name, and `reason` is the stable machine-readable code\nthat identifies the failure.");
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Canopy model inference, API keys, model catalogue, service enablement and recorded usage.
6
+ *
7
+ * Project inference is served on this host in each provider's own protocol:
8
+ *
9
+ * - OpenAI: `/v1/chat/completions`, `/v1/responses` and `/v1/embeddings`; use
10
+ * `https://canopy.leaflow.cloud/v1` as the OpenAI SDK base URL.
11
+ * - Anthropic: `/v1/messages`; use `https://canopy.leaflow.cloud` as the Anthropic SDK base URL.
12
+ * - Gemini: `/v1beta/models/{model}:generateContent` and `:streamGenerateContent`.
13
+ *
14
+ * Canopy does not convert between protocols. A request is accepted only for a model whose
15
+ * `supported_endpoints` lists the endpoint it was sent to, and it is forwarded unchanged except for
16
+ * the model name and the credentials. Reasoning settings such as `reasoning_effort` are passed
17
+ * through as written; a model's `capabilities` lists the values its upstream accepts.
18
+ *
19
+ * Management operations use `/api/v1`. The management model catalogue names how each model is billed in Billing;
20
+ * `/v1/models` returns the OpenAI model format with Canopy capabilities and parameter limits.
21
+ *
22
+ * ## Authentication
23
+ *
24
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
25
+ *
26
+ * Management and project inference accept the same verified IAM scoped token. The token is the
27
+ * sole billing project authority; `OpenAI-Project` and historical identity headers cannot
28
+ * override it. These endpoints do not accept a Canopy API key. The separate API-key gateway
29
+ * accepts Canopy API keys and serves the same endpoints.
30
+ *
31
+ * ## Conventions
32
+ *
33
+ * - **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.
34
+ * - **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.
35
+ * - **A usage query must carry a time range**, spanning no more than 31 days, or 400 days for the usage timeline. `from` and `to` carry a timezone offset, which the server does not infer.
36
+ * - **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.
37
+ * - **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.
38
+ * - **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 Billing holds for each model's `billing`.
39
+ * OpenAPI spec version: 1.0.0
40
+ */
41
+ import * as zod from "zod";
42
+ export declare const ErrorStatus: zod.ZodObject<{
43
+ code: zod.ZodInt;
44
+ status: zod.ZodString;
45
+ message: zod.ZodString;
46
+ reason: zod.ZodOptional<zod.ZodString>;
47
+ metadata: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodString>>;
48
+ field_violations: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
49
+ field: zod.ZodString;
50
+ reason: zod.ZodOptional<zod.ZodString>;
51
+ }, zod.z.core.$strict>>>;
52
+ retry_delay: zod.ZodOptional<zod.ZodString>;
53
+ request_id: zod.ZodOptional<zod.ZodString>;
54
+ }, zod.z.core.$strict>;
55
+ export type ErrorStatus = zod.input<typeof ErrorStatus>;
56
+ export type ErrorStatusOutput = zod.output<typeof ErrorStatus>;
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Canopy model inference, API keys, model catalogue, service enablement and recorded usage.
6
+ *
7
+ * Project inference is served on this host in each provider's own protocol:
8
+ *
9
+ * - OpenAI: `/v1/chat/completions`, `/v1/responses` and `/v1/embeddings`; use
10
+ * `https://canopy.leaflow.cloud/v1` as the OpenAI SDK base URL.
11
+ * - Anthropic: `/v1/messages`; use `https://canopy.leaflow.cloud` as the Anthropic SDK base URL.
12
+ * - Gemini: `/v1beta/models/{model}:generateContent` and `:streamGenerateContent`.
13
+ *
14
+ * Canopy does not convert between protocols. A request is accepted only for a model whose
15
+ * `supported_endpoints` lists the endpoint it was sent to, and it is forwarded unchanged except for
16
+ * the model name and the credentials. Reasoning settings such as `reasoning_effort` are passed
17
+ * through as written; a model's `capabilities` lists the values its upstream accepts.
18
+ *
19
+ * Management operations use `/api/v1`. The management model catalogue names how each model is billed in Billing;
20
+ * `/v1/models` returns the OpenAI model format with Canopy capabilities and parameter limits.
21
+ *
22
+ * ## Authentication
23
+ *
24
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
25
+ *
26
+ * Management and project inference accept the same verified IAM scoped token. The token is the
27
+ * sole billing project authority; `OpenAI-Project` and historical identity headers cannot
28
+ * override it. These endpoints do not accept a Canopy API key. The separate API-key gateway
29
+ * accepts Canopy API keys and serves the same endpoints.
30
+ *
31
+ * ## Conventions
32
+ *
33
+ * - **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.
34
+ * - **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.
35
+ * - **A usage query must carry a time range**, spanning no more than 31 days, or 400 days for the usage timeline. `from` and `to` carry a timezone offset, which the server does not infer.
36
+ * - **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.
37
+ * - **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.
38
+ * - **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 Billing holds for each model's `billing`.
39
+ * OpenAPI spec version: 1.0.0
40
+ */
41
+ import * as zod from "zod";
42
+ import { FieldViolation } from "./fieldViolation.zod.js";
43
+ export const ErrorStatus = zod.strictObject({
44
+ code: zod.int().describe("The HTTP status code of the response."),
45
+ status: zod
46
+ .string()
47
+ .describe("The canonical name of the status, such as `INVALID_ARGUMENT` or `UNAVAILABLE`."),
48
+ message: zod
49
+ .string()
50
+ .describe("A description of the failure for developers. It is always English and is not meant\nto be shown to end users as is."),
51
+ reason: zod
52
+ .string()
53
+ .optional()
54
+ .describe("A stable machine-readable code identifying the failure. Clients branch on this value\nand render their own text; it does not change once published."),
55
+ metadata: zod
56
+ .record(zod.string(), zod.string())
57
+ .optional()
58
+ .describe("Values that belong to `reason`, one set per reason. Clients use them to fill in\nlocalized text and never parse `message` to obtain them. Keys are documented per\nreason; a key that has appeared once keeps appearing."),
59
+ field_violations: zod
60
+ .array(FieldViolation)
61
+ .optional()
62
+ .describe("Request fields rejected by the request's constraints. Present on validation\nfailures; one request may violate several fields."),
63
+ retry_delay: zod
64
+ .string()
65
+ .optional()
66
+ .describe("How long the client should wait before retrying, as a duration string such as\n`30s`. Present only when waiting can succeed."),
67
+ request_id: zod
68
+ .string()
69
+ .optional()
70
+ .describe("The identifier of the request in the service's logs. Quote it when reporting a\nfailure."),
71
+ });
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Canopy model inference, API keys, model catalogue, service enablement and recorded usage.
6
+ *
7
+ * Project inference is served on this host in each provider's own protocol:
8
+ *
9
+ * - OpenAI: `/v1/chat/completions`, `/v1/responses` and `/v1/embeddings`; use
10
+ * `https://canopy.leaflow.cloud/v1` as the OpenAI SDK base URL.
11
+ * - Anthropic: `/v1/messages`; use `https://canopy.leaflow.cloud` as the Anthropic SDK base URL.
12
+ * - Gemini: `/v1beta/models/{model}:generateContent` and `:streamGenerateContent`.
13
+ *
14
+ * Canopy does not convert between protocols. A request is accepted only for a model whose
15
+ * `supported_endpoints` lists the endpoint it was sent to, and it is forwarded unchanged except for
16
+ * the model name and the credentials. Reasoning settings such as `reasoning_effort` are passed
17
+ * through as written; a model's `capabilities` lists the values its upstream accepts.
18
+ *
19
+ * Management operations use `/api/v1`. The management model catalogue names how each model is billed in Billing;
20
+ * `/v1/models` returns the OpenAI model format with Canopy capabilities and parameter limits.
21
+ *
22
+ * ## Authentication
23
+ *
24
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
25
+ *
26
+ * Management and project inference accept the same verified IAM scoped token. The token is the
27
+ * sole billing project authority; `OpenAI-Project` and historical identity headers cannot
28
+ * override it. These endpoints do not accept a Canopy API key. The separate API-key gateway
29
+ * accepts Canopy API keys and serves the same endpoints.
30
+ *
31
+ * ## Conventions
32
+ *
33
+ * - **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.
34
+ * - **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.
35
+ * - **A usage query must carry a time range**, spanning no more than 31 days, or 400 days for the usage timeline. `from` and `to` carry a timezone offset, which the server does not infer.
36
+ * - **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.
37
+ * - **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.
38
+ * - **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 Billing holds for each model's `billing`.
39
+ * OpenAPI spec version: 1.0.0
40
+ */
41
+ import * as zod from "zod";
42
+ export declare const FieldViolation: zod.ZodObject<{
43
+ field: zod.ZodString;
44
+ reason: zod.ZodOptional<zod.ZodString>;
45
+ }, zod.z.core.$strict>;
46
+ export type FieldViolation = zod.input<typeof FieldViolation>;
47
+ export type FieldViolationOutput = zod.output<typeof FieldViolation>;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Canopy model inference, API keys, model catalogue, service enablement and recorded usage.
6
+ *
7
+ * Project inference is served on this host in each provider's own protocol:
8
+ *
9
+ * - OpenAI: `/v1/chat/completions`, `/v1/responses` and `/v1/embeddings`; use
10
+ * `https://canopy.leaflow.cloud/v1` as the OpenAI SDK base URL.
11
+ * - Anthropic: `/v1/messages`; use `https://canopy.leaflow.cloud` as the Anthropic SDK base URL.
12
+ * - Gemini: `/v1beta/models/{model}:generateContent` and `:streamGenerateContent`.
13
+ *
14
+ * Canopy does not convert between protocols. A request is accepted only for a model whose
15
+ * `supported_endpoints` lists the endpoint it was sent to, and it is forwarded unchanged except for
16
+ * the model name and the credentials. Reasoning settings such as `reasoning_effort` are passed
17
+ * through as written; a model's `capabilities` lists the values its upstream accepts.
18
+ *
19
+ * Management operations use `/api/v1`. The management model catalogue names how each model is billed in Billing;
20
+ * `/v1/models` returns the OpenAI model format with Canopy capabilities and parameter limits.
21
+ *
22
+ * ## Authentication
23
+ *
24
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
25
+ *
26
+ * Management and project inference accept the same verified IAM scoped token. The token is the
27
+ * sole billing project authority; `OpenAI-Project` and historical identity headers cannot
28
+ * override it. These endpoints do not accept a Canopy API key. The separate API-key gateway
29
+ * accepts Canopy API keys and serves the same endpoints.
30
+ *
31
+ * ## Conventions
32
+ *
33
+ * - **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.
34
+ * - **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.
35
+ * - **A usage query must carry a time range**, spanning no more than 31 days, or 400 days for the usage timeline. `from` and `to` carry a timezone offset, which the server does not infer.
36
+ * - **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.
37
+ * - **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.
38
+ * - **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 Billing holds for each model's `billing`.
39
+ * OpenAPI spec version: 1.0.0
40
+ */
41
+ import * as zod from "zod";
42
+ export const FieldViolation = zod.strictObject({
43
+ field: zod
44
+ .string()
45
+ .describe("The path to the rejected field in the request body, such as `items[2].price_id`."),
46
+ reason: zod
47
+ .string()
48
+ .optional()
49
+ .describe("Why the field was rejected, such as `REQUIRED` or `OUT_OF_RANGE`."),
50
+ });
@@ -2994,22 +2994,64 @@ export interface CursorPagination {
2994
2994
  /** @nullable */
2995
2995
  next_cursor?: string | null;
2996
2996
  }
2997
+ export interface FieldViolation {
2998
+ /** The path to the rejected field in the request body, such as `items[2].price_id`. */
2999
+ field: string;
3000
+ /** Why the field was rejected, such as `REQUIRED` or `OUT_OF_RANGE`. */
3001
+ reason?: string;
3002
+ }
2997
3003
  /**
2998
- * What a given `code` carries alongside the message. The keys depend on the code,
2999
- * and a client that does not recognise one ignores it.
3004
+ * Values that belong to `reason`, one set per reason. Clients use them to fill in
3005
+ * localized text and never parse `message` to obtain them. Keys are documented per
3006
+ * reason; a key that has appeared once keeps appearing.
3000
3007
  */
3001
- export type ErrorMeta = {
3002
- [key: string]: unknown;
3008
+ export type ErrorStatusMetadata = {
3009
+ [key: string]: string;
3003
3010
  };
3004
- export interface Error {
3005
- code?: string;
3011
+ export interface ErrorStatus {
3012
+ /** The HTTP status code of the response. */
3013
+ code: number;
3014
+ /** The canonical name of the status, such as `INVALID_ARGUMENT` or `UNAVAILABLE`. */
3015
+ status: string;
3016
+ /**
3017
+ * A description of the failure for developers. It is always English and is not meant
3018
+ * to be shown to end users as is.
3019
+ */
3006
3020
  message: string;
3007
3021
  /**
3008
- * What a given `code` carries alongside the message. The keys depend on the code,
3009
- * and a client that does not recognise one ignores it.
3022
+ * A stable machine-readable code identifying the failure. Clients branch on this value
3023
+ * and render their own text; it does not change once published.
3024
+ */
3025
+ reason?: string;
3026
+ /**
3027
+ * Values that belong to `reason`, one set per reason. Clients use them to fill in
3028
+ * localized text and never parse `message` to obtain them. Keys are documented per
3029
+ * reason; a key that has appeared once keeps appearing.
3030
+ */
3031
+ metadata?: ErrorStatusMetadata;
3032
+ /**
3033
+ * Request fields rejected by the request's constraints. Present on validation
3034
+ * failures; one request may violate several fields.
3035
+ */
3036
+ field_violations?: FieldViolation[];
3037
+ /**
3038
+ * How long the client should wait before retrying, as a duration string such as
3039
+ * `30s`. Present only when waiting can succeed.
3040
+ */
3041
+ retry_delay?: string;
3042
+ /**
3043
+ * The identifier of the request in the service's logs. Quote it when reporting a
3044
+ * failure.
3010
3045
  */
3011
- meta?: ErrorMeta;
3012
- status: number;
3046
+ request_id?: string;
3047
+ }
3048
+ /**
3049
+ * A failed request. The envelope follows the Google REST error format: `code` is the HTTP
3050
+ * status, `status` is its canonical name, and `reason` is the stable machine-readable code
3051
+ * that identifies the failure.
3052
+ */
3053
+ export interface Error {
3054
+ error: ErrorStatus;
3013
3055
  }
3014
3056
  /**
3015
3057
  * The request conflicts with the current state of a resource or offering it involves. `COMPUTE_RESOURCE_BUSY`
@@ -34,10 +34,19 @@
34
34
  */
35
35
  import * as zod from "zod";
36
36
  export declare const Error: zod.ZodObject<{
37
- code: zod.ZodOptional<zod.ZodString>;
38
- message: zod.ZodString;
39
- meta: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
40
- status: zod.ZodInt;
37
+ error: zod.ZodObject<{
38
+ code: zod.ZodInt;
39
+ status: zod.ZodString;
40
+ message: zod.ZodString;
41
+ reason: zod.ZodOptional<zod.ZodString>;
42
+ metadata: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodString>>;
43
+ field_violations: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
44
+ field: zod.ZodString;
45
+ reason: zod.ZodOptional<zod.ZodString>;
46
+ }, zod.z.core.$strict>>>;
47
+ retry_delay: zod.ZodOptional<zod.ZodString>;
48
+ request_id: zod.ZodOptional<zod.ZodString>;
49
+ }, zod.z.core.$strict>;
41
50
  }, zod.z.core.$strict>;
42
51
  export type Error = zod.input<typeof Error>;
43
52
  export type ErrorOutput = zod.output<typeof Error>;
@@ -33,12 +33,9 @@
33
33
  * OpenAPI spec version: 2.0.0
34
34
  */
35
35
  import * as zod from "zod";
36
- export const Error = zod.strictObject({
37
- code: zod.string().optional(),
38
- message: zod.string(),
39
- meta: zod
40
- .record(zod.string(), zod.unknown())
41
- .optional()
42
- .describe("What a given `code` carries alongside the message. The keys depend on the code,\nand a client that does not recognise one ignores it."),
43
- status: zod.int(),
44
- });
36
+ import { ErrorStatus } from "./errorStatus.zod.js";
37
+ export const Error = zod
38
+ .strictObject({
39
+ error: ErrorStatus,
40
+ })
41
+ .describe("A failed request. The envelope follows the Google REST error format: `code` is the HTTP\nstatus, `status` is its canonical name, and `reason` is the stable machine-readable code\nthat identifies the failure.");