@leaflow/sdk 0.0.0-dev.429.gf6440ec → 0.0.0-dev.433.g7e48b8f

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 (88) hide show
  1. package/dist/canopy/v1/generated/models.d.ts +209 -9
  2. package/dist/canopy/v1/generated/models.js +27 -1
  3. package/dist/canopy/v1/generated/schemas.zod.d.ts +1 -1
  4. package/dist/canopy/v1/generated/schemas.zod.js +3 -1
  5. package/dist/canopy/v1/generated/validators/aPIKeyUsageListResponseBody.zod.d.ts +9 -0
  6. package/dist/canopy/v1/generated/validators/aPIKeyUsageResource.zod.d.ts +9 -0
  7. package/dist/canopy/v1/generated/validators/aPIKeyUsageResource.zod.js +5 -0
  8. package/dist/canopy/v1/generated/validators/audioCapabilities.zod.d.ts +51 -0
  9. package/dist/canopy/v1/generated/validators/audioCapabilities.zod.js +67 -0
  10. package/dist/canopy/v1/generated/validators/cursorPageRequestResource.zod.d.ts +10 -1
  11. package/dist/canopy/v1/generated/validators/endpointCapabilities.zod.d.ts +37 -0
  12. package/dist/canopy/v1/generated/validators/endpointCapabilities.zod.js +20 -0
  13. package/dist/canopy/v1/generated/validators/imageCapabilities.zod.d.ts +52 -0
  14. package/dist/canopy/v1/generated/validators/imageCapabilities.zod.js +69 -0
  15. package/dist/canopy/v1/generated/validators/mediaUsage.zod.d.ts +52 -0
  16. package/dist/canopy/v1/generated/validators/mediaUsage.zod.js +61 -0
  17. package/dist/canopy/v1/generated/validators/model.zod.d.ts +50 -0
  18. package/dist/canopy/v1/generated/validators/modelBilling.zod.d.ts +8 -1
  19. package/dist/canopy/v1/generated/validators/modelBilling.zod.js +2 -2
  20. package/dist/canopy/v1/generated/validators/modelCapabilities.zod.d.ts +37 -0
  21. package/dist/canopy/v1/generated/validators/modelEndpoint.zod.d.ts +13 -0
  22. package/dist/canopy/v1/generated/validators/modelEndpoint.zod.js +13 -0
  23. package/dist/canopy/v1/generated/validators/modelList.zod.d.ts +50 -0
  24. package/dist/canopy/v1/generated/validators/modelListResponseBody.zod.d.ts +58 -1
  25. package/dist/canopy/v1/generated/validators/modelMeter.zod.d.ts +8 -1
  26. package/dist/canopy/v1/generated/validators/modelMeter.zod.js +21 -2
  27. package/dist/canopy/v1/generated/validators/modelParameter.zod.d.ts +58 -0
  28. package/dist/canopy/v1/generated/validators/modelParameter.zod.js +57 -0
  29. package/dist/canopy/v1/generated/validators/modelResource.zod.d.ts +58 -1
  30. package/dist/canopy/v1/generated/validators/modelUsageListResponseBody.zod.d.ts +9 -0
  31. package/dist/canopy/v1/generated/validators/modelUsageResource.zod.d.ts +9 -0
  32. package/dist/canopy/v1/generated/validators/modelUsageResource.zod.js +5 -0
  33. package/dist/canopy/v1/generated/validators/requestResource.zod.d.ts +10 -1
  34. package/dist/canopy/v1/generated/validators/requestResource.zod.js +8 -1
  35. package/dist/canopy/v1/generated/validators/totalsResource.zod.d.ts +9 -0
  36. package/dist/canopy/v1/generated/validators/totalsResource.zod.js +5 -0
  37. package/dist/canopy/v1/generated/validators/usageBucketResource.zod.d.ts +9 -0
  38. package/dist/canopy/v1/generated/validators/usageBucketResource.zod.js +5 -0
  39. package/dist/canopy/v1/generated/validators/usageTimelineResponseBody.zod.d.ts +9 -0
  40. package/dist/canopy/v1/generated/validators/videoCapabilities.zod.d.ts +51 -0
  41. package/dist/canopy/v1/generated/validators/videoCapabilities.zod.js +69 -0
  42. package/dist/eventbus/v1/generated/functions.d.ts +336 -0
  43. package/dist/eventbus/v1/generated/functions.js +214 -0
  44. package/dist/eventbus/v1/generated/models.d.ts +364 -0
  45. package/dist/eventbus/v1/generated/models.js +8 -0
  46. package/dist/eventbus/v1/generated/schemas.zod.d.ts +138 -0
  47. package/dist/eventbus/v1/generated/schemas.zod.js +163 -0
  48. package/dist/eventbus/v1/generated/validators/createEventRequest.zod.d.ts +50 -0
  49. package/dist/eventbus/v1/generated/validators/createEventRequest.zod.js +59 -0
  50. package/dist/eventbus/v1/generated/validators/createVersionRequest.zod.d.ts +46 -0
  51. package/dist/eventbus/v1/generated/validators/createVersionRequest.zod.js +47 -0
  52. package/dist/eventbus/v1/generated/validators/cursorPagination.zod.d.ts +45 -0
  53. package/dist/eventbus/v1/generated/validators/cursorPagination.zod.js +45 -0
  54. package/dist/eventbus/v1/generated/validators/error.zod.d.ts +56 -0
  55. package/dist/eventbus/v1/generated/validators/error.zod.js +45 -0
  56. package/dist/eventbus/v1/generated/validators/errorStatus.zod.d.ts +54 -0
  57. package/dist/eventbus/v1/generated/validators/errorStatus.zod.js +69 -0
  58. package/dist/eventbus/v1/generated/validators/eventDetail.zod.d.ts +65 -0
  59. package/dist/eventbus/v1/generated/validators/eventDetail.zod.js +62 -0
  60. package/dist/eventbus/v1/generated/validators/eventList.zod.d.ts +58 -0
  61. package/dist/eventbus/v1/generated/validators/eventList.zod.js +50 -0
  62. package/dist/eventbus/v1/generated/validators/eventResource.zod.d.ts +55 -0
  63. package/dist/eventbus/v1/generated/validators/eventResource.zod.js +60 -0
  64. package/dist/eventbus/v1/generated/validators/eventStatus.zod.d.ts +45 -0
  65. package/dist/eventbus/v1/generated/validators/eventStatus.zod.js +42 -0
  66. package/dist/eventbus/v1/generated/validators/eventVersion.zod.d.ts +51 -0
  67. package/dist/eventbus/v1/generated/validators/eventVersion.zod.js +53 -0
  68. package/dist/eventbus/v1/generated/validators/fieldViolation.zod.d.ts +45 -0
  69. package/dist/eventbus/v1/generated/validators/fieldViolation.zod.js +48 -0
  70. package/dist/eventbus/v1/generated/validators/listEventsParams.zod.d.ts +55 -0
  71. package/dist/eventbus/v1/generated/validators/listEventsParams.zod.js +57 -0
  72. package/dist/eventbus/v1/generated/validators/offsetPagination.zod.d.ts +47 -0
  73. package/dist/eventbus/v1/generated/validators/offsetPagination.zod.js +47 -0
  74. package/dist/eventbus/v1/generated/validators/publishRequest.zod.d.ts +49 -0
  75. package/dist/eventbus/v1/generated/validators/publishRequest.zod.js +55 -0
  76. package/dist/eventbus/v1/generated/validators/publishResponse.zod.d.ts +47 -0
  77. package/dist/eventbus/v1/generated/validators/publishResponse.zod.js +47 -0
  78. package/dist/eventbus/v1/generated/validators/realtimeTicket.zod.d.ts +46 -0
  79. package/dist/eventbus/v1/generated/validators/realtimeTicket.zod.js +46 -0
  80. package/dist/eventbus/v1/generated/validators/updateEventRequest.zod.d.ts +51 -0
  81. package/dist/eventbus/v1/generated/validators/updateEventRequest.zod.js +54 -0
  82. package/dist/eventbus/v1/index.d.ts +3 -0
  83. package/dist/eventbus/v1/index.js +3 -0
  84. package/dist/index.d.ts +1 -0
  85. package/dist/index.js +1 -0
  86. package/dist/routes.d.ts +64 -0
  87. package/dist/routes.js +72 -0
  88. package/package.json +1 -1
