@leaflow/sdk 0.0.0-dev.484.g7d5e731 → 0.0.0-dev.489.g3a7785d

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.
@@ -4127,6 +4127,14 @@ export type ListPricesByPlanParams = {
4127
4127
  */
4128
4128
  page_size?: number;
4129
4129
  currency?: string;
4130
+ /**
4131
+ * Narrows to one price type.
4132
+ */
4133
+ type?: PriceType;
4134
+ /**
4135
+ * Narrows to one usage type.
4136
+ */
4137
+ usage_type?: UsageType;
4130
4138
  };
4131
4139
  export type ListPricesByPlanHeaders = {
4132
4140
  /**
@@ -1163,6 +1163,14 @@ export declare const ListPricesByPlanQueryParams: zod.ZodObject<{
1163
1163
  page: zod.ZodDefault<zod.ZodInt>;
1164
1164
  page_size: zod.ZodDefault<zod.ZodInt>;
1165
1165
  currency: zod.ZodOptional<zod.ZodString>;
1166
+ type: zod.ZodOptional<zod.ZodEnum<{
1167
+ one_time: "one_time";
1168
+ recurring: "recurring";
1169
+ }>>;
1170
+ usage_type: zod.ZodOptional<zod.ZodEnum<{
1171
+ licensed: "licensed";
1172
+ metered: "metered";
1173
+ }>>;
1166
1174
  }, zod.z.core.$strict>;
1167
1175
  export declare const ListPricesByPlanHeader: zod.ZodObject<{
1168
1176
  "If-None-Match": zod.ZodOptional<zod.ZodString>;
@@ -1526,6 +1526,8 @@ export const ListPricesByPlanQueryParams = zod.strictObject({
1526
1526
  .default(listPricesByPlanQueryPageSizeDefault)
1527
1527
  .describe("Items per page. Defaults to 50; at most 200."),
1528
1528
  currency: zod.string().optional(),
1529
+ type: zod.enum(["one_time", "recurring"]).optional().describe("Narrows to one price type."),
1530
+ usage_type: zod.enum(["licensed", "metered"]).optional().describe("Narrows to one usage type."),
1529
1531
  });
1530
1532
  export const ListPricesByPlanHeader = zod.strictObject({
1531
1533
  "If-None-Match": zod
@@ -14,6 +14,14 @@ export declare const ListPricesByPlanParams: zod.ZodObject<{
14
14
  page: zod.ZodDefault<zod.ZodInt>;
15
15
  page_size: zod.ZodDefault<zod.ZodInt>;
16
16
  currency: zod.ZodOptional<zod.ZodString>;
17
+ type: zod.ZodOptional<zod.ZodEnum<{
18
+ one_time: "one_time";
19
+ recurring: "recurring";
20
+ }>>;
21
+ usage_type: zod.ZodOptional<zod.ZodEnum<{
22
+ licensed: "licensed";
23
+ metered: "metered";
24
+ }>>;
17
25
  }, zod.z.core.$strict>;
18
26
  export type ListPricesByPlanParams = zod.input<typeof ListPricesByPlanParams>;
19
27
  export type ListPricesByPlanParamsOutput = zod.output<typeof ListPricesByPlanParams>;
@@ -6,6 +6,8 @@
6
6
  * OpenAPI spec version: v1
7
7
  */
8
8
  import * as zod from "zod";
9
+ import { PriceType } from "./priceType.zod.js";
10
+ import { UsageType } from "./usageType.zod.js";
9
11
  export const listPricesByPlanParamsPageDefault = 1;
10
12
  export const listPricesByPlanParamsPageMax = 2147483647;
11
13
  export const listPricesByPlanParamsPageSizeDefault = 50;
@@ -22,4 +24,6 @@ export const ListPricesByPlanParams = zod.strictObject({
22
24
  .max(listPricesByPlanParamsPageSizeMax)
23
25
  .default(listPricesByPlanParamsPageSizeDefault),
24
26
  currency: zod.string().optional(),
27
+ type: PriceType.optional(),
28
+ usage_type: UsageType.optional(),
25
29
  });
@@ -179,10 +179,23 @@ export interface AudioCapabilities {
179
179
  */
180
180
  supports_stream: boolean | null;
181
181
  }
182
+ /**
183
+ * Accepted durations are min + n * step seconds, up to max. Independent of per-second pricing.
184
+ */
185
+ export interface VideoDurationRange {
186
+ /** @minimum 1 */
187
+ min: number;
188
+ /** @minimum 1 */
189
+ max: number;
190
+ /** @minimum 1 */
191
+ step: number;
192
+ }
182
193
  /**
183
194
  * 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
195
  */
185
196
  export interface VideoCapabilities {
197
+ /** Continuous duration capability. Mutually exclusive with nonempty seconds. */
198
+ duration_range?: VideoDurationRange | null;
186
199
  /**
187
200
  * Durations the upstream accepts, in seconds. Null means unknown.
188
201
  * @nullable
@@ -68,6 +68,11 @@ export declare const EndpointCapabilities: zod.ZodObject<{
68
68
  supports_stream: zod.ZodNullable<zod.ZodBoolean>;
69
69
  }, zod.z.core.$strict>, zod.ZodNull]>>;
70
70
  video: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
71
+ duration_range: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
72
+ min: zod.ZodInt;
73
+ max: zod.ZodInt;
74
+ step: zod.ZodInt;
75
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
71
76
  seconds: zod.ZodNullable<zod.ZodArray<zod.ZodInt>>;
72
77
  sizes: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
73
78
  resolutions: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
@@ -94,6 +94,11 @@ export declare const Model: zod.ZodObject<{
94
94
  supports_stream: zod.ZodNullable<zod.ZodBoolean>;
95
95
  }, zod.z.core.$strict>, zod.ZodNull]>>;
96
96
  video: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
97
+ duration_range: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
98
+ min: zod.ZodInt;
99
+ max: zod.ZodInt;
100
+ step: zod.ZodInt;
101
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
97
102
  seconds: zod.ZodNullable<zod.ZodArray<zod.ZodInt>>;
98
103
  sizes: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
99
104
  resolutions: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
@@ -68,6 +68,11 @@ export declare const ModelCapabilities: zod.ZodRecord<zod.ZodString, zod.ZodObje
68
68
  supports_stream: zod.ZodNullable<zod.ZodBoolean>;
69
69
  }, zod.z.core.$strict>, zod.ZodNull]>>;
70
70
  video: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
71
+ duration_range: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
72
+ min: zod.ZodInt;
73
+ max: zod.ZodInt;
74
+ step: zod.ZodInt;
75
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
71
76
  seconds: zod.ZodNullable<zod.ZodArray<zod.ZodInt>>;
72
77
  sizes: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
73
78
  resolutions: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
@@ -96,6 +96,11 @@ export declare const ModelList: zod.ZodObject<{
96
96
  supports_stream: zod.ZodNullable<zod.ZodBoolean>;
97
97
  }, zod.z.core.$strict>, zod.ZodNull]>>;
98
98
  video: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
99
+ duration_range: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
100
+ min: zod.ZodInt;
101
+ max: zod.ZodInt;
102
+ step: zod.ZodInt;
103
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
99
104
  seconds: zod.ZodNullable<zod.ZodArray<zod.ZodInt>>;
100
105
  sizes: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
101
106
  resolutions: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
@@ -119,6 +119,11 @@ export declare const ModelListResponseBody: zod.ZodObject<{
119
119
  supports_stream: zod.ZodNullable<zod.ZodBoolean>;
120
120
  }, zod.z.core.$strict>, zod.ZodNull]>>;
121
121
  video: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
122
+ duration_range: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
123
+ min: zod.ZodInt;
124
+ max: zod.ZodInt;
125
+ step: zod.ZodInt;
126
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
122
127
  seconds: zod.ZodNullable<zod.ZodArray<zod.ZodInt>>;
123
128
  sizes: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
124
129
  resolutions: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
@@ -118,6 +118,11 @@ export declare const ModelResource: zod.ZodObject<{
118
118
  supports_stream: zod.ZodNullable<zod.ZodBoolean>;
119
119
  }, zod.z.core.$strict>, zod.ZodNull]>>;
120
120
  video: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
121
+ duration_range: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
122
+ min: zod.ZodInt;
123
+ max: zod.ZodInt;
124
+ step: zod.ZodInt;
125
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
121
126
  seconds: zod.ZodNullable<zod.ZodArray<zod.ZodInt>>;
122
127
  sizes: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
123
128
  resolutions: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
@@ -40,6 +40,11 @@
40
40
  */
41
41
  import * as zod from "zod";
42
42
  export declare const VideoCapabilities: zod.ZodObject<{
43
+ duration_range: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
44
+ min: zod.ZodInt;
45
+ max: zod.ZodInt;
46
+ step: zod.ZodInt;
47
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
43
48
  seconds: zod.ZodNullable<zod.ZodArray<zod.ZodInt>>;
44
49
  sizes: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
45
50
  resolutions: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
@@ -39,8 +39,13 @@
39
39
  * OpenAPI spec version: 1.0.0
40
40
  */
41
41
  import * as zod from "zod";
42
+ import { VideoDurationRange } from "./videoDurationRange.zod.js";
42
43
  export const VideoCapabilities = zod
43
44
  .strictObject({
45
+ duration_range: zod
46
+ .union([VideoDurationRange, zod.null()])
47
+ .optional()
48
+ .describe("Continuous duration capability. Mutually exclusive with nonempty seconds."),
44
49
  seconds: zod
45
50
  .array(zod.int().min(1))
46
51
  .nullable()
@@ -0,0 +1,48 @@
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 VideoDurationRange: zod.ZodObject<{
43
+ min: zod.ZodInt;
44
+ max: zod.ZodInt;
45
+ step: zod.ZodInt;
46
+ }, zod.z.core.$strict>;
47
+ export type VideoDurationRange = zod.input<typeof VideoDurationRange>;
48
+ export type VideoDurationRangeOutput = zod.output<typeof VideoDurationRange>;
@@ -0,0 +1,48 @@
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 VideoDurationRange = zod
43
+ .strictObject({
44
+ min: zod.int().min(1),
45
+ max: zod.int().min(1),
46
+ step: zod.int().min(1),
47
+ })
48
+ .describe("Accepted durations are min + n * step seconds, up to max. Independent of per-second pricing.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.0.0-dev.484.g7d5e731",
3
+ "version": "0.0.0-dev.489.g3a7785d",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {