hanzoai 8.5.621 → 8.5.640
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.
- package/README.md +64 -9
- package/dist/answer.js +20 -10
- package/dist/api/ai-api.d.ts +280 -14
- package/dist/api/ai-api.js +315 -29
- package/dist/api/auto-api.d.ts +64 -0
- package/dist/api/auto-api.js +77 -0
- package/dist/api/billing-api.d.ts +4 -4
- package/dist/api/billing-api.js +4 -4
- package/dist/api/git-api.d.ts +30 -0
- package/dist/api/git-api.js +59 -0
- package/dist/api/task-api.d.ts +55 -0
- package/dist/api/task-api.js +71 -0
- package/dist/client.d.ts +3 -2
- package/dist/client.js +4 -3
- package/dist/esm/answer.js +20 -10
- package/dist/esm/api/ai-api.d.ts +280 -14
- package/dist/esm/api/ai-api.js +315 -29
- package/dist/esm/api/auto-api.d.ts +64 -0
- package/dist/esm/api/auto-api.js +77 -0
- package/dist/esm/api/billing-api.d.ts +4 -4
- package/dist/esm/api/billing-api.js +4 -4
- package/dist/esm/api/git-api.d.ts +30 -0
- package/dist/esm/api/git-api.js +59 -0
- package/dist/esm/api/task-api.d.ts +55 -0
- package/dist/esm/api/task-api.js +71 -0
- package/dist/esm/client.d.ts +3 -2
- package/dist/esm/client.js +3 -2
- package/dist/esm/hanzo.d.ts +3 -0
- package/dist/esm/hanzo.js +6 -0
- package/dist/esm/models/agent-target-view.d.ts +6 -0
- package/dist/esm/models/ai-chat-in.d.ts +42 -0
- package/dist/esm/models/ai-chat.d.ts +37 -0
- package/dist/esm/models/ai-decide-in.d.ts +50 -0
- package/dist/esm/models/ai-decide-in.js +14 -0
- package/dist/esm/models/ai-decision-sides.d.ts +4 -5
- package/dist/esm/models/{ai-decision-sides-false.d.ts → ai-decision.d.ts} +15 -2
- package/dist/esm/models/ai-decision.js +14 -0
- package/dist/esm/models/ai-decisions-answer.d.ts +2 -3
- package/dist/esm/models/ai-decisions-choice.d.ts +4 -8
- package/dist/esm/models/ai-decisions-noul.d.ts +2 -3
- package/dist/esm/models/ai-decisions-request.d.ts +2 -3
- package/dist/esm/models/ai-decisions-score.d.ts +4 -5
- package/dist/esm/models/ai-model.d.ts +73 -0
- package/dist/esm/models/ai-model.js +14 -0
- package/dist/esm/models/{ai-decisions-choice-criteria-value.d.ts → ai-models.d.ts} +15 -2
- package/dist/esm/models/ai-models.js +14 -0
- package/dist/esm/models/ai-price.d.ts +48 -0
- package/dist/esm/models/ai-price.js +14 -0
- package/dist/esm/models/ai-receipt.d.ts +60 -0
- package/dist/esm/models/ai-receipt.js +14 -0
- package/dist/esm/models/ai-routing-reward-request.d.ts +54 -0
- package/dist/esm/models/ai-routing-reward-request.js +24 -0
- package/dist/esm/models/auto-automation-in.d.ts +6 -0
- package/dist/esm/models/auto-automation-patch.d.ts +6 -0
- package/dist/esm/models/auto-automation-run.d.ts +14 -1
- package/dist/esm/models/auto-automation.d.ts +6 -0
- package/dist/esm/models/auto-post-result.d.ts +36 -0
- package/dist/esm/models/auto-post-result.js +14 -0
- package/dist/esm/models/auto-review-in.d.ts +36 -0
- package/dist/esm/models/auto-review-in.js +14 -0
- package/dist/esm/models/git-workspace-view.d.ts +36 -0
- package/dist/esm/models/git-workspace-view.js +14 -0
- package/dist/esm/models/iam-user.d.ts +1 -1
- package/dist/esm/models/index.d.ts +14 -2
- package/dist/esm/models/index.js +14 -2
- package/dist/esm/models/provider-github-import-out.d.ts +6 -0
- package/dist/esm/models/provider-github-repo-item.d.ts +6 -0
- package/dist/esm/models/task-comment-list.d.ts +31 -0
- package/dist/esm/models/task-comment-list.js +14 -0
- package/dist/esm/models/task-comment.d.ts +42 -0
- package/dist/esm/models/task-comment.js +14 -0
- package/dist/esm/transport.d.ts +4 -0
- package/dist/esm/transport.js +188 -0
- package/dist/esm/usage.d.ts +98 -0
- package/dist/esm/usage.js +161 -0
- package/dist/hanzo.d.ts +3 -0
- package/dist/hanzo.js +16 -1
- package/dist/models/agent-target-view.d.ts +6 -0
- package/dist/models/ai-chat-in.d.ts +42 -0
- package/dist/models/ai-chat.d.ts +37 -0
- package/dist/models/ai-decide-in.d.ts +50 -0
- package/dist/models/ai-decide-in.js +15 -0
- package/dist/models/ai-decision-sides.d.ts +4 -5
- package/dist/models/{ai-decision-sides-false.d.ts → ai-decision.d.ts} +15 -2
- package/dist/models/ai-decision.js +15 -0
- package/dist/models/ai-decisions-answer.d.ts +2 -3
- package/dist/models/ai-decisions-choice.d.ts +4 -8
- package/dist/models/ai-decisions-noul.d.ts +2 -3
- package/dist/models/ai-decisions-request.d.ts +2 -3
- package/dist/models/ai-decisions-score.d.ts +4 -5
- package/dist/models/ai-model.d.ts +73 -0
- package/dist/models/ai-model.js +15 -0
- package/dist/models/{ai-decisions-choice-criteria-value.d.ts → ai-models.d.ts} +15 -2
- package/dist/models/ai-models.js +15 -0
- package/dist/models/ai-price.d.ts +48 -0
- package/dist/models/ai-price.js +15 -0
- package/dist/models/ai-receipt.d.ts +60 -0
- package/dist/models/ai-receipt.js +15 -0
- package/dist/models/ai-routing-reward-request.d.ts +54 -0
- package/dist/models/ai-routing-reward-request.js +27 -0
- package/dist/models/auto-automation-in.d.ts +6 -0
- package/dist/models/auto-automation-patch.d.ts +6 -0
- package/dist/models/auto-automation-run.d.ts +14 -1
- package/dist/models/auto-automation.d.ts +6 -0
- package/dist/models/auto-post-result.d.ts +36 -0
- package/dist/models/auto-post-result.js +15 -0
- package/dist/models/auto-review-in.d.ts +36 -0
- package/dist/models/auto-review-in.js +15 -0
- package/dist/models/git-workspace-view.d.ts +36 -0
- package/dist/models/git-workspace-view.js +15 -0
- package/dist/models/iam-user.d.ts +1 -1
- package/dist/models/index.d.ts +14 -2
- package/dist/models/index.js +14 -2
- package/dist/models/provider-github-import-out.d.ts +6 -0
- package/dist/models/provider-github-repo-item.d.ts +6 -0
- package/dist/models/task-comment-list.d.ts +31 -0
- package/dist/models/task-comment-list.js +15 -0
- package/dist/models/task-comment.d.ts +42 -0
- package/dist/models/task-comment.js +15 -0
- package/dist/transport.d.ts +4 -0
- package/dist/transport.js +195 -0
- package/dist/usage.d.ts +98 -0
- package/dist/usage.js +174 -0
- package/package.json +1 -1
- package/src/answer.ts +23 -10
- package/src/api/ai-api.ts +503 -29
- package/src/api/auto-api.ts +117 -0
- package/src/api/billing-api.ts +4 -4
- package/src/api/git-api.ts +68 -0
- package/src/api/task-api.ts +101 -0
- package/src/client.ts +3 -2
- package/src/hanzo.ts +18 -0
- package/src/models/agent-target-view.ts +6 -0
- package/src/models/ai-chat-in.ts +48 -0
- package/src/models/ai-chat.ts +45 -0
- package/src/models/ai-decide-in.ts +54 -0
- package/src/models/ai-decision-sides.ts +4 -7
- package/src/models/{ai-decision-sides-false.ts → ai-decision.ts} +17 -2
- package/src/models/ai-decisions-answer.ts +2 -5
- package/src/models/ai-decisions-choice.ts +4 -10
- package/src/models/ai-decisions-noul.ts +2 -5
- package/src/models/ai-decisions-question.ts +0 -3
- package/src/models/ai-decisions-request.ts +2 -5
- package/src/models/ai-decisions-score.ts +4 -7
- package/src/models/ai-model.ts +81 -0
- package/src/models/{ai-decisions-choice-criteria-value.ts → ai-models.ts} +17 -2
- package/src/models/ai-price.ts +54 -0
- package/src/models/ai-receipt.ts +66 -0
- package/src/models/ai-routing-reward-request.ts +63 -0
- package/src/models/auto-automation-in.ts +6 -0
- package/src/models/auto-automation-patch.ts +6 -0
- package/src/models/auto-automation-run.ts +16 -1
- package/src/models/auto-automation.ts +6 -0
- package/src/models/auto-post-result.ts +42 -0
- package/src/models/auto-review-in.ts +42 -0
- package/src/models/git-workspace-view.ts +42 -0
- package/src/models/iam-user.ts +1 -1
- package/src/models/index.ts +14 -2
- package/src/models/provider-github-import-out.ts +6 -0
- package/src/models/provider-github-repo-item.ts +6 -0
- package/src/models/task-comment-list.ts +39 -0
- package/src/models/task-comment.ts +48 -0
- package/src/transport.ts +190 -0
- package/src/usage.ts +203 -0
- /package/dist/esm/models/{ai-decision-sides-false.js → ai-chat-in.js} +0 -0
- /package/dist/esm/models/{ai-decisions-choice-criteria-value.js → ai-chat.js} +0 -0
- /package/dist/models/{ai-decision-sides-false.js → ai-chat-in.js} +0 -0
- /package/dist/models/{ai-decisions-choice-criteria-value.js → ai-chat.js} +0 -0
package/dist/esm/api/ai-api.js
CHANGED
|
@@ -23,6 +23,72 @@ import { BASE_PATH, BaseAPI, operationServerMap } from '../base';
|
|
|
23
23
|
*/
|
|
24
24
|
export const AiApiAxiosParamCreator = function (configuration) {
|
|
25
25
|
return {
|
|
26
|
+
/**
|
|
27
|
+
* Asks one model one prompt and answers the reply, which model served it and who paid. The call is the caller\'s own POST /v1/chat/completions, run as the caller, so it is gated, billed and refused exactly as that route is; a refusal names its code and what lifts it, never an amount. An empty model asks the deployment\'s default Hanzo model.
|
|
28
|
+
* @summary Asks one model one prompt and answers the reply, which model served it and who paid.
|
|
29
|
+
* @param {AiChatIn} aiChatIn
|
|
30
|
+
* @param {*} [options] Override http request option.
|
|
31
|
+
* @throws {RequiredError}
|
|
32
|
+
*/
|
|
33
|
+
aiChat: async (aiChatIn, options = {}) => {
|
|
34
|
+
// verify required parameter 'aiChatIn' is not null or undefined
|
|
35
|
+
assertParamExists('aiChat', 'aiChatIn', aiChatIn);
|
|
36
|
+
const localVarPath = `/v1/ai/mcp/chat`;
|
|
37
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
38
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
39
|
+
let baseOptions;
|
|
40
|
+
if (configuration) {
|
|
41
|
+
baseOptions = configuration.baseOptions;
|
|
42
|
+
}
|
|
43
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
|
|
44
|
+
const localVarHeaderParameter = {};
|
|
45
|
+
const localVarQueryParameter = {};
|
|
46
|
+
// authentication bearer required
|
|
47
|
+
// http bearer authentication required
|
|
48
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
49
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
50
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
51
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
52
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
53
|
+
localVarRequestOptions.data = serializeDataIfNeeded(aiChatIn, localVarRequestOptions, configuration);
|
|
54
|
+
return {
|
|
55
|
+
url: toPathString(localVarUrlObj),
|
|
56
|
+
options: localVarRequestOptions,
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* Runs one decision — the caller\'s own POST /v1/decisions, gated and billed exactly as that route is — and answers the decision, which model served it and who paid. A refusal names its code and what lifts it, never an amount.
|
|
61
|
+
* @summary Runs one decision — the caller\'s own POST /v1/decisions, gated and billed exactly as that route is — and answers the decision, which model served it and who paid.
|
|
62
|
+
* @param {AiDecideIn} aiDecideIn
|
|
63
|
+
* @param {*} [options] Override http request option.
|
|
64
|
+
* @throws {RequiredError}
|
|
65
|
+
*/
|
|
66
|
+
aiDecide: async (aiDecideIn, options = {}) => {
|
|
67
|
+
// verify required parameter 'aiDecideIn' is not null or undefined
|
|
68
|
+
assertParamExists('aiDecide', 'aiDecideIn', aiDecideIn);
|
|
69
|
+
const localVarPath = `/v1/ai/mcp/decisions`;
|
|
70
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
71
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
72
|
+
let baseOptions;
|
|
73
|
+
if (configuration) {
|
|
74
|
+
baseOptions = configuration.baseOptions;
|
|
75
|
+
}
|
|
76
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
|
|
77
|
+
const localVarHeaderParameter = {};
|
|
78
|
+
const localVarQueryParameter = {};
|
|
79
|
+
// authentication bearer required
|
|
80
|
+
// http bearer authentication required
|
|
81
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
82
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
83
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
84
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
85
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
86
|
+
localVarRequestOptions.data = serializeDataIfNeeded(aiDecideIn, localVarRequestOptions, configuration);
|
|
87
|
+
return {
|
|
88
|
+
url: toPathString(localVarUrlObj),
|
|
89
|
+
options: localVarRequestOptions,
|
|
90
|
+
};
|
|
91
|
+
},
|
|
26
92
|
/**
|
|
27
93
|
* Reads the caller\'s plan usage: for each class of model the plan includes, the share used of the billing period and of its short window, who pays for the next request, and whether the caller is in limited mode and why; the share used of the session and the day; and the ways on. Shares only, never amounts.
|
|
28
94
|
* @summary Reads the caller\'s plan usage: for each class of model the plan includes, the share used of the billing period and of its short window, who pays for the next request, and whether the caller is in limited mode and why; the share used of the session and the day; and the ways on.
|
|
@@ -83,6 +149,54 @@ export const AiApiAxiosParamCreator = function (configuration) {
|
|
|
83
149
|
options: localVarRequestOptions,
|
|
84
150
|
};
|
|
85
151
|
},
|
|
152
|
+
/**
|
|
153
|
+
* Searches the model catalog — the one GET /v1/models lists — by text, class, family or capability, and answers each match with its class, family, list price (per token and per million; variable for a router billed at the answering model\'s price), context window and capabilities.
|
|
154
|
+
* @summary Searches the model catalog — the one GET /v1/models lists — by text, class, family or capability, and answers each match with its class, family, list price (per token and per million; variable for a router billed at the answering model\'s price), context window and capabilities.
|
|
155
|
+
* @param {string} [q] Q matches the model\'s id, name, description or owner, ignoring case.
|
|
156
|
+
* @param {string} [_class] Class keeps one class: premium (third-party frontier models), ours (Hanzo\'s priced models) or free.
|
|
157
|
+
* @param {string} [family] Family keeps one Hanzo family: enso, zen, kai or zoo.
|
|
158
|
+
* @param {string} [capability] Capability keeps the models that have it: tools, vision or reasoning, or a modality they take or give (text, image, audio, file, video, decision).
|
|
159
|
+
* @param {number} [limit] Limit is the most models to answer, 1 to 500; 0 answers 50.
|
|
160
|
+
* @param {*} [options] Override http request option.
|
|
161
|
+
* @throws {RequiredError}
|
|
162
|
+
*/
|
|
163
|
+
aiModels: async (q, _class, family, capability, limit, options = {}) => {
|
|
164
|
+
const localVarPath = `/v1/ai/mcp/models`;
|
|
165
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
166
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
167
|
+
let baseOptions;
|
|
168
|
+
if (configuration) {
|
|
169
|
+
baseOptions = configuration.baseOptions;
|
|
170
|
+
}
|
|
171
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
172
|
+
const localVarHeaderParameter = {};
|
|
173
|
+
const localVarQueryParameter = {};
|
|
174
|
+
// authentication bearer required
|
|
175
|
+
// http bearer authentication required
|
|
176
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
177
|
+
if (q !== undefined) {
|
|
178
|
+
localVarQueryParameter['q'] = q;
|
|
179
|
+
}
|
|
180
|
+
if (_class !== undefined) {
|
|
181
|
+
localVarQueryParameter['class'] = _class;
|
|
182
|
+
}
|
|
183
|
+
if (family !== undefined) {
|
|
184
|
+
localVarQueryParameter['family'] = family;
|
|
185
|
+
}
|
|
186
|
+
if (capability !== undefined) {
|
|
187
|
+
localVarQueryParameter['capability'] = capability;
|
|
188
|
+
}
|
|
189
|
+
if (limit !== undefined) {
|
|
190
|
+
localVarQueryParameter['limit'] = limit;
|
|
191
|
+
}
|
|
192
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
193
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
194
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
195
|
+
return {
|
|
196
|
+
url: toPathString(localVarUrlObj),
|
|
197
|
+
options: localVarRequestOptions,
|
|
198
|
+
};
|
|
199
|
+
},
|
|
86
200
|
/**
|
|
87
201
|
* Sets the payer\'s choice to keep using a model on credits once the plan\'s included usage of it is spent. A pooled org wallet is its org admin\'s to set; a person\'s own wallet is theirs. Every change is on the audit trail, before and after; no trail, no change. Answers the limits as they read after it.
|
|
88
202
|
* @summary Sets the payer\'s choice to keep using a model on credits once the plan\'s included usage of it is spent.
|
|
@@ -6344,10 +6458,13 @@ export const AiApiAxiosParamCreator = function (configuration) {
|
|
|
6344
6458
|
/**
|
|
6345
6459
|
* Attaches a per-request outcome reward to the routing decision that served request_id — the enso training loop\'s quality signal. Org-scoped via the same session-OR-Bearer principal the usage read uses (RequirePrincipal): the reward lands only on the caller\'s OWN org\'s event, so a request_id from another org (or unknown) is a 404 — cross-org writes are impossible and unknown ids are indistinguishable from foreign ones. Idempotent: a repeat overwrites. The body carries NO prompt text — only {request_id, reward|rating}.
|
|
6346
6460
|
* @summary Attaches a per-request outcome reward to the routing decision that served request_id — the enso training loop\'s quality signal.
|
|
6461
|
+
* @param {AiRoutingRewardRequest} aiRoutingRewardRequest
|
|
6347
6462
|
* @param {*} [options] Override http request option.
|
|
6348
6463
|
* @throws {RequiredError}
|
|
6349
6464
|
*/
|
|
6350
|
-
postAiFeedback: async (options = {}) => {
|
|
6465
|
+
postAiFeedback: async (aiRoutingRewardRequest, options = {}) => {
|
|
6466
|
+
// verify required parameter 'aiRoutingRewardRequest' is not null or undefined
|
|
6467
|
+
assertParamExists('postAiFeedback', 'aiRoutingRewardRequest', aiRoutingRewardRequest);
|
|
6351
6468
|
const localVarPath = `/v1/ai/feedback`;
|
|
6352
6469
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
6353
6470
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
@@ -6361,9 +6478,11 @@ export const AiApiAxiosParamCreator = function (configuration) {
|
|
|
6361
6478
|
// authentication bearer required
|
|
6362
6479
|
// http bearer authentication required
|
|
6363
6480
|
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
6481
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
6364
6482
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
6365
6483
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
6366
6484
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
6485
|
+
localVarRequestOptions.data = serializeDataIfNeeded(aiRoutingRewardRequest, localVarRequestOptions, configuration);
|
|
6367
6486
|
return {
|
|
6368
6487
|
url: toPathString(localVarUrlObj),
|
|
6369
6488
|
options: localVarRequestOptions,
|
|
@@ -8415,10 +8534,12 @@ export const AiApiAxiosParamCreator = function (configuration) {
|
|
|
8415
8534
|
* Implements the OpenAI-compatible chat completions API
|
|
8416
8535
|
* @summary Implements the OpenAI-compatible chat completions API
|
|
8417
8536
|
* @param {OpenaiChatCompletionRequest} openaiChatCompletionRequest
|
|
8537
|
+
* @param {number} [xMaxCost] The most this request may cost, in USD per 1,000 tokens. Routing picks only models under it; an org\'s own ceiling fills it when it is absent, and the lower of the two holds.
|
|
8538
|
+
* @param {number} [xMaxLatencyMs] The slowest model this request accepts, in milliseconds.
|
|
8418
8539
|
* @param {*} [options] Override http request option.
|
|
8419
8540
|
* @throws {RequiredError}
|
|
8420
8541
|
*/
|
|
8421
|
-
postChat: async (openaiChatCompletionRequest, options = {}) => {
|
|
8542
|
+
postChat: async (openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options = {}) => {
|
|
8422
8543
|
// verify required parameter 'openaiChatCompletionRequest' is not null or undefined
|
|
8423
8544
|
assertParamExists('postChat', 'openaiChatCompletionRequest', openaiChatCompletionRequest);
|
|
8424
8545
|
const localVarPath = `/v1/chat`;
|
|
@@ -8435,6 +8556,16 @@ export const AiApiAxiosParamCreator = function (configuration) {
|
|
|
8435
8556
|
// http bearer authentication required
|
|
8436
8557
|
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
8437
8558
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
8559
|
+
if (xMaxCost != null) {
|
|
8560
|
+
localVarHeaderParameter['X-Max-Cost'] = typeof xMaxCost === 'string'
|
|
8561
|
+
? xMaxCost
|
|
8562
|
+
: JSON.stringify(xMaxCost);
|
|
8563
|
+
}
|
|
8564
|
+
if (xMaxLatencyMs != null) {
|
|
8565
|
+
localVarHeaderParameter['X-Max-Latency-Ms'] = typeof xMaxLatencyMs === 'string'
|
|
8566
|
+
? xMaxLatencyMs
|
|
8567
|
+
: JSON.stringify(xMaxLatencyMs);
|
|
8568
|
+
}
|
|
8438
8569
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
8439
8570
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
8440
8571
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
@@ -8448,10 +8579,12 @@ export const AiApiAxiosParamCreator = function (configuration) {
|
|
|
8448
8579
|
* Implements the OpenAI-compatible chat completions API
|
|
8449
8580
|
* @summary Implements the OpenAI-compatible chat completions API
|
|
8450
8581
|
* @param {OpenaiChatCompletionRequest} openaiChatCompletionRequest
|
|
8582
|
+
* @param {number} [xMaxCost] The most this request may cost, in USD per 1,000 tokens. Routing picks only models under it; an org\'s own ceiling fills it when it is absent, and the lower of the two holds.
|
|
8583
|
+
* @param {number} [xMaxLatencyMs] The slowest model this request accepts, in milliseconds.
|
|
8451
8584
|
* @param {*} [options] Override http request option.
|
|
8452
8585
|
* @throws {RequiredError}
|
|
8453
8586
|
*/
|
|
8454
|
-
postChatCompletions: async (openaiChatCompletionRequest, options = {}) => {
|
|
8587
|
+
postChatCompletions: async (openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options = {}) => {
|
|
8455
8588
|
// verify required parameter 'openaiChatCompletionRequest' is not null or undefined
|
|
8456
8589
|
assertParamExists('postChatCompletions', 'openaiChatCompletionRequest', openaiChatCompletionRequest);
|
|
8457
8590
|
const localVarPath = `/v1/chat/completions`;
|
|
@@ -8468,6 +8601,16 @@ export const AiApiAxiosParamCreator = function (configuration) {
|
|
|
8468
8601
|
// http bearer authentication required
|
|
8469
8602
|
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
8470
8603
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
8604
|
+
if (xMaxCost != null) {
|
|
8605
|
+
localVarHeaderParameter['X-Max-Cost'] = typeof xMaxCost === 'string'
|
|
8606
|
+
? xMaxCost
|
|
8607
|
+
: JSON.stringify(xMaxCost);
|
|
8608
|
+
}
|
|
8609
|
+
if (xMaxLatencyMs != null) {
|
|
8610
|
+
localVarHeaderParameter['X-Max-Latency-Ms'] = typeof xMaxLatencyMs === 'string'
|
|
8611
|
+
? xMaxLatencyMs
|
|
8612
|
+
: JSON.stringify(xMaxLatencyMs);
|
|
8613
|
+
}
|
|
8471
8614
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
8472
8615
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
8473
8616
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
@@ -8514,10 +8657,12 @@ export const AiApiAxiosParamCreator = function (configuration) {
|
|
|
8514
8657
|
* Implements the OpenAI-compatible chat completions API
|
|
8515
8658
|
* @summary Implements the OpenAI-compatible chat completions API
|
|
8516
8659
|
* @param {OpenaiChatCompletionRequest} openaiChatCompletionRequest
|
|
8660
|
+
* @param {number} [xMaxCost] The most this request may cost, in USD per 1,000 tokens. Routing picks only models under it; an org\'s own ceiling fills it when it is absent, and the lower of the two holds.
|
|
8661
|
+
* @param {number} [xMaxLatencyMs] The slowest model this request accepts, in milliseconds.
|
|
8517
8662
|
* @param {*} [options] Override http request option.
|
|
8518
8663
|
* @throws {RequiredError}
|
|
8519
8664
|
*/
|
|
8520
|
-
postCompletions: async (openaiChatCompletionRequest, options = {}) => {
|
|
8665
|
+
postCompletions: async (openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options = {}) => {
|
|
8521
8666
|
// verify required parameter 'openaiChatCompletionRequest' is not null or undefined
|
|
8522
8667
|
assertParamExists('postCompletions', 'openaiChatCompletionRequest', openaiChatCompletionRequest);
|
|
8523
8668
|
const localVarPath = `/v1/completions`;
|
|
@@ -8534,6 +8679,16 @@ export const AiApiAxiosParamCreator = function (configuration) {
|
|
|
8534
8679
|
// http bearer authentication required
|
|
8535
8680
|
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
8536
8681
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
8682
|
+
if (xMaxCost != null) {
|
|
8683
|
+
localVarHeaderParameter['X-Max-Cost'] = typeof xMaxCost === 'string'
|
|
8684
|
+
? xMaxCost
|
|
8685
|
+
: JSON.stringify(xMaxCost);
|
|
8686
|
+
}
|
|
8687
|
+
if (xMaxLatencyMs != null) {
|
|
8688
|
+
localVarHeaderParameter['X-Max-Latency-Ms'] = typeof xMaxLatencyMs === 'string'
|
|
8689
|
+
? xMaxLatencyMs
|
|
8690
|
+
: JSON.stringify(xMaxLatencyMs);
|
|
8691
|
+
}
|
|
8537
8692
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
8538
8693
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
8539
8694
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
@@ -8761,10 +8916,12 @@ export const AiApiAxiosParamCreator = function (configuration) {
|
|
|
8761
8916
|
/**
|
|
8762
8917
|
* Implements POST /v1/responses. The converted request is completed by the chat path, which is handed a sink saying where the answer goes: a stream is translated as it is produced, a whole body is translated entire.
|
|
8763
8918
|
* @summary Implements POST /v1/responses.
|
|
8919
|
+
* @param {number} [xMaxCost] The most this request may cost, in USD per 1,000 tokens. Routing picks only models under it; an org\'s own ceiling fills it when it is absent, and the lower of the two holds.
|
|
8920
|
+
* @param {number} [xMaxLatencyMs] The slowest model this request accepts, in milliseconds.
|
|
8764
8921
|
* @param {*} [options] Override http request option.
|
|
8765
8922
|
* @throws {RequiredError}
|
|
8766
8923
|
*/
|
|
8767
|
-
postResponses: async (options = {}) => {
|
|
8924
|
+
postResponses: async (xMaxCost, xMaxLatencyMs, options = {}) => {
|
|
8768
8925
|
const localVarPath = `/v1/responses`;
|
|
8769
8926
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
8770
8927
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
@@ -8778,6 +8935,16 @@ export const AiApiAxiosParamCreator = function (configuration) {
|
|
|
8778
8935
|
// authentication bearer required
|
|
8779
8936
|
// http bearer authentication required
|
|
8780
8937
|
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
8938
|
+
if (xMaxCost != null) {
|
|
8939
|
+
localVarHeaderParameter['X-Max-Cost'] = typeof xMaxCost === 'string'
|
|
8940
|
+
? xMaxCost
|
|
8941
|
+
: JSON.stringify(xMaxCost);
|
|
8942
|
+
}
|
|
8943
|
+
if (xMaxLatencyMs != null) {
|
|
8944
|
+
localVarHeaderParameter['X-Max-Latency-Ms'] = typeof xMaxLatencyMs === 'string'
|
|
8945
|
+
? xMaxLatencyMs
|
|
8946
|
+
: JSON.stringify(xMaxLatencyMs);
|
|
8947
|
+
}
|
|
8781
8948
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
8782
8949
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
8783
8950
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
@@ -10061,6 +10228,32 @@ export const AiApiAxiosParamCreator = function (configuration) {
|
|
|
10061
10228
|
export const AiApiFp = function (configuration) {
|
|
10062
10229
|
const localVarAxiosParamCreator = AiApiAxiosParamCreator(configuration);
|
|
10063
10230
|
return {
|
|
10231
|
+
/**
|
|
10232
|
+
* Asks one model one prompt and answers the reply, which model served it and who paid. The call is the caller\'s own POST /v1/chat/completions, run as the caller, so it is gated, billed and refused exactly as that route is; a refusal names its code and what lifts it, never an amount. An empty model asks the deployment\'s default Hanzo model.
|
|
10233
|
+
* @summary Asks one model one prompt and answers the reply, which model served it and who paid.
|
|
10234
|
+
* @param {AiChatIn} aiChatIn
|
|
10235
|
+
* @param {*} [options] Override http request option.
|
|
10236
|
+
* @throws {RequiredError}
|
|
10237
|
+
*/
|
|
10238
|
+
async aiChat(aiChatIn, options) {
|
|
10239
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.aiChat(aiChatIn, options);
|
|
10240
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
10241
|
+
const localVarOperationServerBasePath = operationServerMap['AiApi.aiChat']?.[localVarOperationServerIndex]?.url;
|
|
10242
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
10243
|
+
},
|
|
10244
|
+
/**
|
|
10245
|
+
* Runs one decision — the caller\'s own POST /v1/decisions, gated and billed exactly as that route is — and answers the decision, which model served it and who paid. A refusal names its code and what lifts it, never an amount.
|
|
10246
|
+
* @summary Runs one decision — the caller\'s own POST /v1/decisions, gated and billed exactly as that route is — and answers the decision, which model served it and who paid.
|
|
10247
|
+
* @param {AiDecideIn} aiDecideIn
|
|
10248
|
+
* @param {*} [options] Override http request option.
|
|
10249
|
+
* @throws {RequiredError}
|
|
10250
|
+
*/
|
|
10251
|
+
async aiDecide(aiDecideIn, options) {
|
|
10252
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.aiDecide(aiDecideIn, options);
|
|
10253
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
10254
|
+
const localVarOperationServerBasePath = operationServerMap['AiApi.aiDecide']?.[localVarOperationServerIndex]?.url;
|
|
10255
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
10256
|
+
},
|
|
10064
10257
|
/**
|
|
10065
10258
|
* Reads the caller\'s plan usage: for each class of model the plan includes, the share used of the billing period and of its short window, who pays for the next request, and whether the caller is in limited mode and why; the share used of the session and the day; and the ways on. Shares only, never amounts.
|
|
10066
10259
|
* @summary Reads the caller\'s plan usage: for each class of model the plan includes, the share used of the billing period and of its short window, who pays for the next request, and whether the caller is in limited mode and why; the share used of the session and the day; and the ways on.
|
|
@@ -10086,6 +10279,23 @@ export const AiApiFp = function (configuration) {
|
|
|
10086
10279
|
const localVarOperationServerBasePath = operationServerMap['AiApi.aiMCPTools']?.[localVarOperationServerIndex]?.url;
|
|
10087
10280
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
10088
10281
|
},
|
|
10282
|
+
/**
|
|
10283
|
+
* Searches the model catalog — the one GET /v1/models lists — by text, class, family or capability, and answers each match with its class, family, list price (per token and per million; variable for a router billed at the answering model\'s price), context window and capabilities.
|
|
10284
|
+
* @summary Searches the model catalog — the one GET /v1/models lists — by text, class, family or capability, and answers each match with its class, family, list price (per token and per million; variable for a router billed at the answering model\'s price), context window and capabilities.
|
|
10285
|
+
* @param {string} [q] Q matches the model\'s id, name, description or owner, ignoring case.
|
|
10286
|
+
* @param {string} [_class] Class keeps one class: premium (third-party frontier models), ours (Hanzo\'s priced models) or free.
|
|
10287
|
+
* @param {string} [family] Family keeps one Hanzo family: enso, zen, kai or zoo.
|
|
10288
|
+
* @param {string} [capability] Capability keeps the models that have it: tools, vision or reasoning, or a modality they take or give (text, image, audio, file, video, decision).
|
|
10289
|
+
* @param {number} [limit] Limit is the most models to answer, 1 to 500; 0 answers 50.
|
|
10290
|
+
* @param {*} [options] Override http request option.
|
|
10291
|
+
* @throws {RequiredError}
|
|
10292
|
+
*/
|
|
10293
|
+
async aiModels(q, _class, family, capability, limit, options) {
|
|
10294
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.aiModels(q, _class, family, capability, limit, options);
|
|
10295
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
10296
|
+
const localVarOperationServerBasePath = operationServerMap['AiApi.aiModels']?.[localVarOperationServerIndex]?.url;
|
|
10297
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
10298
|
+
},
|
|
10089
10299
|
/**
|
|
10090
10300
|
* Sets the payer\'s choice to keep using a model on credits once the plan\'s included usage of it is spent. A pooled org wallet is its org admin\'s to set; a person\'s own wallet is theirs. Every change is on the audit trail, before and after; no trail, no change. Answers the limits as they read after it.
|
|
10091
10301
|
* @summary Sets the payer\'s choice to keep using a model on credits once the plan\'s included usage of it is spent.
|
|
@@ -12620,11 +12830,12 @@ export const AiApiFp = function (configuration) {
|
|
|
12620
12830
|
/**
|
|
12621
12831
|
* Attaches a per-request outcome reward to the routing decision that served request_id — the enso training loop\'s quality signal. Org-scoped via the same session-OR-Bearer principal the usage read uses (RequirePrincipal): the reward lands only on the caller\'s OWN org\'s event, so a request_id from another org (or unknown) is a 404 — cross-org writes are impossible and unknown ids are indistinguishable from foreign ones. Idempotent: a repeat overwrites. The body carries NO prompt text — only {request_id, reward|rating}.
|
|
12622
12832
|
* @summary Attaches a per-request outcome reward to the routing decision that served request_id — the enso training loop\'s quality signal.
|
|
12833
|
+
* @param {AiRoutingRewardRequest} aiRoutingRewardRequest
|
|
12623
12834
|
* @param {*} [options] Override http request option.
|
|
12624
12835
|
* @throws {RequiredError}
|
|
12625
12836
|
*/
|
|
12626
|
-
async postAiFeedback(options) {
|
|
12627
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.postAiFeedback(options);
|
|
12837
|
+
async postAiFeedback(aiRoutingRewardRequest, options) {
|
|
12838
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.postAiFeedback(aiRoutingRewardRequest, options);
|
|
12628
12839
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
12629
12840
|
const localVarOperationServerBasePath = operationServerMap['AiApi.postAiFeedback']?.[localVarOperationServerIndex]?.url;
|
|
12630
12841
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -13454,11 +13665,13 @@ export const AiApiFp = function (configuration) {
|
|
|
13454
13665
|
* Implements the OpenAI-compatible chat completions API
|
|
13455
13666
|
* @summary Implements the OpenAI-compatible chat completions API
|
|
13456
13667
|
* @param {OpenaiChatCompletionRequest} openaiChatCompletionRequest
|
|
13668
|
+
* @param {number} [xMaxCost] The most this request may cost, in USD per 1,000 tokens. Routing picks only models under it; an org\'s own ceiling fills it when it is absent, and the lower of the two holds.
|
|
13669
|
+
* @param {number} [xMaxLatencyMs] The slowest model this request accepts, in milliseconds.
|
|
13457
13670
|
* @param {*} [options] Override http request option.
|
|
13458
13671
|
* @throws {RequiredError}
|
|
13459
13672
|
*/
|
|
13460
|
-
async postChat(openaiChatCompletionRequest, options) {
|
|
13461
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.postChat(openaiChatCompletionRequest, options);
|
|
13673
|
+
async postChat(openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options) {
|
|
13674
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.postChat(openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options);
|
|
13462
13675
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
13463
13676
|
const localVarOperationServerBasePath = operationServerMap['AiApi.postChat']?.[localVarOperationServerIndex]?.url;
|
|
13464
13677
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -13467,11 +13680,13 @@ export const AiApiFp = function (configuration) {
|
|
|
13467
13680
|
* Implements the OpenAI-compatible chat completions API
|
|
13468
13681
|
* @summary Implements the OpenAI-compatible chat completions API
|
|
13469
13682
|
* @param {OpenaiChatCompletionRequest} openaiChatCompletionRequest
|
|
13683
|
+
* @param {number} [xMaxCost] The most this request may cost, in USD per 1,000 tokens. Routing picks only models under it; an org\'s own ceiling fills it when it is absent, and the lower of the two holds.
|
|
13684
|
+
* @param {number} [xMaxLatencyMs] The slowest model this request accepts, in milliseconds.
|
|
13470
13685
|
* @param {*} [options] Override http request option.
|
|
13471
13686
|
* @throws {RequiredError}
|
|
13472
13687
|
*/
|
|
13473
|
-
async postChatCompletions(openaiChatCompletionRequest, options) {
|
|
13474
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.postChatCompletions(openaiChatCompletionRequest, options);
|
|
13688
|
+
async postChatCompletions(openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options) {
|
|
13689
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.postChatCompletions(openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options);
|
|
13475
13690
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
13476
13691
|
const localVarOperationServerBasePath = operationServerMap['AiApi.postChatCompletions']?.[localVarOperationServerIndex]?.url;
|
|
13477
13692
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -13493,11 +13708,13 @@ export const AiApiFp = function (configuration) {
|
|
|
13493
13708
|
* Implements the OpenAI-compatible chat completions API
|
|
13494
13709
|
* @summary Implements the OpenAI-compatible chat completions API
|
|
13495
13710
|
* @param {OpenaiChatCompletionRequest} openaiChatCompletionRequest
|
|
13711
|
+
* @param {number} [xMaxCost] The most this request may cost, in USD per 1,000 tokens. Routing picks only models under it; an org\'s own ceiling fills it when it is absent, and the lower of the two holds.
|
|
13712
|
+
* @param {number} [xMaxLatencyMs] The slowest model this request accepts, in milliseconds.
|
|
13496
13713
|
* @param {*} [options] Override http request option.
|
|
13497
13714
|
* @throws {RequiredError}
|
|
13498
13715
|
*/
|
|
13499
|
-
async postCompletions(openaiChatCompletionRequest, options) {
|
|
13500
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.postCompletions(openaiChatCompletionRequest, options);
|
|
13716
|
+
async postCompletions(openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options) {
|
|
13717
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.postCompletions(openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options);
|
|
13501
13718
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
13502
13719
|
const localVarOperationServerBasePath = operationServerMap['AiApi.postCompletions']?.[localVarOperationServerIndex]?.url;
|
|
13503
13720
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -13593,11 +13810,13 @@ export const AiApiFp = function (configuration) {
|
|
|
13593
13810
|
/**
|
|
13594
13811
|
* Implements POST /v1/responses. The converted request is completed by the chat path, which is handed a sink saying where the answer goes: a stream is translated as it is produced, a whole body is translated entire.
|
|
13595
13812
|
* @summary Implements POST /v1/responses.
|
|
13813
|
+
* @param {number} [xMaxCost] The most this request may cost, in USD per 1,000 tokens. Routing picks only models under it; an org\'s own ceiling fills it when it is absent, and the lower of the two holds.
|
|
13814
|
+
* @param {number} [xMaxLatencyMs] The slowest model this request accepts, in milliseconds.
|
|
13596
13815
|
* @param {*} [options] Override http request option.
|
|
13597
13816
|
* @throws {RequiredError}
|
|
13598
13817
|
*/
|
|
13599
|
-
async postResponses(options) {
|
|
13600
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.postResponses(options);
|
|
13818
|
+
async postResponses(xMaxCost, xMaxLatencyMs, options) {
|
|
13819
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.postResponses(xMaxCost, xMaxLatencyMs, options);
|
|
13601
13820
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
13602
13821
|
const localVarOperationServerBasePath = operationServerMap['AiApi.postResponses']?.[localVarOperationServerIndex]?.url;
|
|
13603
13822
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -14091,6 +14310,26 @@ export const AiApiFp = function (configuration) {
|
|
|
14091
14310
|
export const AiApiFactory = function (configuration, basePath, axios) {
|
|
14092
14311
|
const localVarFp = AiApiFp(configuration);
|
|
14093
14312
|
return {
|
|
14313
|
+
/**
|
|
14314
|
+
* Asks one model one prompt and answers the reply, which model served it and who paid. The call is the caller\'s own POST /v1/chat/completions, run as the caller, so it is gated, billed and refused exactly as that route is; a refusal names its code and what lifts it, never an amount. An empty model asks the deployment\'s default Hanzo model.
|
|
14315
|
+
* @summary Asks one model one prompt and answers the reply, which model served it and who paid.
|
|
14316
|
+
* @param {AiApiAiChatRequest} requestParameters Request parameters.
|
|
14317
|
+
* @param {*} [options] Override http request option.
|
|
14318
|
+
* @throws {RequiredError}
|
|
14319
|
+
*/
|
|
14320
|
+
aiChat(requestParameters, options) {
|
|
14321
|
+
return localVarFp.aiChat(requestParameters.aiChatIn, options).then((request) => request(axios, basePath));
|
|
14322
|
+
},
|
|
14323
|
+
/**
|
|
14324
|
+
* Runs one decision — the caller\'s own POST /v1/decisions, gated and billed exactly as that route is — and answers the decision, which model served it and who paid. A refusal names its code and what lifts it, never an amount.
|
|
14325
|
+
* @summary Runs one decision — the caller\'s own POST /v1/decisions, gated and billed exactly as that route is — and answers the decision, which model served it and who paid.
|
|
14326
|
+
* @param {AiApiAiDecideRequest} requestParameters Request parameters.
|
|
14327
|
+
* @param {*} [options] Override http request option.
|
|
14328
|
+
* @throws {RequiredError}
|
|
14329
|
+
*/
|
|
14330
|
+
aiDecide(requestParameters, options) {
|
|
14331
|
+
return localVarFp.aiDecide(requestParameters.aiDecideIn, options).then((request) => request(axios, basePath));
|
|
14332
|
+
},
|
|
14094
14333
|
/**
|
|
14095
14334
|
* Reads the caller\'s plan usage: for each class of model the plan includes, the share used of the billing period and of its short window, who pays for the next request, and whether the caller is in limited mode and why; the share used of the session and the day; and the ways on. Shares only, never amounts.
|
|
14096
14335
|
* @summary Reads the caller\'s plan usage: for each class of model the plan includes, the share used of the billing period and of its short window, who pays for the next request, and whether the caller is in limited mode and why; the share used of the session and the day; and the ways on.
|
|
@@ -14110,6 +14349,16 @@ export const AiApiFactory = function (configuration, basePath, axios) {
|
|
|
14110
14349
|
aiMCPTools(requestParameters = {}, options) {
|
|
14111
14350
|
return localVarFp.aiMCPTools(requestParameters.names, options).then((request) => request(axios, basePath));
|
|
14112
14351
|
},
|
|
14352
|
+
/**
|
|
14353
|
+
* Searches the model catalog — the one GET /v1/models lists — by text, class, family or capability, and answers each match with its class, family, list price (per token and per million; variable for a router billed at the answering model\'s price), context window and capabilities.
|
|
14354
|
+
* @summary Searches the model catalog — the one GET /v1/models lists — by text, class, family or capability, and answers each match with its class, family, list price (per token and per million; variable for a router billed at the answering model\'s price), context window and capabilities.
|
|
14355
|
+
* @param {AiApiAiModelsRequest} requestParameters Request parameters.
|
|
14356
|
+
* @param {*} [options] Override http request option.
|
|
14357
|
+
* @throws {RequiredError}
|
|
14358
|
+
*/
|
|
14359
|
+
aiModels(requestParameters = {}, options) {
|
|
14360
|
+
return localVarFp.aiModels(requestParameters.q, requestParameters._class, requestParameters.family, requestParameters.capability, requestParameters.limit, options).then((request) => request(axios, basePath));
|
|
14361
|
+
},
|
|
14113
14362
|
/**
|
|
14114
14363
|
* Sets the payer\'s choice to keep using a model on credits once the plan\'s included usage of it is spent. A pooled org wallet is its org admin\'s to set; a person\'s own wallet is theirs. Every change is on the audit trail, before and after; no trail, no change. Answers the limits as they read after it.
|
|
14115
14364
|
* @summary Sets the payer\'s choice to keep using a model on credits once the plan\'s included usage of it is spent.
|
|
@@ -15960,11 +16209,12 @@ export const AiApiFactory = function (configuration, basePath, axios) {
|
|
|
15960
16209
|
/**
|
|
15961
16210
|
* Attaches a per-request outcome reward to the routing decision that served request_id — the enso training loop\'s quality signal. Org-scoped via the same session-OR-Bearer principal the usage read uses (RequirePrincipal): the reward lands only on the caller\'s OWN org\'s event, so a request_id from another org (or unknown) is a 404 — cross-org writes are impossible and unknown ids are indistinguishable from foreign ones. Idempotent: a repeat overwrites. The body carries NO prompt text — only {request_id, reward|rating}.
|
|
15962
16211
|
* @summary Attaches a per-request outcome reward to the routing decision that served request_id — the enso training loop\'s quality signal.
|
|
16212
|
+
* @param {AiApiPostAiFeedbackRequest} requestParameters Request parameters.
|
|
15963
16213
|
* @param {*} [options] Override http request option.
|
|
15964
16214
|
* @throws {RequiredError}
|
|
15965
16215
|
*/
|
|
15966
|
-
postAiFeedback(options) {
|
|
15967
|
-
return localVarFp.postAiFeedback(options).then((request) => request(axios, basePath));
|
|
16216
|
+
postAiFeedback(requestParameters, options) {
|
|
16217
|
+
return localVarFp.postAiFeedback(requestParameters.aiRoutingRewardRequest, options).then((request) => request(axios, basePath));
|
|
15968
16218
|
},
|
|
15969
16219
|
/**
|
|
15970
16220
|
* Create one file.
|
|
@@ -16589,7 +16839,7 @@ export const AiApiFactory = function (configuration, basePath, axios) {
|
|
|
16589
16839
|
* @throws {RequiredError}
|
|
16590
16840
|
*/
|
|
16591
16841
|
postChat(requestParameters, options) {
|
|
16592
|
-
return localVarFp.postChat(requestParameters.openaiChatCompletionRequest, options).then((request) => request(axios, basePath));
|
|
16842
|
+
return localVarFp.postChat(requestParameters.openaiChatCompletionRequest, requestParameters.xMaxCost, requestParameters.xMaxLatencyMs, options).then((request) => request(axios, basePath));
|
|
16593
16843
|
},
|
|
16594
16844
|
/**
|
|
16595
16845
|
* Implements the OpenAI-compatible chat completions API
|
|
@@ -16599,7 +16849,7 @@ export const AiApiFactory = function (configuration, basePath, axios) {
|
|
|
16599
16849
|
* @throws {RequiredError}
|
|
16600
16850
|
*/
|
|
16601
16851
|
postChatCompletions(requestParameters, options) {
|
|
16602
|
-
return localVarFp.postChatCompletions(requestParameters.openaiChatCompletionRequest, options).then((request) => request(axios, basePath));
|
|
16852
|
+
return localVarFp.postChatCompletions(requestParameters.openaiChatCompletionRequest, requestParameters.xMaxCost, requestParameters.xMaxLatencyMs, options).then((request) => request(axios, basePath));
|
|
16603
16853
|
},
|
|
16604
16854
|
/**
|
|
16605
16855
|
* Serves one completion to a caller with no account.
|
|
@@ -16619,7 +16869,7 @@ export const AiApiFactory = function (configuration, basePath, axios) {
|
|
|
16619
16869
|
* @throws {RequiredError}
|
|
16620
16870
|
*/
|
|
16621
16871
|
postCompletions(requestParameters, options) {
|
|
16622
|
-
return localVarFp.postCompletions(requestParameters.openaiChatCompletionRequest, options).then((request) => request(axios, basePath));
|
|
16872
|
+
return localVarFp.postCompletions(requestParameters.openaiChatCompletionRequest, requestParameters.xMaxCost, requestParameters.xMaxLatencyMs, options).then((request) => request(axios, basePath));
|
|
16623
16873
|
},
|
|
16624
16874
|
/**
|
|
16625
16875
|
* Implements POST /v1/decisions (the Decisions API). Body: {\"model\": \"kai\", \"state\": \"...\"|{...}|[...], \"questions\": {\"<name>\": {\"type\": \"choice\"|\"noul\"|\"score\", \"instructions\": ..., \"criteria\": ...}}}. model is kai, Kai\'s versioned id kai-<12 hex of the weights\' sha256> — priced as kai and sent as asked — or Jev by OpenRouter\'s vendor ids, typesafe/jev-1.13 and ~typesafe/jev-latest, which reach Jev itself and bill at Jev\'s list price. No Jev id is ever answered by Kai: a bare one, such as jev-latest, is an unknown model. model is required; state and questions are required unless the request names a handle, which carries neither. instructions is optional and any JSON. A choice names at least 2 labels and a score at least 1 level, bounded by the token budget rather than a count; questions holds 1 to 100. observe holds the state under an id, and a later request naming that id as its handle decides over it again. An id is 1 to 128 characters of A-Z, a-z, 0-9, \'.\', \'_\' and \'-\'. A handle belongs to the org that observed it: no other org\'s request can name it. Response: {\"id\",\"model\",\"provider\",\"answers\":{\"<name>\":{\"type\",...}}, \"usage\":{\"input_tokens\",\"output_tokens\"},\"routing\",\"state_hash\",\"latency_ms\"}. usage.input_tokens is the billed count — the request\'s text counted once, the state once and each question\'s instructions and options once; a decision over a handle bills the state once, when it was observed. The body may be sent gzip, deflate, br or zstd encoded; decoded, it is bounded as sent. Refusals are {\"error\":{\"code\",\"message\"}}: 400 malformed JSON or unknown model, 401 no valid credential, 402 insufficient balance, 403 a key kind that may not call this (pk-), 415 any other Content-Encoding, 422 an invalid question or handle id, a state beyond the checkpoint\'s reach (code state_too_long) or a body past 16 MiB (code request_too_long), 429 rate limited or queue full, 502 the service failed, 503 the model is known and not served, 529 overloaded. 402, 429 and 529 carry Retry-After and Retry-After-Ms, and every answer carries X-Request-Id. Billed on the answer\'s input tokens at the model\'s price.
|
|
@@ -16691,11 +16941,12 @@ export const AiApiFactory = function (configuration, basePath, axios) {
|
|
|
16691
16941
|
/**
|
|
16692
16942
|
* Implements POST /v1/responses. The converted request is completed by the chat path, which is handed a sink saying where the answer goes: a stream is translated as it is produced, a whole body is translated entire.
|
|
16693
16943
|
* @summary Implements POST /v1/responses.
|
|
16944
|
+
* @param {AiApiPostResponsesRequest} requestParameters Request parameters.
|
|
16694
16945
|
* @param {*} [options] Override http request option.
|
|
16695
16946
|
* @throws {RequiredError}
|
|
16696
16947
|
*/
|
|
16697
|
-
postResponses(options) {
|
|
16698
|
-
return localVarFp.postResponses(options).then((request) => request(axios, basePath));
|
|
16948
|
+
postResponses(requestParameters = {}, options) {
|
|
16949
|
+
return localVarFp.postResponses(requestParameters.xMaxCost, requestParameters.xMaxLatencyMs, options).then((request) => request(axios, basePath));
|
|
16699
16950
|
},
|
|
16700
16951
|
/**
|
|
16701
16952
|
* Implements POST /v1/videos/generations — the ASYNC create. Body: {\"model\": \"...\", \"prompt\": \"...\", \"size\"?: \"1280x720\", \"seconds\"?: int} It authenticates the caller, resolves the model to its upstream provider via the shared routing table (zen3-video* / wan2-2-t2v-a14b → the spark-video backend), reserves the per-video budget (the balance gate), creates ONE upstream job, registers it in the in-pod store, and returns the OpenAI-shaped video object with status \"queued\" IMMEDIATELY. The client then polls GET /v1/videos/{id} and downloads GET /v1/videos/{id}/content. Nothing is billed here — the debit lands on completion.
|
|
@@ -17038,6 +17289,28 @@ export const AiApiFactory = function (configuration, basePath, axios) {
|
|
|
17038
17289
|
* @extends {BaseAPI}
|
|
17039
17290
|
*/
|
|
17040
17291
|
export class AiApi extends BaseAPI {
|
|
17292
|
+
/**
|
|
17293
|
+
* Asks one model one prompt and answers the reply, which model served it and who paid. The call is the caller\'s own POST /v1/chat/completions, run as the caller, so it is gated, billed and refused exactly as that route is; a refusal names its code and what lifts it, never an amount. An empty model asks the deployment\'s default Hanzo model.
|
|
17294
|
+
* @summary Asks one model one prompt and answers the reply, which model served it and who paid.
|
|
17295
|
+
* @param {AiApiAiChatRequest} requestParameters Request parameters.
|
|
17296
|
+
* @param {*} [options] Override http request option.
|
|
17297
|
+
* @throws {RequiredError}
|
|
17298
|
+
* @memberof AiApi
|
|
17299
|
+
*/
|
|
17300
|
+
aiChat(requestParameters, options) {
|
|
17301
|
+
return AiApiFp(this.configuration).aiChat(requestParameters.aiChatIn, options).then((request) => request(this.axios, this.basePath));
|
|
17302
|
+
}
|
|
17303
|
+
/**
|
|
17304
|
+
* Runs one decision — the caller\'s own POST /v1/decisions, gated and billed exactly as that route is — and answers the decision, which model served it and who paid. A refusal names its code and what lifts it, never an amount.
|
|
17305
|
+
* @summary Runs one decision — the caller\'s own POST /v1/decisions, gated and billed exactly as that route is — and answers the decision, which model served it and who paid.
|
|
17306
|
+
* @param {AiApiAiDecideRequest} requestParameters Request parameters.
|
|
17307
|
+
* @param {*} [options] Override http request option.
|
|
17308
|
+
* @throws {RequiredError}
|
|
17309
|
+
* @memberof AiApi
|
|
17310
|
+
*/
|
|
17311
|
+
aiDecide(requestParameters, options) {
|
|
17312
|
+
return AiApiFp(this.configuration).aiDecide(requestParameters.aiDecideIn, options).then((request) => request(this.axios, this.basePath));
|
|
17313
|
+
}
|
|
17041
17314
|
/**
|
|
17042
17315
|
* Reads the caller\'s plan usage: for each class of model the plan includes, the share used of the billing period and of its short window, who pays for the next request, and whether the caller is in limited mode and why; the share used of the session and the day; and the ways on. Shares only, never amounts.
|
|
17043
17316
|
* @summary Reads the caller\'s plan usage: for each class of model the plan includes, the share used of the billing period and of its short window, who pays for the next request, and whether the caller is in limited mode and why; the share used of the session and the day; and the ways on.
|
|
@@ -17059,6 +17332,17 @@ export class AiApi extends BaseAPI {
|
|
|
17059
17332
|
aiMCPTools(requestParameters = {}, options) {
|
|
17060
17333
|
return AiApiFp(this.configuration).aiMCPTools(requestParameters.names, options).then((request) => request(this.axios, this.basePath));
|
|
17061
17334
|
}
|
|
17335
|
+
/**
|
|
17336
|
+
* Searches the model catalog — the one GET /v1/models lists — by text, class, family or capability, and answers each match with its class, family, list price (per token and per million; variable for a router billed at the answering model\'s price), context window and capabilities.
|
|
17337
|
+
* @summary Searches the model catalog — the one GET /v1/models lists — by text, class, family or capability, and answers each match with its class, family, list price (per token and per million; variable for a router billed at the answering model\'s price), context window and capabilities.
|
|
17338
|
+
* @param {AiApiAiModelsRequest} requestParameters Request parameters.
|
|
17339
|
+
* @param {*} [options] Override http request option.
|
|
17340
|
+
* @throws {RequiredError}
|
|
17341
|
+
* @memberof AiApi
|
|
17342
|
+
*/
|
|
17343
|
+
aiModels(requestParameters = {}, options) {
|
|
17344
|
+
return AiApiFp(this.configuration).aiModels(requestParameters.q, requestParameters._class, requestParameters.family, requestParameters.capability, requestParameters.limit, options).then((request) => request(this.axios, this.basePath));
|
|
17345
|
+
}
|
|
17062
17346
|
/**
|
|
17063
17347
|
* Sets the payer\'s choice to keep using a model on credits once the plan\'s included usage of it is spent. A pooled org wallet is its org admin\'s to set; a person\'s own wallet is theirs. Every change is on the audit trail, before and after; no trail, no change. Answers the limits as they read after it.
|
|
17064
17348
|
* @summary Sets the payer\'s choice to keep using a model on credits once the plan\'s included usage of it is spent.
|
|
@@ -19104,12 +19388,13 @@ export class AiApi extends BaseAPI {
|
|
|
19104
19388
|
/**
|
|
19105
19389
|
* Attaches a per-request outcome reward to the routing decision that served request_id — the enso training loop\'s quality signal. Org-scoped via the same session-OR-Bearer principal the usage read uses (RequirePrincipal): the reward lands only on the caller\'s OWN org\'s event, so a request_id from another org (or unknown) is a 404 — cross-org writes are impossible and unknown ids are indistinguishable from foreign ones. Idempotent: a repeat overwrites. The body carries NO prompt text — only {request_id, reward|rating}.
|
|
19106
19390
|
* @summary Attaches a per-request outcome reward to the routing decision that served request_id — the enso training loop\'s quality signal.
|
|
19391
|
+
* @param {AiApiPostAiFeedbackRequest} requestParameters Request parameters.
|
|
19107
19392
|
* @param {*} [options] Override http request option.
|
|
19108
19393
|
* @throws {RequiredError}
|
|
19109
19394
|
* @memberof AiApi
|
|
19110
19395
|
*/
|
|
19111
|
-
postAiFeedback(options) {
|
|
19112
|
-
return AiApiFp(this.configuration).postAiFeedback(options).then((request) => request(this.axios, this.basePath));
|
|
19396
|
+
postAiFeedback(requestParameters, options) {
|
|
19397
|
+
return AiApiFp(this.configuration).postAiFeedback(requestParameters.aiRoutingRewardRequest, options).then((request) => request(this.axios, this.basePath));
|
|
19113
19398
|
}
|
|
19114
19399
|
/**
|
|
19115
19400
|
* Create one file.
|
|
@@ -19799,7 +20084,7 @@ export class AiApi extends BaseAPI {
|
|
|
19799
20084
|
* @memberof AiApi
|
|
19800
20085
|
*/
|
|
19801
20086
|
postChat(requestParameters, options) {
|
|
19802
|
-
return AiApiFp(this.configuration).postChat(requestParameters.openaiChatCompletionRequest, options).then((request) => request(this.axios, this.basePath));
|
|
20087
|
+
return AiApiFp(this.configuration).postChat(requestParameters.openaiChatCompletionRequest, requestParameters.xMaxCost, requestParameters.xMaxLatencyMs, options).then((request) => request(this.axios, this.basePath));
|
|
19803
20088
|
}
|
|
19804
20089
|
/**
|
|
19805
20090
|
* Implements the OpenAI-compatible chat completions API
|
|
@@ -19810,7 +20095,7 @@ export class AiApi extends BaseAPI {
|
|
|
19810
20095
|
* @memberof AiApi
|
|
19811
20096
|
*/
|
|
19812
20097
|
postChatCompletions(requestParameters, options) {
|
|
19813
|
-
return AiApiFp(this.configuration).postChatCompletions(requestParameters.openaiChatCompletionRequest, options).then((request) => request(this.axios, this.basePath));
|
|
20098
|
+
return AiApiFp(this.configuration).postChatCompletions(requestParameters.openaiChatCompletionRequest, requestParameters.xMaxCost, requestParameters.xMaxLatencyMs, options).then((request) => request(this.axios, this.basePath));
|
|
19814
20099
|
}
|
|
19815
20100
|
/**
|
|
19816
20101
|
* Serves one completion to a caller with no account.
|
|
@@ -19832,7 +20117,7 @@ export class AiApi extends BaseAPI {
|
|
|
19832
20117
|
* @memberof AiApi
|
|
19833
20118
|
*/
|
|
19834
20119
|
postCompletions(requestParameters, options) {
|
|
19835
|
-
return AiApiFp(this.configuration).postCompletions(requestParameters.openaiChatCompletionRequest, options).then((request) => request(this.axios, this.basePath));
|
|
20120
|
+
return AiApiFp(this.configuration).postCompletions(requestParameters.openaiChatCompletionRequest, requestParameters.xMaxCost, requestParameters.xMaxLatencyMs, options).then((request) => request(this.axios, this.basePath));
|
|
19836
20121
|
}
|
|
19837
20122
|
/**
|
|
19838
20123
|
* Implements POST /v1/decisions (the Decisions API). Body: {\"model\": \"kai\", \"state\": \"...\"|{...}|[...], \"questions\": {\"<name>\": {\"type\": \"choice\"|\"noul\"|\"score\", \"instructions\": ..., \"criteria\": ...}}}. model is kai, Kai\'s versioned id kai-<12 hex of the weights\' sha256> — priced as kai and sent as asked — or Jev by OpenRouter\'s vendor ids, typesafe/jev-1.13 and ~typesafe/jev-latest, which reach Jev itself and bill at Jev\'s list price. No Jev id is ever answered by Kai: a bare one, such as jev-latest, is an unknown model. model is required; state and questions are required unless the request names a handle, which carries neither. instructions is optional and any JSON. A choice names at least 2 labels and a score at least 1 level, bounded by the token budget rather than a count; questions holds 1 to 100. observe holds the state under an id, and a later request naming that id as its handle decides over it again. An id is 1 to 128 characters of A-Z, a-z, 0-9, \'.\', \'_\' and \'-\'. A handle belongs to the org that observed it: no other org\'s request can name it. Response: {\"id\",\"model\",\"provider\",\"answers\":{\"<name>\":{\"type\",...}}, \"usage\":{\"input_tokens\",\"output_tokens\"},\"routing\",\"state_hash\",\"latency_ms\"}. usage.input_tokens is the billed count — the request\'s text counted once, the state once and each question\'s instructions and options once; a decision over a handle bills the state once, when it was observed. The body may be sent gzip, deflate, br or zstd encoded; decoded, it is bounded as sent. Refusals are {\"error\":{\"code\",\"message\"}}: 400 malformed JSON or unknown model, 401 no valid credential, 402 insufficient balance, 403 a key kind that may not call this (pk-), 415 any other Content-Encoding, 422 an invalid question or handle id, a state beyond the checkpoint\'s reach (code state_too_long) or a body past 16 MiB (code request_too_long), 429 rate limited or queue full, 502 the service failed, 503 the model is known and not served, 529 overloaded. 402, 429 and 529 carry Retry-After and Retry-After-Ms, and every answer carries X-Request-Id. Billed on the answer\'s input tokens at the model\'s price.
|
|
@@ -19911,12 +20196,13 @@ export class AiApi extends BaseAPI {
|
|
|
19911
20196
|
/**
|
|
19912
20197
|
* Implements POST /v1/responses. The converted request is completed by the chat path, which is handed a sink saying where the answer goes: a stream is translated as it is produced, a whole body is translated entire.
|
|
19913
20198
|
* @summary Implements POST /v1/responses.
|
|
20199
|
+
* @param {AiApiPostResponsesRequest} requestParameters Request parameters.
|
|
19914
20200
|
* @param {*} [options] Override http request option.
|
|
19915
20201
|
* @throws {RequiredError}
|
|
19916
20202
|
* @memberof AiApi
|
|
19917
20203
|
*/
|
|
19918
|
-
postResponses(options) {
|
|
19919
|
-
return AiApiFp(this.configuration).postResponses(options).then((request) => request(this.axios, this.basePath));
|
|
20204
|
+
postResponses(requestParameters = {}, options) {
|
|
20205
|
+
return AiApiFp(this.configuration).postResponses(requestParameters.xMaxCost, requestParameters.xMaxLatencyMs, options).then((request) => request(this.axios, this.basePath));
|
|
19920
20206
|
}
|
|
19921
20207
|
/**
|
|
19922
20208
|
* Implements POST /v1/videos/generations — the ASYNC create. Body: {\"model\": \"...\", \"prompt\": \"...\", \"size\"?: \"1280x720\", \"seconds\"?: int} It authenticates the caller, resolves the model to its upstream provider via the shared routing table (zen3-video* / wan2-2-t2v-a14b → the spark-video backend), reserves the per-video budget (the balance gate), creates ONE upstream job, registers it in the in-pod store, and returns the OpenAI-shaped video object with status \"queued\" IMMEDIATELY. The client then polls GET /v1/videos/{id} and downloads GET /v1/videos/{id}/content. Nothing is billed here — the debit lands on completion.
|