@@ -116,12 +116,147 @@ export interface ReasoningCapabilities {
116
116
  /** @nullable */
117
117
  summary: string[] | null;
118
118
  }
119
+ /**
120
+ * The image parameters this endpoint accepts. The client chooses among them; a value outside the list is rejected before the upstream is called.
121
+ */
122
+ export interface ImageCapabilities {
123
+ /**
124
+ * Size values the upstream accepts, such as 1024x1024 or auto. Null means unknown.
125
+ * @nullable
126
+ */
127
+ sizes: string[] | null;
128
+ /**
129
+ * Quality values the upstream accepts. Null means unknown.
130
+ * @nullable
131
+ */
132
+ qualities: string[] | null;
133
+ /**
134
+ * Response formats the upstream accepts. Null means unknown.
135
+ * @nullable
136
+ */
137
+ response_formats: string[] | null;
138
+ /**
139
+ * The largest number of images one request may ask for. Null means unknown.
140
+ * @minimum 0
141
+ * @maximum 128
142
+ * @nullable
143
+ */
144
+ max_n: number | null;
145
+ /**
146
+ * Whether the endpoint can stream partial images. Null means unknown.
147
+ * @nullable
148
+ */
149
+ supports_stream: boolean | null;
150
+ }
151
+ /**
152
+ * The audio parameters this endpoint accepts.
153
+ */
154
+ export interface AudioCapabilities {
155
+ /**
156
+ * Voices the speech endpoint accepts. Empty for transcription endpoints. Null means unknown.
157
+ * @nullable
158
+ */
159
+ voices: string[] | null;
160
+ /**
161
+ * Audio container or codec values the endpoint accepts. Null means unknown.
162
+ * @nullable
163
+ */
164
+ formats: string[] | null;
165
+ /**
166
+ * Response formats the transcription endpoint accepts, such as json or srt. Null means unknown.
167
+ * @nullable
168
+ */
169
+ response_formats: string[] | null;
170
+ /**
171
+ * The largest upload the endpoint accepts, in bytes. Null means unknown.
172
+ * @minimum 0
173
+ * @nullable
174
+ */
175
+ max_input_bytes: number | null;
176
+ /**
177
+ * Whether the endpoint can stream its response. Null means unknown.
178
+ * @nullable
179
+ */
180
+ supports_stream: boolean | null;
181
+ }
182
+ /**
183
+ * The video parameters this endpoint accepts. Video is asynchronous on every endpoint that supports it. Create returns a task, and the task is polled separately.
184
+ */
185
+ export interface VideoCapabilities {
186
+ /**
187
+ * Durations the upstream accepts, in seconds. Null means unknown.
188
+ * @nullable
189
+ * @items.minimum 1
190
+ */
191
+ seconds: number[] | null;
192
+ /**
193
+ * Output sizes the upstream accepts, such as 1280x720. Null means unknown.
194
+ * @nullable
195
+ */
196
+ sizes: string[] | null;
197
+ /**
198
+ * Resolution tiers the upstream accepts, such as 720p or 1080p. Null means unknown.
199
+ * @nullable
200
+ */
201
+ resolutions: string[] | null;
202
+ /**
203
+ * Whether a request may carry a reference image. Null means unknown.
204
+ * @nullable
205
+ */
206
+ supports_input_reference: boolean | null;
207
+ /**
208
+ * Whether a generated video can be remixed into another task. Null means unknown.
209
+ * @nullable
210
+ */
211
+ supports_remix: boolean | null;
212
+ /**
213
+ * Whether the upstream accepts reusable characters. Null means unknown.
214
+ * @nullable
215
+ */
216
+ supports_characters: boolean | null;
217
+ }
218
+ export type ModelParameterType = (typeof ModelParameterType)[keyof typeof ModelParameterType];
219
+ export declare const ModelParameterType: {
220
+ readonly string: "string";
221
+ readonly integer: "integer";
222
+ readonly number: "number";
223
+ readonly boolean: "boolean";
224
+ readonly object: "object";
225
+ readonly array: "array";
226
+ };
227
+ /**
228
+ * A non-standard request field this endpoint accepts. OpenAI SDK callers pass it through `extra_body`, which places it at the top level of the body.
229
+ */
230
+ export interface ModelParameter {
231
+ name: string;
232
+ description: string;
233
+ type: ModelParameterType;
234
+ required: boolean;
235
+ /** The value the upstream assumes when the field is absent; null when there is none. The service never writes it into the request. */
236
+ default?: unknown;
237
+ /**
238
+ * The accepted values of an enumerated string parameter. Null when the parameter is not enumerated.
239
+ * @nullable
240
+ */
241
+ values?: string[] | null;
242
+ }
119
243
  export interface EndpointCapabilities {
120
244
  /** @nullable */
121
245
  function_calling: boolean | null;
122
246
  /** @nullable */
123
247
  structured_output: boolean | null;
124
248
  reasoning: ReasoningCapabilities | null;
249
+ /** Present on image generation and edit endpoints. Null or absent elsewhere. */
250
+ image?: ImageCapabilities | null;
251
+ /** Present on speech and transcription endpoints. Null or absent elsewhere. */
252
+ audio?: AudioCapabilities | null;
253
+ /** Present on the videos endpoint. Null or absent elsewhere. */
254
+ video?: VideoCapabilities | null;
255
+ /**
256
+ * Non-standard request fields this endpoint accepts, sent at the top level of the request body. Null or absent means none are declared.
257
+ * @nullable
258
+ */
259
+ parameters?: ModelParameter[] | null;
125
260
  }
