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/api/ai-api.js
CHANGED
|
@@ -29,6 +29,72 @@ const base_1 = require("../base");
|
|
|
29
29
|
*/
|
|
30
30
|
const AiApiAxiosParamCreator = function (configuration) {
|
|
31
31
|
return {
|
|
32
|
+
/**
|
|
33
|
+
* 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.
|
|
34
|
+
* @summary Asks one model one prompt and answers the reply, which model served it and who paid.
|
|
35
|
+
* @param {AiChatIn} aiChatIn
|
|
36
|
+
* @param {*} [options] Override http request option.
|
|
37
|
+
* @throws {RequiredError}
|
|
38
|
+
*/
|
|
39
|
+
aiChat: async (aiChatIn, options = {}) => {
|
|
40
|
+
// verify required parameter 'aiChatIn' is not null or undefined
|
|
41
|
+
(0, common_1.assertParamExists)('aiChat', 'aiChatIn', aiChatIn);
|
|
42
|
+
const localVarPath = `/v1/ai/mcp/chat`;
|
|
43
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
44
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
45
|
+
let baseOptions;
|
|
46
|
+
if (configuration) {
|
|
47
|
+
baseOptions = configuration.baseOptions;
|
|
48
|
+
}
|
|
49
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
|
|
50
|
+
const localVarHeaderParameter = {};
|
|
51
|
+
const localVarQueryParameter = {};
|
|
52
|
+
// authentication bearer required
|
|
53
|
+
// http bearer authentication required
|
|
54
|
+
await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
55
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
56
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
57
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
58
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
59
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(aiChatIn, localVarRequestOptions, configuration);
|
|
60
|
+
return {
|
|
61
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
62
|
+
options: localVarRequestOptions,
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* 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.
|
|
67
|
+
* @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.
|
|
68
|
+
* @param {AiDecideIn} aiDecideIn
|
|
69
|
+
* @param {*} [options] Override http request option.
|
|
70
|
+
* @throws {RequiredError}
|
|
71
|
+
*/
|
|
72
|
+
aiDecide: async (aiDecideIn, options = {}) => {
|
|
73
|
+
// verify required parameter 'aiDecideIn' is not null or undefined
|
|
74
|
+
(0, common_1.assertParamExists)('aiDecide', 'aiDecideIn', aiDecideIn);
|
|
75
|
+
const localVarPath = `/v1/ai/mcp/decisions`;
|
|
76
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
77
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
78
|
+
let baseOptions;
|
|
79
|
+
if (configuration) {
|
|
80
|
+
baseOptions = configuration.baseOptions;
|
|
81
|
+
}
|
|
82
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
|
|
83
|
+
const localVarHeaderParameter = {};
|
|
84
|
+
const localVarQueryParameter = {};
|
|
85
|
+
// authentication bearer required
|
|
86
|
+
// http bearer authentication required
|
|
87
|
+
await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
88
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
89
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
90
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
91
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
92
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(aiDecideIn, localVarRequestOptions, configuration);
|
|
93
|
+
return {
|
|
94
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
95
|
+
options: localVarRequestOptions,
|
|
96
|
+
};
|
|
97
|
+
},
|
|
32
98
|
/**
|
|
33
99
|
* 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.
|
|
34
100
|
* @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.
|
|
@@ -89,6 +155,54 @@ const AiApiAxiosParamCreator = function (configuration) {
|
|
|
89
155
|
options: localVarRequestOptions,
|
|
90
156
|
};
|
|
91
157
|
},
|
|
158
|
+
/**
|
|
159
|
+
* 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.
|
|
160
|
+
* @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.
|
|
161
|
+
* @param {string} [q] Q matches the model\'s id, name, description or owner, ignoring case.
|
|
162
|
+
* @param {string} [_class] Class keeps one class: premium (third-party frontier models), ours (Hanzo\'s priced models) or free.
|
|
163
|
+
* @param {string} [family] Family keeps one Hanzo family: enso, zen, kai or zoo.
|
|
164
|
+
* @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).
|
|
165
|
+
* @param {number} [limit] Limit is the most models to answer, 1 to 500; 0 answers 50.
|
|
166
|
+
* @param {*} [options] Override http request option.
|
|
167
|
+
* @throws {RequiredError}
|
|
168
|
+
*/
|
|
169
|
+
aiModels: async (q, _class, family, capability, limit, options = {}) => {
|
|
170
|
+
const localVarPath = `/v1/ai/mcp/models`;
|
|
171
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
172
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
173
|
+
let baseOptions;
|
|
174
|
+
if (configuration) {
|
|
175
|
+
baseOptions = configuration.baseOptions;
|
|
176
|
+
}
|
|
177
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
178
|
+
const localVarHeaderParameter = {};
|
|
179
|
+
const localVarQueryParameter = {};
|
|
180
|
+
// authentication bearer required
|
|
181
|
+
// http bearer authentication required
|
|
182
|
+
await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
183
|
+
if (q !== undefined) {
|
|
184
|
+
localVarQueryParameter['q'] = q;
|
|
185
|
+
}
|
|
186
|
+
if (_class !== undefined) {
|
|
187
|
+
localVarQueryParameter['class'] = _class;
|
|
188
|
+
}
|
|
189
|
+
if (family !== undefined) {
|
|
190
|
+
localVarQueryParameter['family'] = family;
|
|
191
|
+
}
|
|
192
|
+
if (capability !== undefined) {
|
|
193
|
+
localVarQueryParameter['capability'] = capability;
|
|
194
|
+
}
|
|
195
|
+
if (limit !== undefined) {
|
|
196
|
+
localVarQueryParameter['limit'] = limit;
|
|
197
|
+
}
|
|
198
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
199
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
200
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
201
|
+
return {
|
|
202
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
203
|
+
options: localVarRequestOptions,
|
|
204
|
+
};
|
|
205
|
+
},
|
|
92
206
|
/**
|
|
93
207
|
* 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.
|
|
94
208
|
* @summary Sets the payer\'s choice to keep using a model on credits once the plan\'s included usage of it is spent.
|
|
@@ -6350,10 +6464,13 @@ const AiApiAxiosParamCreator = function (configuration) {
|
|
|
6350
6464
|
/**
|
|
6351
6465
|
* 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}.
|
|
6352
6466
|
* @summary Attaches a per-request outcome reward to the routing decision that served request_id — the enso training loop\'s quality signal.
|
|
6467
|
+
* @param {AiRoutingRewardRequest} aiRoutingRewardRequest
|
|
6353
6468
|
* @param {*} [options] Override http request option.
|
|
6354
6469
|
* @throws {RequiredError}
|
|
6355
6470
|
*/
|
|
6356
|
-
postAiFeedback: async (options = {}) => {
|
|
6471
|
+
postAiFeedback: async (aiRoutingRewardRequest, options = {}) => {
|
|
6472
|
+
// verify required parameter 'aiRoutingRewardRequest' is not null or undefined
|
|
6473
|
+
(0, common_1.assertParamExists)('postAiFeedback', 'aiRoutingRewardRequest', aiRoutingRewardRequest);
|
|
6357
6474
|
const localVarPath = `/v1/ai/feedback`;
|
|
6358
6475
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
6359
6476
|
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
@@ -6367,9 +6484,11 @@ const AiApiAxiosParamCreator = function (configuration) {
|
|
|
6367
6484
|
// authentication bearer required
|
|
6368
6485
|
// http bearer authentication required
|
|
6369
6486
|
await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
6487
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
6370
6488
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
6371
6489
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
6372
6490
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
6491
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(aiRoutingRewardRequest, localVarRequestOptions, configuration);
|
|
6373
6492
|
return {
|
|
6374
6493
|
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
6375
6494
|
options: localVarRequestOptions,
|
|
@@ -8421,10 +8540,12 @@ const AiApiAxiosParamCreator = function (configuration) {
|
|
|
8421
8540
|
* Implements the OpenAI-compatible chat completions API
|
|
8422
8541
|
* @summary Implements the OpenAI-compatible chat completions API
|
|
8423
8542
|
* @param {OpenaiChatCompletionRequest} openaiChatCompletionRequest
|
|
8543
|
+
* @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.
|
|
8544
|
+
* @param {number} [xMaxLatencyMs] The slowest model this request accepts, in milliseconds.
|
|
8424
8545
|
* @param {*} [options] Override http request option.
|
|
8425
8546
|
* @throws {RequiredError}
|
|
8426
8547
|
*/
|
|
8427
|
-
postChat: async (openaiChatCompletionRequest, options = {}) => {
|
|
8548
|
+
postChat: async (openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options = {}) => {
|
|
8428
8549
|
// verify required parameter 'openaiChatCompletionRequest' is not null or undefined
|
|
8429
8550
|
(0, common_1.assertParamExists)('postChat', 'openaiChatCompletionRequest', openaiChatCompletionRequest);
|
|
8430
8551
|
const localVarPath = `/v1/chat`;
|
|
@@ -8441,6 +8562,16 @@ const AiApiAxiosParamCreator = function (configuration) {
|
|
|
8441
8562
|
// http bearer authentication required
|
|
8442
8563
|
await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
8443
8564
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
8565
|
+
if (xMaxCost != null) {
|
|
8566
|
+
localVarHeaderParameter['X-Max-Cost'] = typeof xMaxCost === 'string'
|
|
8567
|
+
? xMaxCost
|
|
8568
|
+
: JSON.stringify(xMaxCost);
|
|
8569
|
+
}
|
|
8570
|
+
if (xMaxLatencyMs != null) {
|
|
8571
|
+
localVarHeaderParameter['X-Max-Latency-Ms'] = typeof xMaxLatencyMs === 'string'
|
|
8572
|
+
? xMaxLatencyMs
|
|
8573
|
+
: JSON.stringify(xMaxLatencyMs);
|
|
8574
|
+
}
|
|
8444
8575
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
8445
8576
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
8446
8577
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
@@ -8454,10 +8585,12 @@ const AiApiAxiosParamCreator = function (configuration) {
|
|
|
8454
8585
|
* Implements the OpenAI-compatible chat completions API
|
|
8455
8586
|
* @summary Implements the OpenAI-compatible chat completions API
|
|
8456
8587
|
* @param {OpenaiChatCompletionRequest} openaiChatCompletionRequest
|
|
8588
|
+
* @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.
|
|
8589
|
+
* @param {number} [xMaxLatencyMs] The slowest model this request accepts, in milliseconds.
|
|
8457
8590
|
* @param {*} [options] Override http request option.
|
|
8458
8591
|
* @throws {RequiredError}
|
|
8459
8592
|
*/
|
|
8460
|
-
postChatCompletions: async (openaiChatCompletionRequest, options = {}) => {
|
|
8593
|
+
postChatCompletions: async (openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options = {}) => {
|
|
8461
8594
|
// verify required parameter 'openaiChatCompletionRequest' is not null or undefined
|
|
8462
8595
|
(0, common_1.assertParamExists)('postChatCompletions', 'openaiChatCompletionRequest', openaiChatCompletionRequest);
|
|
8463
8596
|
const localVarPath = `/v1/chat/completions`;
|
|
@@ -8474,6 +8607,16 @@ const AiApiAxiosParamCreator = function (configuration) {
|
|
|
8474
8607
|
// http bearer authentication required
|
|
8475
8608
|
await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
8476
8609
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
8610
|
+
if (xMaxCost != null) {
|
|
8611
|
+
localVarHeaderParameter['X-Max-Cost'] = typeof xMaxCost === 'string'
|
|
8612
|
+
? xMaxCost
|
|
8613
|
+
: JSON.stringify(xMaxCost);
|
|
8614
|
+
}
|
|
8615
|
+
if (xMaxLatencyMs != null) {
|
|
8616
|
+
localVarHeaderParameter['X-Max-Latency-Ms'] = typeof xMaxLatencyMs === 'string'
|
|
8617
|
+
? xMaxLatencyMs
|
|
8618
|
+
: JSON.stringify(xMaxLatencyMs);
|
|
8619
|
+
}
|
|
8477
8620
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
8478
8621
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
8479
8622
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
@@ -8520,10 +8663,12 @@ const AiApiAxiosParamCreator = function (configuration) {
|
|
|
8520
8663
|
* Implements the OpenAI-compatible chat completions API
|
|
8521
8664
|
* @summary Implements the OpenAI-compatible chat completions API
|
|
8522
8665
|
* @param {OpenaiChatCompletionRequest} openaiChatCompletionRequest
|
|
8666
|
+
* @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.
|
|
8667
|
+
* @param {number} [xMaxLatencyMs] The slowest model this request accepts, in milliseconds.
|
|
8523
8668
|
* @param {*} [options] Override http request option.
|
|
8524
8669
|
* @throws {RequiredError}
|
|
8525
8670
|
*/
|
|
8526
|
-
postCompletions: async (openaiChatCompletionRequest, options = {}) => {
|
|
8671
|
+
postCompletions: async (openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options = {}) => {
|
|
8527
8672
|
// verify required parameter 'openaiChatCompletionRequest' is not null or undefined
|
|
8528
8673
|
(0, common_1.assertParamExists)('postCompletions', 'openaiChatCompletionRequest', openaiChatCompletionRequest);
|
|
8529
8674
|
const localVarPath = `/v1/completions`;
|
|
@@ -8540,6 +8685,16 @@ const AiApiAxiosParamCreator = function (configuration) {
|
|
|
8540
8685
|
// http bearer authentication required
|
|
8541
8686
|
await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
8542
8687
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
8688
|
+
if (xMaxCost != null) {
|
|
8689
|
+
localVarHeaderParameter['X-Max-Cost'] = typeof xMaxCost === 'string'
|
|
8690
|
+
? xMaxCost
|
|
8691
|
+
: JSON.stringify(xMaxCost);
|
|
8692
|
+
}
|
|
8693
|
+
if (xMaxLatencyMs != null) {
|
|
8694
|
+
localVarHeaderParameter['X-Max-Latency-Ms'] = typeof xMaxLatencyMs === 'string'
|
|
8695
|
+
? xMaxLatencyMs
|
|
8696
|
+
: JSON.stringify(xMaxLatencyMs);
|
|
8697
|
+
}
|
|
8543
8698
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
8544
8699
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
8545
8700
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
@@ -8767,10 +8922,12 @@ const AiApiAxiosParamCreator = function (configuration) {
|
|
|
8767
8922
|
/**
|
|
8768
8923
|
* 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.
|
|
8769
8924
|
* @summary Implements POST /v1/responses.
|
|
8925
|
+
* @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.
|
|
8926
|
+
* @param {number} [xMaxLatencyMs] The slowest model this request accepts, in milliseconds.
|
|
8770
8927
|
* @param {*} [options] Override http request option.
|
|
8771
8928
|
* @throws {RequiredError}
|
|
8772
8929
|
*/
|
|
8773
|
-
postResponses: async (options = {}) => {
|
|
8930
|
+
postResponses: async (xMaxCost, xMaxLatencyMs, options = {}) => {
|
|
8774
8931
|
const localVarPath = `/v1/responses`;
|
|
8775
8932
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
8776
8933
|
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
@@ -8784,6 +8941,16 @@ const AiApiAxiosParamCreator = function (configuration) {
|
|
|
8784
8941
|
// authentication bearer required
|
|
8785
8942
|
// http bearer authentication required
|
|
8786
8943
|
await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
8944
|
+
if (xMaxCost != null) {
|
|
8945
|
+
localVarHeaderParameter['X-Max-Cost'] = typeof xMaxCost === 'string'
|
|
8946
|
+
? xMaxCost
|
|
8947
|
+
: JSON.stringify(xMaxCost);
|
|
8948
|
+
}
|
|
8949
|
+
if (xMaxLatencyMs != null) {
|
|
8950
|
+
localVarHeaderParameter['X-Max-Latency-Ms'] = typeof xMaxLatencyMs === 'string'
|
|
8951
|
+
? xMaxLatencyMs
|
|
8952
|
+
: JSON.stringify(xMaxLatencyMs);
|
|
8953
|
+
}
|
|
8787
8954
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
8788
8955
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
8789
8956
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
@@ -10068,6 +10235,32 @@ exports.AiApiAxiosParamCreator = AiApiAxiosParamCreator;
|
|
|
10068
10235
|
const AiApiFp = function (configuration) {
|
|
10069
10236
|
const localVarAxiosParamCreator = (0, exports.AiApiAxiosParamCreator)(configuration);
|
|
10070
10237
|
return {
|
|
10238
|
+
/**
|
|
10239
|
+
* 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.
|
|
10240
|
+
* @summary Asks one model one prompt and answers the reply, which model served it and who paid.
|
|
10241
|
+
* @param {AiChatIn} aiChatIn
|
|
10242
|
+
* @param {*} [options] Override http request option.
|
|
10243
|
+
* @throws {RequiredError}
|
|
10244
|
+
*/
|
|
10245
|
+
async aiChat(aiChatIn, options) {
|
|
10246
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.aiChat(aiChatIn, options);
|
|
10247
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
10248
|
+
const localVarOperationServerBasePath = base_1.operationServerMap['AiApi.aiChat']?.[localVarOperationServerIndex]?.url;
|
|
10249
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
10250
|
+
},
|
|
10251
|
+
/**
|
|
10252
|
+
* 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.
|
|
10253
|
+
* @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.
|
|
10254
|
+
* @param {AiDecideIn} aiDecideIn
|
|
10255
|
+
* @param {*} [options] Override http request option.
|
|
10256
|
+
* @throws {RequiredError}
|
|
10257
|
+
*/
|
|
10258
|
+
async aiDecide(aiDecideIn, options) {
|
|
10259
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.aiDecide(aiDecideIn, options);
|
|
10260
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
10261
|
+
const localVarOperationServerBasePath = base_1.operationServerMap['AiApi.aiDecide']?.[localVarOperationServerIndex]?.url;
|
|
10262
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
10263
|
+
},
|
|
10071
10264
|
/**
|
|
10072
10265
|
* 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.
|
|
10073
10266
|
* @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.
|
|
@@ -10093,6 +10286,23 @@ const AiApiFp = function (configuration) {
|
|
|
10093
10286
|
const localVarOperationServerBasePath = base_1.operationServerMap['AiApi.aiMCPTools']?.[localVarOperationServerIndex]?.url;
|
|
10094
10287
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
10095
10288
|
},
|
|
10289
|
+
/**
|
|
10290
|
+
* 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.
|
|
10291
|
+
* @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.
|
|
10292
|
+
* @param {string} [q] Q matches the model\'s id, name, description or owner, ignoring case.
|
|
10293
|
+
* @param {string} [_class] Class keeps one class: premium (third-party frontier models), ours (Hanzo\'s priced models) or free.
|
|
10294
|
+
* @param {string} [family] Family keeps one Hanzo family: enso, zen, kai or zoo.
|
|
10295
|
+
* @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).
|
|
10296
|
+
* @param {number} [limit] Limit is the most models to answer, 1 to 500; 0 answers 50.
|
|
10297
|
+
* @param {*} [options] Override http request option.
|
|
10298
|
+
* @throws {RequiredError}
|
|
10299
|
+
*/
|
|
10300
|
+
async aiModels(q, _class, family, capability, limit, options) {
|
|
10301
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.aiModels(q, _class, family, capability, limit, options);
|
|
10302
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
10303
|
+
const localVarOperationServerBasePath = base_1.operationServerMap['AiApi.aiModels']?.[localVarOperationServerIndex]?.url;
|
|
10304
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
10305
|
+
},
|
|
10096
10306
|
/**
|
|
10097
10307
|
* 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.
|
|
10098
10308
|
* @summary Sets the payer\'s choice to keep using a model on credits once the plan\'s included usage of it is spent.
|
|
@@ -12627,11 +12837,12 @@ const AiApiFp = function (configuration) {
|
|
|
12627
12837
|
/**
|
|
12628
12838
|
* 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}.
|
|
12629
12839
|
* @summary Attaches a per-request outcome reward to the routing decision that served request_id — the enso training loop\'s quality signal.
|
|
12840
|
+
* @param {AiRoutingRewardRequest} aiRoutingRewardRequest
|
|
12630
12841
|
* @param {*} [options] Override http request option.
|
|
12631
12842
|
* @throws {RequiredError}
|
|
12632
12843
|
*/
|
|
12633
|
-
async postAiFeedback(options) {
|
|
12634
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.postAiFeedback(options);
|
|
12844
|
+
async postAiFeedback(aiRoutingRewardRequest, options) {
|
|
12845
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.postAiFeedback(aiRoutingRewardRequest, options);
|
|
12635
12846
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
12636
12847
|
const localVarOperationServerBasePath = base_1.operationServerMap['AiApi.postAiFeedback']?.[localVarOperationServerIndex]?.url;
|
|
12637
12848
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -13461,11 +13672,13 @@ const AiApiFp = function (configuration) {
|
|
|
13461
13672
|
* Implements the OpenAI-compatible chat completions API
|
|
13462
13673
|
* @summary Implements the OpenAI-compatible chat completions API
|
|
13463
13674
|
* @param {OpenaiChatCompletionRequest} openaiChatCompletionRequest
|
|
13675
|
+
* @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.
|
|
13676
|
+
* @param {number} [xMaxLatencyMs] The slowest model this request accepts, in milliseconds.
|
|
13464
13677
|
* @param {*} [options] Override http request option.
|
|
13465
13678
|
* @throws {RequiredError}
|
|
13466
13679
|
*/
|
|
13467
|
-
async postChat(openaiChatCompletionRequest, options) {
|
|
13468
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.postChat(openaiChatCompletionRequest, options);
|
|
13680
|
+
async postChat(openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options) {
|
|
13681
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.postChat(openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options);
|
|
13469
13682
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
13470
13683
|
const localVarOperationServerBasePath = base_1.operationServerMap['AiApi.postChat']?.[localVarOperationServerIndex]?.url;
|
|
13471
13684
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -13474,11 +13687,13 @@ const AiApiFp = function (configuration) {
|
|
|
13474
13687
|
* Implements the OpenAI-compatible chat completions API
|
|
13475
13688
|
* @summary Implements the OpenAI-compatible chat completions API
|
|
13476
13689
|
* @param {OpenaiChatCompletionRequest} openaiChatCompletionRequest
|
|
13690
|
+
* @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.
|
|
13691
|
+
* @param {number} [xMaxLatencyMs] The slowest model this request accepts, in milliseconds.
|
|
13477
13692
|
* @param {*} [options] Override http request option.
|
|
13478
13693
|
* @throws {RequiredError}
|
|
13479
13694
|
*/
|
|
13480
|
-
async postChatCompletions(openaiChatCompletionRequest, options) {
|
|
13481
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.postChatCompletions(openaiChatCompletionRequest, options);
|
|
13695
|
+
async postChatCompletions(openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options) {
|
|
13696
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.postChatCompletions(openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options);
|
|
13482
13697
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
13483
13698
|
const localVarOperationServerBasePath = base_1.operationServerMap['AiApi.postChatCompletions']?.[localVarOperationServerIndex]?.url;
|
|
13484
13699
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -13500,11 +13715,13 @@ const AiApiFp = function (configuration) {
|
|
|
13500
13715
|
* Implements the OpenAI-compatible chat completions API
|
|
13501
13716
|
* @summary Implements the OpenAI-compatible chat completions API
|
|
13502
13717
|
* @param {OpenaiChatCompletionRequest} openaiChatCompletionRequest
|
|
13718
|
+
* @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.
|
|
13719
|
+
* @param {number} [xMaxLatencyMs] The slowest model this request accepts, in milliseconds.
|
|
13503
13720
|
* @param {*} [options] Override http request option.
|
|
13504
13721
|
* @throws {RequiredError}
|
|
13505
13722
|
*/
|
|
13506
|
-
async postCompletions(openaiChatCompletionRequest, options) {
|
|
13507
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.postCompletions(openaiChatCompletionRequest, options);
|
|
13723
|
+
async postCompletions(openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options) {
|
|
13724
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.postCompletions(openaiChatCompletionRequest, xMaxCost, xMaxLatencyMs, options);
|
|
13508
13725
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
13509
13726
|
const localVarOperationServerBasePath = base_1.operationServerMap['AiApi.postCompletions']?.[localVarOperationServerIndex]?.url;
|
|
13510
13727
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -13600,11 +13817,13 @@ const AiApiFp = function (configuration) {
|
|
|
13600
13817
|
/**
|
|
13601
13818
|
* 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.
|
|
13602
13819
|
* @summary Implements POST /v1/responses.
|
|
13820
|
+
* @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.
|
|
13821
|
+
* @param {number} [xMaxLatencyMs] The slowest model this request accepts, in milliseconds.
|
|
13603
13822
|
* @param {*} [options] Override http request option.
|
|
13604
13823
|
* @throws {RequiredError}
|
|
13605
13824
|
*/
|
|
13606
|
-
async postResponses(options) {
|
|
13607
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.postResponses(options);
|
|
13825
|
+
async postResponses(xMaxCost, xMaxLatencyMs, options) {
|
|
13826
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.postResponses(xMaxCost, xMaxLatencyMs, options);
|
|
13608
13827
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
13609
13828
|
const localVarOperationServerBasePath = base_1.operationServerMap['AiApi.postResponses']?.[localVarOperationServerIndex]?.url;
|
|
13610
13829
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -14099,6 +14318,26 @@ exports.AiApiFp = AiApiFp;
|
|
|
14099
14318
|
const AiApiFactory = function (configuration, basePath, axios) {
|
|
14100
14319
|
const localVarFp = (0, exports.AiApiFp)(configuration);
|
|
14101
14320
|
return {
|
|
14321
|
+
/**
|
|
14322
|
+
* 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.
|
|
14323
|
+
* @summary Asks one model one prompt and answers the reply, which model served it and who paid.
|
|
14324
|
+
* @param {AiApiAiChatRequest} requestParameters Request parameters.
|
|
14325
|
+
* @param {*} [options] Override http request option.
|
|
14326
|
+
* @throws {RequiredError}
|
|
14327
|
+
*/
|
|
14328
|
+
aiChat(requestParameters, options) {
|
|
14329
|
+
return localVarFp.aiChat(requestParameters.aiChatIn, options).then((request) => request(axios, basePath));
|
|
14330
|
+
},
|
|
14331
|
+
/**
|
|
14332
|
+
* 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.
|
|
14333
|
+
* @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.
|
|
14334
|
+
* @param {AiApiAiDecideRequest} requestParameters Request parameters.
|
|
14335
|
+
* @param {*} [options] Override http request option.
|
|
14336
|
+
* @throws {RequiredError}
|
|
14337
|
+
*/
|
|
14338
|
+
aiDecide(requestParameters, options) {
|
|
14339
|
+
return localVarFp.aiDecide(requestParameters.aiDecideIn, options).then((request) => request(axios, basePath));
|
|
14340
|
+
},
|
|
14102
14341
|
/**
|
|
14103
14342
|
* 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.
|
|
14104
14343
|
* @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.
|
|
@@ -14118,6 +14357,16 @@ const AiApiFactory = function (configuration, basePath, axios) {
|
|
|
14118
14357
|
aiMCPTools(requestParameters = {}, options) {
|
|
14119
14358
|
return localVarFp.aiMCPTools(requestParameters.names, options).then((request) => request(axios, basePath));
|
|
14120
14359
|
},
|
|
14360
|
+
/**
|
|
14361
|
+
* 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.
|
|
14362
|
+
* @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.
|
|
14363
|
+
* @param {AiApiAiModelsRequest} requestParameters Request parameters.
|
|
14364
|
+
* @param {*} [options] Override http request option.
|
|
14365
|
+
* @throws {RequiredError}
|
|
14366
|
+
*/
|
|
14367
|
+
aiModels(requestParameters = {}, options) {
|
|
14368
|
+
return localVarFp.aiModels(requestParameters.q, requestParameters._class, requestParameters.family, requestParameters.capability, requestParameters.limit, options).then((request) => request(axios, basePath));
|
|
14369
|
+
},
|
|
14121
14370
|
/**
|
|
14122
14371
|
* 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.
|
|
14123
14372
|
* @summary Sets the payer\'s choice to keep using a model on credits once the plan\'s included usage of it is spent.
|
|
@@ -15968,11 +16217,12 @@ const AiApiFactory = function (configuration, basePath, axios) {
|
|
|
15968
16217
|
/**
|
|
15969
16218
|
* 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}.
|
|
15970
16219
|
* @summary Attaches a per-request outcome reward to the routing decision that served request_id — the enso training loop\'s quality signal.
|
|
16220
|
+
* @param {AiApiPostAiFeedbackRequest} requestParameters Request parameters.
|
|
15971
16221
|
* @param {*} [options] Override http request option.
|
|
15972
16222
|
* @throws {RequiredError}
|
|
15973
16223
|
*/
|
|
15974
|
-
postAiFeedback(options) {
|
|
15975
|
-
return localVarFp.postAiFeedback(options).then((request) => request(axios, basePath));
|
|
16224
|
+
postAiFeedback(requestParameters, options) {
|
|
16225
|
+
return localVarFp.postAiFeedback(requestParameters.aiRoutingRewardRequest, options).then((request) => request(axios, basePath));
|
|
15976
16226
|
},
|
|
15977
16227
|
/**
|
|
15978
16228
|
* Create one file.
|
|
@@ -16597,7 +16847,7 @@ const AiApiFactory = function (configuration, basePath, axios) {
|
|
|
16597
16847
|
* @throws {RequiredError}
|
|
16598
16848
|
*/
|
|
16599
16849
|
postChat(requestParameters, options) {
|
|
16600
|
-
return localVarFp.postChat(requestParameters.openaiChatCompletionRequest, options).then((request) => request(axios, basePath));
|
|
16850
|
+
return localVarFp.postChat(requestParameters.openaiChatCompletionRequest, requestParameters.xMaxCost, requestParameters.xMaxLatencyMs, options).then((request) => request(axios, basePath));
|
|
16601
16851
|
},
|
|
16602
16852
|
/**
|
|
16603
16853
|
* Implements the OpenAI-compatible chat completions API
|
|
@@ -16607,7 +16857,7 @@ const AiApiFactory = function (configuration, basePath, axios) {
|
|
|
16607
16857
|
* @throws {RequiredError}
|
|
16608
16858
|
*/
|
|
16609
16859
|
postChatCompletions(requestParameters, options) {
|
|
16610
|
-
return localVarFp.postChatCompletions(requestParameters.openaiChatCompletionRequest, options).then((request) => request(axios, basePath));
|
|
16860
|
+
return localVarFp.postChatCompletions(requestParameters.openaiChatCompletionRequest, requestParameters.xMaxCost, requestParameters.xMaxLatencyMs, options).then((request) => request(axios, basePath));
|
|
16611
16861
|
},
|
|
16612
16862
|
/**
|
|
16613
16863
|
* Serves one completion to a caller with no account.
|
|
@@ -16627,7 +16877,7 @@ const AiApiFactory = function (configuration, basePath, axios) {
|
|
|
16627
16877
|
* @throws {RequiredError}
|
|
16628
16878
|
*/
|
|
16629
16879
|
postCompletions(requestParameters, options) {
|
|
16630
|
-
return localVarFp.postCompletions(requestParameters.openaiChatCompletionRequest, options).then((request) => request(axios, basePath));
|
|
16880
|
+
return localVarFp.postCompletions(requestParameters.openaiChatCompletionRequest, requestParameters.xMaxCost, requestParameters.xMaxLatencyMs, options).then((request) => request(axios, basePath));
|
|
16631
16881
|
},
|
|
16632
16882
|
/**
|
|
16633
16883
|
* 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.
|
|
@@ -16699,11 +16949,12 @@ const AiApiFactory = function (configuration, basePath, axios) {
|
|
|
16699
16949
|
/**
|
|
16700
16950
|
* 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.
|
|
16701
16951
|
* @summary Implements POST /v1/responses.
|
|
16952
|
+
* @param {AiApiPostResponsesRequest} requestParameters Request parameters.
|
|
16702
16953
|
* @param {*} [options] Override http request option.
|
|
16703
16954
|
* @throws {RequiredError}
|
|
16704
16955
|
*/
|
|
16705
|
-
postResponses(options) {
|
|
16706
|
-
return localVarFp.postResponses(options).then((request) => request(axios, basePath));
|
|
16956
|
+
postResponses(requestParameters = {}, options) {
|
|
16957
|
+
return localVarFp.postResponses(requestParameters.xMaxCost, requestParameters.xMaxLatencyMs, options).then((request) => request(axios, basePath));
|
|
16707
16958
|
},
|
|
16708
16959
|
/**
|
|
16709
16960
|
* 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.
|
|
@@ -17047,6 +17298,28 @@ exports.AiApiFactory = AiApiFactory;
|
|
|
17047
17298
|
* @extends {BaseAPI}
|
|
17048
17299
|
*/
|
|
17049
17300
|
class AiApi extends base_1.BaseAPI {
|
|
17301
|
+
/**
|
|
17302
|
+
* 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.
|
|
17303
|
+
* @summary Asks one model one prompt and answers the reply, which model served it and who paid.
|
|
17304
|
+
* @param {AiApiAiChatRequest} requestParameters Request parameters.
|
|
17305
|
+
* @param {*} [options] Override http request option.
|
|
17306
|
+
* @throws {RequiredError}
|
|
17307
|
+
* @memberof AiApi
|
|
17308
|
+
*/
|
|
17309
|
+
aiChat(requestParameters, options) {
|
|
17310
|
+
return (0, exports.AiApiFp)(this.configuration).aiChat(requestParameters.aiChatIn, options).then((request) => request(this.axios, this.basePath));
|
|
17311
|
+
}
|
|
17312
|
+
/**
|
|
17313
|
+
* 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.
|
|
17314
|
+
* @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.
|
|
17315
|
+
* @param {AiApiAiDecideRequest} requestParameters Request parameters.
|
|
17316
|
+
* @param {*} [options] Override http request option.
|
|
17317
|
+
* @throws {RequiredError}
|
|
17318
|
+
* @memberof AiApi
|
|
17319
|
+
*/
|
|
17320
|
+
aiDecide(requestParameters, options) {
|
|
17321
|
+
return (0, exports.AiApiFp)(this.configuration).aiDecide(requestParameters.aiDecideIn, options).then((request) => request(this.axios, this.basePath));
|
|
17322
|
+
}
|
|
17050
17323
|
/**
|
|
17051
17324
|
* 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.
|
|
17052
17325
|
* @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.
|
|
@@ -17068,6 +17341,17 @@ class AiApi extends base_1.BaseAPI {
|
|
|
17068
17341
|
aiMCPTools(requestParameters = {}, options) {
|
|
17069
17342
|
return (0, exports.AiApiFp)(this.configuration).aiMCPTools(requestParameters.names, options).then((request) => request(this.axios, this.basePath));
|
|
17070
17343
|
}
|
|
17344
|
+
/**
|
|
17345
|
+
* 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.
|
|
17346
|
+
* @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.
|
|
17347
|
+
* @param {AiApiAiModelsRequest} requestParameters Request parameters.
|
|
17348
|
+
* @param {*} [options] Override http request option.
|
|
17349
|
+
* @throws {RequiredError}
|
|
17350
|
+
* @memberof AiApi
|
|
17351
|
+
*/
|
|
17352
|
+
aiModels(requestParameters = {}, options) {
|
|
17353
|
+
return (0, exports.AiApiFp)(this.configuration).aiModels(requestParameters.q, requestParameters._class, requestParameters.family, requestParameters.capability, requestParameters.limit, options).then((request) => request(this.axios, this.basePath));
|
|
17354
|
+
}
|
|
17071
17355
|
/**
|
|
17072
17356
|
* 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.
|
|
17073
17357
|
* @summary Sets the payer\'s choice to keep using a model on credits once the plan\'s included usage of it is spent.
|
|
@@ -19113,12 +19397,13 @@ class AiApi extends base_1.BaseAPI {
|
|
|
19113
19397
|
/**
|
|
19114
19398
|
* 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}.
|
|
19115
19399
|
* @summary Attaches a per-request outcome reward to the routing decision that served request_id — the enso training loop\'s quality signal.
|
|
19400
|
+
* @param {AiApiPostAiFeedbackRequest} requestParameters Request parameters.
|
|
19116
19401
|
* @param {*} [options] Override http request option.
|
|
19117
19402
|
* @throws {RequiredError}
|
|
19118
19403
|
* @memberof AiApi
|
|
19119
19404
|
*/
|
|
19120
|
-
postAiFeedback(options) {
|
|
19121
|
-
return (0, exports.AiApiFp)(this.configuration).postAiFeedback(options).then((request) => request(this.axios, this.basePath));
|
|
19405
|
+
postAiFeedback(requestParameters, options) {
|
|
19406
|
+
return (0, exports.AiApiFp)(this.configuration).postAiFeedback(requestParameters.aiRoutingRewardRequest, options).then((request) => request(this.axios, this.basePath));
|
|
19122
19407
|
}
|
|
19123
19408
|
/**
|
|
19124
19409
|
* Create one file.
|
|
@@ -19808,7 +20093,7 @@ class AiApi extends base_1.BaseAPI {
|
|
|
19808
20093
|
* @memberof AiApi
|
|
19809
20094
|
*/
|
|
19810
20095
|
postChat(requestParameters, options) {
|
|
19811
|
-
return (0, exports.AiApiFp)(this.configuration).postChat(requestParameters.openaiChatCompletionRequest, options).then((request) => request(this.axios, this.basePath));
|
|
20096
|
+
return (0, exports.AiApiFp)(this.configuration).postChat(requestParameters.openaiChatCompletionRequest, requestParameters.xMaxCost, requestParameters.xMaxLatencyMs, options).then((request) => request(this.axios, this.basePath));
|
|
19812
20097
|
}
|
|
19813
20098
|
/**
|
|
19814
20099
|
* Implements the OpenAI-compatible chat completions API
|
|
@@ -19819,7 +20104,7 @@ class AiApi extends base_1.BaseAPI {
|
|
|
19819
20104
|
* @memberof AiApi
|
|
19820
20105
|
*/
|
|
19821
20106
|
postChatCompletions(requestParameters, options) {
|
|
19822
|
-
return (0, exports.AiApiFp)(this.configuration).postChatCompletions(requestParameters.openaiChatCompletionRequest, options).then((request) => request(this.axios, this.basePath));
|
|
20107
|
+
return (0, exports.AiApiFp)(this.configuration).postChatCompletions(requestParameters.openaiChatCompletionRequest, requestParameters.xMaxCost, requestParameters.xMaxLatencyMs, options).then((request) => request(this.axios, this.basePath));
|
|
19823
20108
|
}
|
|
19824
20109
|
/**
|
|
19825
20110
|
* Serves one completion to a caller with no account.
|
|
@@ -19841,7 +20126,7 @@ class AiApi extends base_1.BaseAPI {
|
|
|
19841
20126
|
* @memberof AiApi
|
|
19842
20127
|
*/
|
|
19843
20128
|
postCompletions(requestParameters, options) {
|
|
19844
|
-
return (0, exports.AiApiFp)(this.configuration).postCompletions(requestParameters.openaiChatCompletionRequest, options).then((request) => request(this.axios, this.basePath));
|
|
20129
|
+
return (0, exports.AiApiFp)(this.configuration).postCompletions(requestParameters.openaiChatCompletionRequest, requestParameters.xMaxCost, requestParameters.xMaxLatencyMs, options).then((request) => request(this.axios, this.basePath));
|
|
19845
20130
|
}
|
|
19846
20131
|
/**
|
|
19847
20132
|
* 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.
|
|
@@ -19920,12 +20205,13 @@ class AiApi extends base_1.BaseAPI {
|
|
|
19920
20205
|
/**
|
|
19921
20206
|
* 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.
|
|
19922
20207
|
* @summary Implements POST /v1/responses.
|
|
20208
|
+
* @param {AiApiPostResponsesRequest} requestParameters Request parameters.
|
|
19923
20209
|
* @param {*} [options] Override http request option.
|
|
19924
20210
|
* @throws {RequiredError}
|
|
19925
20211
|
* @memberof AiApi
|
|
19926
20212
|
*/
|
|
19927
|
-
postResponses(options) {
|
|
19928
|
-
return (0, exports.AiApiFp)(this.configuration).postResponses(options).then((request) => request(this.axios, this.basePath));
|
|
20213
|
+
postResponses(requestParameters = {}, options) {
|
|
20214
|
+
return (0, exports.AiApiFp)(this.configuration).postResponses(requestParameters.xMaxCost, requestParameters.xMaxLatencyMs, options).then((request) => request(this.axios, this.basePath));
|
|
19929
20215
|
}
|
|
19930
20216
|
/**
|
|
19931
20217
|
* 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.
|