126
261
  /**
127
262
  * Verified capabilities keyed by API endpoint, for example /v1/chat/completions or /v1/responses. Missing keys and null values mean unknown. Current route availability is separate.
@@ -142,6 +277,19 @@ export declare const ModelEndpoint: {
142
277
  readonly "/v1/audio/translations": "/v1/audio/translations";
143
278
  readonly "/v1/audio/speech": "/v1/audio/speech";
144
279
  readonly "/v1/realtime": "/v1/realtime";
280
+ readonly "/v1/completions": "/v1/completions";
281
+ readonly "/v1/rerank": "/v1/rerank";
282
+ readonly "/v1/moderations": "/v1/moderations";
283
+ readonly "/v1/images/variations": "/v1/images/variations";
284
+ readonly "/v1/files": "/v1/files";
285
+ readonly "/v1/uploads": "/v1/uploads";
286
+ readonly "/v1/batches": "/v1/batches";
287
+ readonly "/v1/fine_tuning/jobs": "/v1/fine_tuning/jobs";
288
+ readonly "/v1/assistants": "/v1/assistants";
289
+ readonly "/v1/threads": "/v1/threads";
290
+ readonly "/v1/vector_stores": "/v1/vector_stores";
291
+ readonly "/v1/containers": "/v1/containers";
292
+ readonly "/v1/videos": "/v1/videos";
145
293
  };
146
294
  export interface Model {
147
295
  id: string;
@@ -367,32 +515,45 @@ export declare const ModelResourceStatus: {
367
515
  readonly draining: "draining";
368
516
  readonly retired: "retired";
369
517
  };
370
- export type ModelMeterTokenKind = (typeof ModelMeterTokenKind)[keyof typeof ModelMeterTokenKind];
371
- export declare const ModelMeterTokenKind: {
518
+ /**
519
+ * The billable quantity this entry prices. Token kinds are `input`, `output`, `cache_read`, `cache_write` and `reasoning`; media kinds are `images`, `audio_characters`, `audio_seconds` and `video_seconds`.
520
+ */
521
+ export type ModelMeterKind = (typeof ModelMeterKind)[keyof typeof ModelMeterKind];
522
+ export declare const ModelMeterKind: {
372
523
  readonly input: "input";
373
524
  readonly output: "output";
374
525
  readonly cache_read: "cache_read";
375
526
  readonly cache_write: "cache_write";
376
527
  readonly reasoning: "reasoning";
528
+ readonly images: "images";
529
+ readonly audio_characters: "audio_characters";
530
+ readonly audio_seconds: "audio_seconds";
531
+ readonly video_seconds: "video_seconds";
532
+ readonly rerank_units: "rerank_units";
377
533
  };
378
534
  /**
379
- * The dimension values the usage of this token kind carries, and the rate is matched at.
535
+ * One set of dimension values of this kind, useful as a query template. A media kind may have other values on the same keys, such as another size or resolution.
380
536
  */
381
537
  export type ModelMeterDimensions = {
382
538
  [key: string]: string;
383
539
  };
384
540
  export interface ModelMeter {
385
- token_kind: ModelMeterTokenKind;
541
+ /** The billable quantity this entry prices. Token kinds are `input`, `output`, `cache_read`, `cache_write` and `reasoning`; media kinds are `images`, `audio_characters`, `audio_seconds` and `video_seconds`. */
542
+ kind: ModelMeterKind;
386
543
  meter_lookup_key: string;
387
- /** The dimension values the usage of this token kind carries, and the rate is matched at. */
544
+ /** The unit the meter counts in, such as token, image, character or second. */
545
+ unit: string;
546
+ /** The dimension keys every rate of this kind is matched on, in the order the meter declares them. */
547
+ dimension_keys: string[];
548
+ /** One set of dimension values of this kind, useful as a query template. A media kind may have other values on the same keys, such as another size or resolution. */
388
549
  dimensions: ModelMeterDimensions;
389
550
  }
390
551
  /**
391
- * How requests to a model are billed: under the service's subscription, on the Billing plan `plan_id`, one rate for each token kind. Read the rates from Billing with `search-prices` for the plan, narrowing each price's `rates` with each meter's `dimensions`.
552
+ * How requests to a model are billed: under the service's subscription, on the Billing plan `plan_id`, one rate for each billable kind. Read the rates from Billing with `search-prices` for the plan, narrowing each price's `rates` with each meter's `dimensions`.
392
553
  *
393
- * Each token kind is priced on its own. `input` excludes cached input, which is `cache_read`, and `output` excludes reasoning the provider reports separately, which is `reasoning`; a request is billed for each kind it used.
554
+ * Text is billed on the five token kinds. `input` excludes cached input, which is `cache_read`; `output` excludes reasoning the provider reports separately, which is `reasoning`. Media is billed on its own unit and never converted to tokens: `images` counts generated images, `audio_characters` counts the input characters of speech synthesis, `audio_seconds` counts the duration of a transcription, and `video_seconds` counts the duration of a generated video. A request is billed for each kind it used.
394
555
  *
395
- * Rates are set per currency, and a currency may not offer a model at all. A model is offered in the currency of the project's billing account when at least one of its token kinds has a rate there; a token kind without a rate in that currency is not charged. Requests to a model with no rate in that currency are refused with 403 `BILLING_MODEL_NOT_OFFERED`.
556
+ * Rates are set per currency, and a currency may not offer a model at all. A model is offered in the currency of the project's billing account when at least one of its billable kinds has a rate there; a kind without a rate in that currency is not charged. Requests to a model with no rate in that currency are refused with 403 `BILLING_MODEL_NOT_OFFERED`.
396
557
  */
397
558
  export interface ModelBilling {
398
559
  /**
@@ -400,7 +561,7 @@ export interface ModelBilling {
400
561
  * @nullable
401
562
  */
402
563
  plan_id: string | null;
403
- /** One entry for each of the five token kinds, in the order input, output, cache_read, cache_write, reasoning. */
564
+ /** One entry for each billable kind the model uses. A text model lists the five token kinds in the order input, output, cache_read, cache_write, reasoning; media kinds follow in the order images, audio_characters, audio_seconds, video_seconds. */
404
565
  meters: ModelMeter[];
405
566
  }
406
567
  export interface ModelResource {
@@ -432,6 +593,34 @@ export interface ModelResource {
432
593
  /** Explicitly supported API endpoints. Requests to any other endpoint are rejected before upstream admission. */
433
594
  supported_endpoints: ModelEndpoint[];
434
595
  }
596
+ /**
597
+ * Media quantities and the rate dimensions they were billed at. Absent on a token-only request.
598
+ */
599
+ export interface MediaUsage {
600
+ /** Number of generated images. */
601
+ images: number;
602
+ /** Input characters of speech synthesis. */
603
+ audio_characters: number;
604
+ /** Duration of transcribed audio. */
605
+ audio_seconds: number;
606
+ /** Duration of a generated video. */
607
+ video_seconds: number;
608
+ /**
609
+ * Image or video size the request asked for, if it carried one.
610
+ * @nullable
611
+ */
612
+ size: string | null;
613
+ /**
614
+ * Image quality the request asked for, if it carried one.
615
+ * @nullable
616
+ */
617
+ quality: string | null;
618
+ /**
619
+ * Video resolution tier the request asked for, if it carried one.
620
+ * @nullable
621
+ */
622
+ resolution: string | null;
623
+ }
435
624
  export interface ModelListResponseBody {
436
625
  items: ModelResource[];
437
626
  }
@@ -467,6 +656,7 @@ export interface RequestResource {
467
656
  finished_at: string | null;
468
657
  /** @nullable */
469
658
  first_token_at: string | null;
659
+ /** A typed request id such as `req_01j...`. Legacy rows may still be returned as a bare UUID. */
470
660
  id: string;
471
661
  input_tokens: number;
472
662
  /** The model named in the request */
@@ -490,6 +680,8 @@ export interface RequestResource {
490
680
  /** upstream means the figures were reported by the provider; estimated means they were derived from the character classes of the payload */
491
681
  usage_source: RequestResourceUsageSource;
492
682
  reasoning: ReasoningDiagnostics | null;
683
+ /** Media quantities and their rate dimensions. Null for a token-only request. */
684
+ media?: MediaUsage | null;
493
685
  }
494
686
  export interface CursorPageRequestResource {
495
687
  /** The items in this page */
@@ -504,6 +696,8 @@ export interface APIKeyUsageResource {
504
696
  input_tokens: number;
505
697
  output_tokens: number;
506
698
  reasoning_tokens: number;
699
+ /** Media quantities and their rate dimensions. Null when this range has no media usage. */
700
+ media?: MediaUsage | null;
507
701
  requests: number;
508
702
  }
509
703
  export interface APIKeyUsageListResponseBody {
@@ -516,6 +710,8 @@ export interface ModelUsageResource {
516
710
  model_id: string;
517
711
  output_tokens: number;
518
712
  reasoning_tokens: number;
713
+ /** Media quantities and their rate dimensions. Null when this range has no media usage. */
714
+ media?: MediaUsage | null;
519
715
  requests: number;
520
716
  }
521
717
  export interface ModelUsageListResponseBody {
@@ -527,6 +723,8 @@ export interface TotalsResource {
527
723
  input_tokens: number;
528
724
  output_tokens: number;
529
725
  reasoning_tokens: number;
726
+ /** Media quantities and their rate dimensions. Null when this range has no media usage. */
727
+ media?: MediaUsage | null;
530
728
  requests: number;
531
729
  }
532
730
  export interface UsageBucketResource {
@@ -537,6 +735,8 @@ export interface UsageBucketResource {
537
735
  input_tokens: number;
538
736
  output_tokens: number;
539
737
  reasoning_tokens: number;
738
+ /** Media quantities and their rate dimensions. Null when this range has no media usage. */
739
+ media?: MediaUsage | null;
540
740
  requests: number;
541
741
  /** End of the bucket, exclusive */
542
742
  to: string;
@@ -10,6 +10,14 @@ export const Modality = {
10
10
  file: "file",
11
11
  embedding: "embedding",
12
12
  };
13
+ export const ModelParameterType = {
14
+ string: "string",
15
+ integer: "integer",
16
+ number: "number",
17
+ boolean: "boolean",
18
+ object: "object",
19
+ array: "array",
20
+ };
13
21
  export const ModelEndpoint = {
14
22
  "/v1/chat/completions": "/v1/chat/completions",
15
23
  "/v1/responses": "/v1/responses",
@@ -22,6 +30,19 @@ export const ModelEndpoint = {
22
30
  "/v1/audio/translations": "/v1/audio/translations",
23
31
  "/v1/audio/speech": "/v1/audio/speech",
24
32
  "/v1/realtime": "/v1/realtime",
33
+ "/v1/completions": "/v1/completions",
34
+ "/v1/rerank": "/v1/rerank",
35
+ "/v1/moderations": "/v1/moderations",
36
+ "/v1/images/variations": "/v1/images/variations",
37
+ "/v1/files": "/v1/files",
38
+ "/v1/uploads": "/v1/uploads",
39
+ "/v1/batches": "/v1/batches",
40
+ "/v1/fine_tuning/jobs": "/v1/fine_tuning/jobs",
41
+ "/v1/assistants": "/v1/assistants",
42
+ "/v1/threads": "/v1/threads",
43
+ "/v1/vector_stores": "/v1/vector_stores",
44
+ "/v1/containers": "/v1/containers",
45
+ "/v1/videos": "/v1/videos",
25
46
  };
26
47
  export const APIKeyResourceStatus = {
27
48
  active: "active",
@@ -38,12 +59,17 @@ export const ModelResourceStatus = {
38
59
  draining: "draining",
39
60
  retired: "retired",
40
61
  };
41
- export const ModelMeterTokenKind = {
62
+ export const ModelMeterKind = {
42
63
  input: "input",
43
64
  output: "output",
44
65
  cache_read: "cache_read",
45
66
  cache_write: "cache_write",
46
67
  reasoning: "reasoning",
68
+ images: "images",
69
+ audio_characters: "audio_characters",
70
+ audio_seconds: "audio_seconds",
71
+ video_seconds: "video_seconds",
72
+ rerank_units: "rerank_units",
47
73
  };
48
74
  export const RequestResourceStatus = {
49
75
  in_flight: "in_flight",
@@ -245,7 +245,7 @@ export declare const ListRequestsQueryParams: zod.ZodObject<{
245
245
  * @summary Get a single request record
246
246
  */
247
247
  export declare const GetRequestParams: zod.ZodObject<{
248
- requestId: zod.ZodUUID;
248
+ requestId: zod.ZodString;
249
249
  }, zod.z.core.$strict>;
250
250
  /**
251
251
  * Purchases the model platform service for this project. The service itself has no charge; requests are metered under it by the tokens they use. It takes no billing choice. Returns the service as `pending` with its Checkout Session; it becomes `active` once the order is accepted, which with automatic checkout and nothing to pay happens without further action.
@@ -242,7 +242,9 @@ export const ListRequestsQueryParams = zod.strictObject({
242
242
  * @summary Get a single request record
243
243
  */
244
244
  export const GetRequestParams = zod.strictObject({
245
- requestId: zod.uuid(),
245
+ requestId: zod
246
+ .string()
247
+ .describe("A typed request id such as `req_01j...`; a bare UUID is also accepted."),
246
248
  });
247
249
  /**
248
250
  * Purchases the model platform service for this project. The service itself has no charge; requests are metered under it by the tokens they use. It takes no billing choice. Returns the service as `pending` with its Checkout Session; it becomes `active` once the order is accepted, which with automatic checkout and nothing to pay happens without further action.
@@ -47,6 +47,15 @@ export declare const APIKeyUsageListResponseBody: zod.ZodObject<{
47
47
  input_tokens: zod.ZodInt;
48
48
  output_tokens: zod.ZodInt;
49
49
  reasoning_tokens: zod.ZodInt;
50
+ media: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
51
+ images: zod.ZodInt;
52
+ audio_characters: zod.ZodInt;
53
+ audio_seconds: zod.ZodInt;
54
+ video_seconds: zod.ZodInt;
55
+ size: zod.ZodNullable<zod.ZodString>;
56
+ quality: zod.ZodNullable<zod.ZodString>;
57
+ resolution: zod.ZodNullable<zod.ZodString>;
58
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
50
59
  requests: zod.ZodInt;
51
60
  }, zod.z.core.$strict>>;
52
61
  }, zod.z.core.$strict>;
@@ -46,6 +46,15 @@ export declare const APIKeyUsageResource: zod.ZodObject<{
46
46
  input_tokens: zod.ZodInt;
47
47
  output_tokens: zod.ZodInt;
48
48
  reasoning_tokens: zod.ZodInt;
49
+ media: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
50
+ images: zod.ZodInt;
51
+ audio_characters: zod.ZodInt;
52
+ audio_seconds: zod.ZodInt;
53
+ video_seconds: zod.ZodInt;
54
+ size: zod.ZodNullable<zod.ZodString>;
55
+ quality: zod.ZodNullable<zod.ZodString>;
56
+ resolution: zod.ZodNullable<zod.ZodString>;
57
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
49
58
  requests: zod.ZodInt;
50
59
  }, zod.z.core.$strict>;
51
60
  export type APIKeyUsageResource = zod.input<typeof APIKeyUsageResource>;
@@ -39,6 +39,7 @@
39
39
  * OpenAPI spec version: 1.0.0
40
40
  */
41
41
  import * as zod from "zod";
42
+ import { MediaUsage } from "./mediaUsage.zod.js";
42
43
  export const APIKeyUsageResource = zod.strictObject({
43
44
  api_key_id: zod.uuid(),
44
45
  cache_read_tokens: zod.int(),
@@ -46,5 +47,9 @@ export const APIKeyUsageResource = zod.strictObject({
46
47
  input_tokens: zod.int(),
47
48
  output_tokens: zod.int(),
48
49
  reasoning_tokens: zod.int(),
50
+ media: zod
51
+ .union([MediaUsage, zod.null()])
52
+ .optional()
53
+ .describe("Media quantities and their rate dimensions. Null when this range has no media usage."),
49
54
  requests: zod.int(),
50
55
  });
@@ -0,0 +1,51 @@
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 audioCapabilitiesMaxInputBytesMin = 0;
43
+ export declare const AudioCapabilities: zod.ZodObject<{
44
+ voices: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
45
+ formats: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
46
+ response_formats: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
47
+ max_input_bytes: zod.ZodNullable<zod.ZodInt>;
48
+ supports_stream: zod.ZodNullable<zod.ZodBoolean>;
49
+ }, zod.z.core.$strict>;
50
+ export type AudioCapabilities = zod.input<typeof AudioCapabilities>;
51
+ export type AudioCapabilitiesOutput = zod.output<typeof AudioCapabilities>;
@@ -0,0 +1,67 @@
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 audioCapabilitiesMaxInputBytesMin = 0;
43
+ export const AudioCapabilities = zod
44
+ .strictObject({
45
+ voices: zod
46
+ .array(zod.string())
47
+ .nullable()
48
+ .describe("Voices the speech endpoint accepts. Empty for transcription endpoints. Null means unknown."),
49
+ formats: zod
50
+ .array(zod.string())
51
+ .nullable()
52
+ .describe("Audio container or codec values the endpoint accepts. Null means unknown."),
53
+ response_formats: zod
54
+ .array(zod.string())
55
+ .nullable()
56
+ .describe("Response formats the transcription endpoint accepts, such as json or srt. Null means unknown."),
57
+ max_input_bytes: zod
58
+ .int()
59
+ .min(audioCapabilitiesMaxInputBytesMin)
60
+ .nullable()
61
+ .describe("The largest upload the endpoint accepts, in bytes. Null means unknown."),
62
+ supports_stream: zod
63
+ .boolean()
64
+ .nullable()
65
+ .describe("Whether the endpoint can stream its response. Null means unknown."),
66
+ })
67
+ .describe("The audio parameters this endpoint accepts.");
@@ -47,7 +47,7 @@ export declare const CursorPageRequestResource: zod.ZodObject<{
47
47
  error_code: zod.ZodString;
48
48
  finished_at: zod.ZodNullable<zod.z.ZodISODateTime>;
49
49
  first_token_at: zod.ZodNullable<zod.z.ZodISODateTime>;
50
- id: zod.ZodUUID;
50
+ id: zod.ZodString;
51
51
  input_tokens: zod.ZodInt;
52
52
  model_id: zod.ZodString;
53
53
  output_tokens: zod.ZodInt;
@@ -73,6 +73,15 @@ export declare const CursorPageRequestResource: zod.ZodObject<{
73
73
  reasoning: zod.ZodUnion<readonly [zod.ZodObject<{
74
74
  requested: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
75
75
  }, zod.z.core.$strict>, zod.ZodNull]>;
76
+ media: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
77
+ images: zod.ZodInt;
78
+ audio_characters: zod.ZodInt;
79
+ audio_seconds: zod.ZodInt;
80
+ video_seconds: zod.ZodInt;
81
+ size: zod.ZodNullable<zod.ZodString>;
82
+ quality: zod.ZodNullable<zod.ZodString>;
83
+ resolution: zod.ZodNullable<zod.ZodString>;
84
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
76
85
  }, zod.z.core.$strict>>;
77
86
  next_cursor: zod.ZodString;
78
87
  }, zod.z.core.$strict>;
@@ -53,6 +53,43 @@ export declare const EndpointCapabilities: zod.ZodObject<{
53
53
  }, zod.z.core.$strict>>;
54
54
  summary: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
55
55
  }, zod.z.core.$strict>, zod.ZodNull]>;
56
+ image: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
57
+ sizes: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
58
+ qualities: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
59
+ response_formats: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
60
+ max_n: zod.ZodNullable<zod.ZodInt>;
61
+ supports_stream: zod.ZodNullable<zod.ZodBoolean>;
62
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
63
+ audio: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
64
+ voices: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
65
+ formats: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
66
+ response_formats: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
67
+ max_input_bytes: zod.ZodNullable<zod.ZodInt>;
68
+ supports_stream: zod.ZodNullable<zod.ZodBoolean>;
69
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
70
+ video: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
71
+ seconds: zod.ZodNullable<zod.ZodArray<zod.ZodInt>>;
72
+ sizes: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
73
+ resolutions: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
74
+ supports_input_reference: zod.ZodNullable<zod.ZodBoolean>;
75
+ supports_remix: zod.ZodNullable<zod.ZodBoolean>;
76
+ supports_characters: zod.ZodNullable<zod.ZodBoolean>;
77
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
78
+ parameters: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodObject<{
79
+ name: zod.ZodString;
80
+ description: zod.ZodString;
81
+ type: zod.ZodEnum<{
82
+ string: "string";
83
+ number: "number";
84
+ boolean: "boolean";
85
+ object: "object";
86
+ array: "array";
87
+ integer: "integer";
88
+ }>;
89
+ required: zod.ZodBoolean;
90
+ default: zod.ZodOptional<zod.ZodUnknown>;
91
+ values: zod.ZodOptional<zod.ZodNullable<zod.ZodArray<zod.ZodString>>>;
92
+ }, zod.z.core.$strict>>>>;
56
93
  }, zod.z.core.$strict>;
57
94
  export type EndpointCapabilities = zod.input<typeof EndpointCapabilities>;
58
95
  export type EndpointCapabilitiesOutput = zod.output<typeof EndpointCapabilities>;