@deeprelay/sdk 0.4.1 → 0.4.3
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/.openapi-generator/FILES +4 -0
- package/README.md +4 -2
- package/dist/apis/ApiKeysApi.d.ts +2 -2
- package/dist/apis/ApiKeysApi.js +2 -2
- package/dist/apis/BillingApi.d.ts +2 -2
- package/dist/apis/BillingApi.js +2 -2
- package/dist/apis/InferenceApi.d.ts +3 -2
- package/dist/apis/InferenceApi.js +5 -2
- package/dist/apis/RequestsApi.d.ts +4 -2
- package/dist/apis/RequestsApi.js +8 -2
- package/dist/esm/apis/ApiKeysApi.d.ts +2 -2
- package/dist/esm/apis/ApiKeysApi.js +2 -2
- package/dist/esm/apis/BillingApi.d.ts +2 -2
- package/dist/esm/apis/BillingApi.js +2 -2
- package/dist/esm/apis/InferenceApi.d.ts +3 -2
- package/dist/esm/apis/InferenceApi.js +5 -2
- package/dist/esm/apis/RequestsApi.d.ts +4 -2
- package/dist/esm/apis/RequestsApi.js +8 -2
- package/dist/esm/models/ApiKey.d.ts +19 -0
- package/dist/esm/models/ApiKey.js +9 -0
- package/dist/esm/models/ApiKeyCreate.d.ts +6 -0
- package/dist/esm/models/ApiKeyCreate.js +2 -0
- package/dist/esm/models/ApiKeyCreated.d.ts +19 -0
- package/dist/esm/models/ApiKeyCreated.js +9 -0
- package/dist/esm/models/ApiKeyFallbackEntry.d.ts +65 -0
- package/dist/esm/models/ApiKeyFallbackEntry.js +67 -0
- package/dist/esm/models/ApiKeyUpdate.d.ts +7 -1
- package/dist/esm/models/ApiKeyUpdate.js +2 -0
- package/dist/esm/models/ChatCompletionRequest.d.ts +6 -0
- package/dist/esm/models/ChatCompletionRequest.js +2 -0
- package/dist/esm/models/CreateWebhookEndpointRequest.d.ts +1 -0
- package/dist/esm/models/CreateWebhookEndpointRequest.js +2 -1
- package/dist/esm/models/RefereeStatus.d.ts +33 -4
- package/dist/esm/models/RefereeStatus.js +15 -1
- package/dist/esm/models/Referral.d.ts +10 -3
- package/dist/esm/models/Referral.js +2 -0
- package/dist/esm/models/RequestAttempt.d.ts +71 -0
- package/dist/esm/models/RequestAttempt.js +67 -0
- package/dist/esm/models/RequestLogEntry.d.ts +25 -0
- package/dist/esm/models/RequestLogEntry.js +9 -0
- package/dist/esm/models/WebhookEndpoint.d.ts +1 -0
- package/dist/esm/models/WebhookEndpoint.js +2 -1
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.js +2 -0
- package/dist/esm/runtime.js +1 -1
- package/dist/models/ApiKey.d.ts +19 -0
- package/dist/models/ApiKey.js +9 -0
- package/dist/models/ApiKeyCreate.d.ts +6 -0
- package/dist/models/ApiKeyCreate.js +2 -0
- package/dist/models/ApiKeyCreated.d.ts +19 -0
- package/dist/models/ApiKeyCreated.js +9 -0
- package/dist/models/ApiKeyFallbackEntry.d.ts +65 -0
- package/dist/models/ApiKeyFallbackEntry.js +75 -0
- package/dist/models/ApiKeyUpdate.d.ts +7 -1
- package/dist/models/ApiKeyUpdate.js +2 -0
- package/dist/models/ChatCompletionRequest.d.ts +6 -0
- package/dist/models/ChatCompletionRequest.js +2 -0
- package/dist/models/CreateWebhookEndpointRequest.d.ts +1 -0
- package/dist/models/CreateWebhookEndpointRequest.js +2 -1
- package/dist/models/RefereeStatus.d.ts +33 -4
- package/dist/models/RefereeStatus.js +16 -2
- package/dist/models/Referral.d.ts +10 -3
- package/dist/models/Referral.js +2 -0
- package/dist/models/RequestAttempt.d.ts +71 -0
- package/dist/models/RequestAttempt.js +75 -0
- package/dist/models/RequestLogEntry.d.ts +25 -0
- package/dist/models/RequestLogEntry.js +9 -0
- package/dist/models/WebhookEndpoint.d.ts +1 -0
- package/dist/models/WebhookEndpoint.js +2 -1
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/runtime.js +1 -1
- package/docs/ApiKey.md +6 -0
- package/docs/ApiKeyCreate.md +2 -0
- package/docs/ApiKeyCreated.md +6 -0
- package/docs/ApiKeyFallbackEntry.md +43 -0
- package/docs/ApiKeyUpdate.md +3 -1
- package/docs/ApiKeysApi.md +1 -1
- package/docs/BillingApi.md +1 -1
- package/docs/ChatCompletionRequest.md +2 -0
- package/docs/InferenceApi.md +29 -26
- package/docs/RefereeStatus.md +6 -0
- package/docs/Referral.md +2 -0
- package/docs/RequestAttempt.md +45 -0
- package/docs/RequestLogEntry.md +8 -0
- package/docs/RequestsApi.md +9 -3
- package/package.json +1 -1
- package/src/apis/ApiKeysApi.ts +2 -2
- package/src/apis/BillingApi.ts +2 -2
- package/src/apis/InferenceApi.ts +7 -2
- package/src/apis/RequestsApi.ts +12 -2
- package/src/models/ApiKey.ts +32 -0
- package/src/models/ApiKeyCreate.ts +8 -0
- package/src/models/ApiKeyCreated.ts +32 -0
- package/src/models/ApiKeyFallbackEntry.ts +114 -0
- package/src/models/ApiKeyUpdate.ts +9 -1
- package/src/models/ChatCompletionRequest.ts +8 -0
- package/src/models/CreateWebhookEndpointRequest.ts +2 -1
- package/src/models/RefereeStatus.ts +41 -5
- package/src/models/Referral.ts +12 -3
- package/src/models/RequestAttempt.ts +121 -0
- package/src/models/RequestLogEntry.ts +40 -0
- package/src/models/WebhookEndpoint.ts +2 -1
- package/src/models/index.ts +2 -0
- package/src/runtime.ts +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -8,6 +8,7 @@ docs/AlertsApi.md
|
|
|
8
8
|
docs/ApiKey.md
|
|
9
9
|
docs/ApiKeyCreate.md
|
|
10
10
|
docs/ApiKeyCreated.md
|
|
11
|
+
docs/ApiKeyFallbackEntry.md
|
|
11
12
|
docs/ApiKeyList.md
|
|
12
13
|
docs/ApiKeyScopes.md
|
|
13
14
|
docs/ApiKeyUpdate.md
|
|
@@ -51,6 +52,7 @@ docs/PeakWindow.md
|
|
|
51
52
|
docs/Problem.md
|
|
52
53
|
docs/RefereeStatus.md
|
|
53
54
|
docs/Referral.md
|
|
55
|
+
docs/RequestAttempt.md
|
|
54
56
|
docs/RequestLogEntry.md
|
|
55
57
|
docs/RequestLogPage.md
|
|
56
58
|
docs/RequestsApi.md
|
|
@@ -107,6 +109,7 @@ src/models/AlertSettingsUpdate.ts
|
|
|
107
109
|
src/models/ApiKey.ts
|
|
108
110
|
src/models/ApiKeyCreate.ts
|
|
109
111
|
src/models/ApiKeyCreated.ts
|
|
112
|
+
src/models/ApiKeyFallbackEntry.ts
|
|
110
113
|
src/models/ApiKeyList.ts
|
|
111
114
|
src/models/ApiKeyScopes.ts
|
|
112
115
|
src/models/ApiKeyUpdate.ts
|
|
@@ -146,6 +149,7 @@ src/models/PeakWindow.ts
|
|
|
146
149
|
src/models/Problem.ts
|
|
147
150
|
src/models/RefereeStatus.ts
|
|
148
151
|
src/models/Referral.ts
|
|
152
|
+
src/models/RequestAttempt.ts
|
|
149
153
|
src/models/RequestLogEntry.ts
|
|
150
154
|
src/models/RequestLogPage.ts
|
|
151
155
|
src/models/ResponseFormatJSONObject.ts
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @deeprelay/sdk@0.4.
|
|
1
|
+
# @deeprelay/sdk@0.4.3
|
|
2
2
|
|
|
3
3
|
A TypeScript SDK client for the api.deeprelay.ai API.
|
|
4
4
|
|
|
@@ -99,6 +99,7 @@ All URIs are relative to *https://api.deeprelay.ai/v1*
|
|
|
99
99
|
- [ApiKey](docs/ApiKey.md)
|
|
100
100
|
- [ApiKeyCreate](docs/ApiKeyCreate.md)
|
|
101
101
|
- [ApiKeyCreated](docs/ApiKeyCreated.md)
|
|
102
|
+
- [ApiKeyFallbackEntry](docs/ApiKeyFallbackEntry.md)
|
|
102
103
|
- [ApiKeyList](docs/ApiKeyList.md)
|
|
103
104
|
- [ApiKeyScopes](docs/ApiKeyScopes.md)
|
|
104
105
|
- [ApiKeyUpdate](docs/ApiKeyUpdate.md)
|
|
@@ -138,6 +139,7 @@ All URIs are relative to *https://api.deeprelay.ai/v1*
|
|
|
138
139
|
- [Problem](docs/Problem.md)
|
|
139
140
|
- [RefereeStatus](docs/RefereeStatus.md)
|
|
140
141
|
- [Referral](docs/Referral.md)
|
|
142
|
+
- [RequestAttempt](docs/RequestAttempt.md)
|
|
141
143
|
- [RequestLogEntry](docs/RequestLogEntry.md)
|
|
142
144
|
- [RequestLogPage](docs/RequestLogPage.md)
|
|
143
145
|
- [ResponseFormatJSONObject](docs/ResponseFormatJSONObject.md)
|
|
@@ -192,7 +194,7 @@ and is automatically generated by the
|
|
|
192
194
|
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
193
195
|
|
|
194
196
|
- API version: `1.0.0`
|
|
195
|
-
- Package version: `0.4.
|
|
197
|
+
- Package version: `0.4.3`
|
|
196
198
|
- Generator version: `7.24.0`
|
|
197
199
|
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
198
200
|
|
|
@@ -95,12 +95,12 @@ export declare class ApiKeysApi extends runtime.BaseAPI {
|
|
|
95
95
|
*/
|
|
96
96
|
updateApiKeyRequestOpts(requestParameters: UpdateApiKeyRequest): Promise<runtime.RequestOpts>;
|
|
97
97
|
/**
|
|
98
|
-
* Changes a key\'s name, budget, model allowlist, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
98
|
+
* Changes a key\'s name, budget, model allowlist, backup models, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models`, `fallback_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
99
99
|
* Update an API key\'s name or limits
|
|
100
100
|
*/
|
|
101
101
|
updateApiKeyRaw(requestParameters: UpdateApiKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiKey>>;
|
|
102
102
|
/**
|
|
103
|
-
* Changes a key\'s name, budget, model allowlist, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
103
|
+
* Changes a key\'s name, budget, model allowlist, backup models, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models`, `fallback_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
104
104
|
* Update an API key\'s name or limits
|
|
105
105
|
*/
|
|
106
106
|
updateApiKey(requestParameters: UpdateApiKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiKey>;
|
package/dist/apis/ApiKeysApi.js
CHANGED
|
@@ -260,7 +260,7 @@ class ApiKeysApi extends runtime.BaseAPI {
|
|
|
260
260
|
});
|
|
261
261
|
}
|
|
262
262
|
/**
|
|
263
|
-
* Changes a key\'s name, budget, model allowlist, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
263
|
+
* Changes a key\'s name, budget, model allowlist, backup models, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models`, `fallback_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
264
264
|
* Update an API key\'s name or limits
|
|
265
265
|
*/
|
|
266
266
|
updateApiKeyRaw(requestParameters, initOverrides) {
|
|
@@ -271,7 +271,7 @@ class ApiKeysApi extends runtime.BaseAPI {
|
|
|
271
271
|
});
|
|
272
272
|
}
|
|
273
273
|
/**
|
|
274
|
-
* Changes a key\'s name, budget, model allowlist, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
274
|
+
* Changes a key\'s name, budget, model allowlist, backup models, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models`, `fallback_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
275
275
|
* Update an API key\'s name or limits
|
|
276
276
|
*/
|
|
277
277
|
updateApiKey(requestParameters, initOverrides) {
|
|
@@ -134,12 +134,12 @@ export declare class BillingApi extends runtime.BaseAPI {
|
|
|
134
134
|
*/
|
|
135
135
|
getReferralRequestOpts(): Promise<runtime.RequestOpts>;
|
|
136
136
|
/**
|
|
137
|
-
* Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link;
|
|
137
|
+
* Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; once a friend who signed up through it has made `qualify_deposit_cents` of net real deposits (card, auto-pay or crypto, less refunds), the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. Both rewards are reversed if the qualifying deposit is later refunded. The deposit commission is retired and `commission_pct` is 0; when it is non-zero the referrer also earns that percent of every real deposit the friend makes. `commission_earned_cents` still reports commission earned before retirement. Program rewards never apply to the subscription. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
|
|
138
138
|
* Get the org referral code, invite link, terms and stats
|
|
139
139
|
*/
|
|
140
140
|
getReferralRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Referral>>;
|
|
141
141
|
/**
|
|
142
|
-
* Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link;
|
|
142
|
+
* Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; once a friend who signed up through it has made `qualify_deposit_cents` of net real deposits (card, auto-pay or crypto, less refunds), the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. Both rewards are reversed if the qualifying deposit is later refunded. The deposit commission is retired and `commission_pct` is 0; when it is non-zero the referrer also earns that percent of every real deposit the friend makes. `commission_earned_cents` still reports commission earned before retirement. Program rewards never apply to the subscription. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
|
|
143
143
|
* Get the org referral code, invite link, terms and stats
|
|
144
144
|
*/
|
|
145
145
|
getReferral(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Referral>;
|
package/dist/apis/BillingApi.js
CHANGED
|
@@ -341,7 +341,7 @@ class BillingApi extends runtime.BaseAPI {
|
|
|
341
341
|
});
|
|
342
342
|
}
|
|
343
343
|
/**
|
|
344
|
-
* Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link;
|
|
344
|
+
* Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; once a friend who signed up through it has made `qualify_deposit_cents` of net real deposits (card, auto-pay or crypto, less refunds), the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. Both rewards are reversed if the qualifying deposit is later refunded. The deposit commission is retired and `commission_pct` is 0; when it is non-zero the referrer also earns that percent of every real deposit the friend makes. `commission_earned_cents` still reports commission earned before retirement. Program rewards never apply to the subscription. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
|
|
345
345
|
* Get the org referral code, invite link, terms and stats
|
|
346
346
|
*/
|
|
347
347
|
getReferralRaw(initOverrides) {
|
|
@@ -352,7 +352,7 @@ class BillingApi extends runtime.BaseAPI {
|
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
354
|
/**
|
|
355
|
-
* Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link;
|
|
355
|
+
* Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; once a friend who signed up through it has made `qualify_deposit_cents` of net real deposits (card, auto-pay or crypto, less refunds), the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. Both rewards are reversed if the qualifying deposit is later refunded. The deposit commission is retired and `commission_pct` is 0; when it is non-zero the referrer also earns that percent of every real deposit the friend makes. `commission_earned_cents` still reports commission earned before retirement. Program rewards never apply to the subscription. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
|
|
356
356
|
* Get the org referral code, invite link, terms and stats
|
|
357
357
|
*/
|
|
358
358
|
getReferral(initOverrides) {
|
|
@@ -28,6 +28,7 @@ export interface CancelVideoRequest {
|
|
|
28
28
|
export interface CreateChatCompletionRequest {
|
|
29
29
|
chatCompletionRequest: ChatCompletionRequest;
|
|
30
30
|
xClientRequestId?: string;
|
|
31
|
+
xDeeprelayFallbackModels?: string;
|
|
31
32
|
}
|
|
32
33
|
export interface CreateEmbeddingsRequest {
|
|
33
34
|
embeddingsRequest: EmbeddingsRequest;
|
|
@@ -84,12 +85,12 @@ export declare class InferenceApi extends runtime.BaseAPI {
|
|
|
84
85
|
*/
|
|
85
86
|
createChatCompletionRequestOpts(requestParameters: CreateChatCompletionRequest): Promise<runtime.RequestOpts>;
|
|
86
87
|
/**
|
|
87
|
-
* OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** `response_format`, `tools`/`tool_choice`, `logprobs`/`top_logprobs` and `image_url` content parts are sent only to a model whose `/v1/models` entry lists the capability in `supported_parameters` (`vision` for images). A model without it returns 400 `unsupported_parameter` whose message names the models that do support it. When the model supports the parameter but none of its currently routable upstreams does, the request fails with 503 `upstream_unavailable` rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** `reasoning_effort`, `presence_penalty`, `frequency_penalty`, `seed` and `parallel_tool_calls` are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the `x-deeprelay-ignored-params` response header. - **Rejected everywhere.** `logit_bias` and `function_call` return 400 `unsupported_parameter`; `input_audio` and `file` content parts return 400 `unsupported_content_part`. A non-strict `json_schema` sent to a model that can only guarantee JSON is served as `json_object` and reported as `response_format:downgraded`; a strict one is rejected. A `json_schema` over 64 KiB or nested deeper than 32 levels returns 400 `unsupported_parameter` (param `response_format`). An upstream rejection of a request the relay accepted returns 400 `upstream_rejected_request`. A non-chat model id returns 404 `model_not_found`. The request body is capped at 32 MiB (413 `request_too_large`). Every successful response carries `usage.cost` and `usage.cost_details` (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility.
|
|
88
|
+
* OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** `response_format`, `tools`/`tool_choice`, `logprobs`/`top_logprobs` and `image_url` content parts are sent only to a model whose `/v1/models` entry lists the capability in `supported_parameters` (`vision` for images). A model without it returns 400 `unsupported_parameter` whose message names the models that do support it. When the model supports the parameter but none of its currently routable upstreams does, the request fails with 503 `upstream_unavailable` rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** `reasoning_effort`, `presence_penalty`, `frequency_penalty`, `seed` and `parallel_tool_calls` are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the `x-deeprelay-ignored-params` response header. - **Rejected everywhere.** `logit_bias` and `function_call` return 400 `unsupported_parameter`; `input_audio` and `file` content parts return 400 `unsupported_content_part`. A non-strict `json_schema` sent to a model that can only guarantee JSON is served as `json_object` and reported as `response_format:downgraded`; a strict one is rejected. A `json_schema` over 64 KiB or nested deeper than 32 levels returns 400 `unsupported_parameter` (param `response_format`). An upstream rejection of a request the relay accepted returns 400 `upstream_rejected_request`. A non-chat model id returns 404 `model_not_found`. The request body is capped at 32 MiB (413 `request_too_large`). Every successful response carries `usage.cost` and `usage.cost_details` (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility. **Backup models.** When the API key has `fallback_models`, or the request sends `models` or X-Deeprelay-Fallback-Models, and every provider for the requested model fails before the first token with a temporary error (unavailable, timed out, rate limited upstream, or stalled), deeprelay tries the next backup model. It never switches after the first byte, and never on a client error, a quota or budget refusal, or a content-filter result. A backup is billed at its own price under the same billing mode as the requested model. The body `model` and X-Deeprelay-Served-Model name the model that served; X-Deeprelay-Requested-Model names the one asked for, and X-Deeprelay-Fallback-Reason says why it was passed over. If no model serves, the response is the requested model\'s own error, with X-Deeprelay-Fallback-Attempted.
|
|
88
89
|
* Create a chat completion (OpenAI-compatible)
|
|
89
90
|
*/
|
|
90
91
|
createChatCompletionRaw(requestParameters: CreateChatCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChatCompletionResponse>>;
|
|
91
92
|
/**
|
|
92
|
-
* OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** `response_format`, `tools`/`tool_choice`, `logprobs`/`top_logprobs` and `image_url` content parts are sent only to a model whose `/v1/models` entry lists the capability in `supported_parameters` (`vision` for images). A model without it returns 400 `unsupported_parameter` whose message names the models that do support it. When the model supports the parameter but none of its currently routable upstreams does, the request fails with 503 `upstream_unavailable` rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** `reasoning_effort`, `presence_penalty`, `frequency_penalty`, `seed` and `parallel_tool_calls` are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the `x-deeprelay-ignored-params` response header. - **Rejected everywhere.** `logit_bias` and `function_call` return 400 `unsupported_parameter`; `input_audio` and `file` content parts return 400 `unsupported_content_part`. A non-strict `json_schema` sent to a model that can only guarantee JSON is served as `json_object` and reported as `response_format:downgraded`; a strict one is rejected. A `json_schema` over 64 KiB or nested deeper than 32 levels returns 400 `unsupported_parameter` (param `response_format`). An upstream rejection of a request the relay accepted returns 400 `upstream_rejected_request`. A non-chat model id returns 404 `model_not_found`. The request body is capped at 32 MiB (413 `request_too_large`). Every successful response carries `usage.cost` and `usage.cost_details` (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility.
|
|
93
|
+
* OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** `response_format`, `tools`/`tool_choice`, `logprobs`/`top_logprobs` and `image_url` content parts are sent only to a model whose `/v1/models` entry lists the capability in `supported_parameters` (`vision` for images). A model without it returns 400 `unsupported_parameter` whose message names the models that do support it. When the model supports the parameter but none of its currently routable upstreams does, the request fails with 503 `upstream_unavailable` rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** `reasoning_effort`, `presence_penalty`, `frequency_penalty`, `seed` and `parallel_tool_calls` are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the `x-deeprelay-ignored-params` response header. - **Rejected everywhere.** `logit_bias` and `function_call` return 400 `unsupported_parameter`; `input_audio` and `file` content parts return 400 `unsupported_content_part`. A non-strict `json_schema` sent to a model that can only guarantee JSON is served as `json_object` and reported as `response_format:downgraded`; a strict one is rejected. A `json_schema` over 64 KiB or nested deeper than 32 levels returns 400 `unsupported_parameter` (param `response_format`). An upstream rejection of a request the relay accepted returns 400 `upstream_rejected_request`. A non-chat model id returns 404 `model_not_found`. The request body is capped at 32 MiB (413 `request_too_large`). Every successful response carries `usage.cost` and `usage.cost_details` (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility. **Backup models.** When the API key has `fallback_models`, or the request sends `models` or X-Deeprelay-Fallback-Models, and every provider for the requested model fails before the first token with a temporary error (unavailable, timed out, rate limited upstream, or stalled), deeprelay tries the next backup model. It never switches after the first byte, and never on a client error, a quota or budget refusal, or a content-filter result. A backup is billed at its own price under the same billing mode as the requested model. The body `model` and X-Deeprelay-Served-Model name the model that served; X-Deeprelay-Requested-Model names the one asked for, and X-Deeprelay-Fallback-Reason says why it was passed over. If no model serves, the response is the requested model\'s own error, with X-Deeprelay-Fallback-Attempted.
|
|
93
94
|
* Create a chat completion (OpenAI-compatible)
|
|
94
95
|
*/
|
|
95
96
|
createChatCompletion(requestParameters: CreateChatCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChatCompletionResponse>;
|
|
@@ -100,6 +100,9 @@ class InferenceApi extends runtime.BaseAPI {
|
|
|
100
100
|
if (requestParameters['xClientRequestId'] != null) {
|
|
101
101
|
headerParameters['X-Client-Request-Id'] = String(requestParameters['xClientRequestId']);
|
|
102
102
|
}
|
|
103
|
+
if (requestParameters['xDeeprelayFallbackModels'] != null) {
|
|
104
|
+
headerParameters['X-Deeprelay-Fallback-Models'] = String(requestParameters['xDeeprelayFallbackModels']);
|
|
105
|
+
}
|
|
103
106
|
if (this.configuration && this.configuration.accessToken) {
|
|
104
107
|
const token = this.configuration.accessToken;
|
|
105
108
|
const tokenString = yield token("bearerAuth", []);
|
|
@@ -118,7 +121,7 @@ class InferenceApi extends runtime.BaseAPI {
|
|
|
118
121
|
});
|
|
119
122
|
}
|
|
120
123
|
/**
|
|
121
|
-
* OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** `response_format`, `tools`/`tool_choice`, `logprobs`/`top_logprobs` and `image_url` content parts are sent only to a model whose `/v1/models` entry lists the capability in `supported_parameters` (`vision` for images). A model without it returns 400 `unsupported_parameter` whose message names the models that do support it. When the model supports the parameter but none of its currently routable upstreams does, the request fails with 503 `upstream_unavailable` rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** `reasoning_effort`, `presence_penalty`, `frequency_penalty`, `seed` and `parallel_tool_calls` are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the `x-deeprelay-ignored-params` response header. - **Rejected everywhere.** `logit_bias` and `function_call` return 400 `unsupported_parameter`; `input_audio` and `file` content parts return 400 `unsupported_content_part`. A non-strict `json_schema` sent to a model that can only guarantee JSON is served as `json_object` and reported as `response_format:downgraded`; a strict one is rejected. A `json_schema` over 64 KiB or nested deeper than 32 levels returns 400 `unsupported_parameter` (param `response_format`). An upstream rejection of a request the relay accepted returns 400 `upstream_rejected_request`. A non-chat model id returns 404 `model_not_found`. The request body is capped at 32 MiB (413 `request_too_large`). Every successful response carries `usage.cost` and `usage.cost_details` (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility.
|
|
124
|
+
* OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** `response_format`, `tools`/`tool_choice`, `logprobs`/`top_logprobs` and `image_url` content parts are sent only to a model whose `/v1/models` entry lists the capability in `supported_parameters` (`vision` for images). A model without it returns 400 `unsupported_parameter` whose message names the models that do support it. When the model supports the parameter but none of its currently routable upstreams does, the request fails with 503 `upstream_unavailable` rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** `reasoning_effort`, `presence_penalty`, `frequency_penalty`, `seed` and `parallel_tool_calls` are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the `x-deeprelay-ignored-params` response header. - **Rejected everywhere.** `logit_bias` and `function_call` return 400 `unsupported_parameter`; `input_audio` and `file` content parts return 400 `unsupported_content_part`. A non-strict `json_schema` sent to a model that can only guarantee JSON is served as `json_object` and reported as `response_format:downgraded`; a strict one is rejected. A `json_schema` over 64 KiB or nested deeper than 32 levels returns 400 `unsupported_parameter` (param `response_format`). An upstream rejection of a request the relay accepted returns 400 `upstream_rejected_request`. A non-chat model id returns 404 `model_not_found`. The request body is capped at 32 MiB (413 `request_too_large`). Every successful response carries `usage.cost` and `usage.cost_details` (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility. **Backup models.** When the API key has `fallback_models`, or the request sends `models` or X-Deeprelay-Fallback-Models, and every provider for the requested model fails before the first token with a temporary error (unavailable, timed out, rate limited upstream, or stalled), deeprelay tries the next backup model. It never switches after the first byte, and never on a client error, a quota or budget refusal, or a content-filter result. A backup is billed at its own price under the same billing mode as the requested model. The body `model` and X-Deeprelay-Served-Model name the model that served; X-Deeprelay-Requested-Model names the one asked for, and X-Deeprelay-Fallback-Reason says why it was passed over. If no model serves, the response is the requested model\'s own error, with X-Deeprelay-Fallback-Attempted.
|
|
122
125
|
* Create a chat completion (OpenAI-compatible)
|
|
123
126
|
*/
|
|
124
127
|
createChatCompletionRaw(requestParameters, initOverrides) {
|
|
@@ -129,7 +132,7 @@ class InferenceApi extends runtime.BaseAPI {
|
|
|
129
132
|
});
|
|
130
133
|
}
|
|
131
134
|
/**
|
|
132
|
-
* OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** `response_format`, `tools`/`tool_choice`, `logprobs`/`top_logprobs` and `image_url` content parts are sent only to a model whose `/v1/models` entry lists the capability in `supported_parameters` (`vision` for images). A model without it returns 400 `unsupported_parameter` whose message names the models that do support it. When the model supports the parameter but none of its currently routable upstreams does, the request fails with 503 `upstream_unavailable` rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** `reasoning_effort`, `presence_penalty`, `frequency_penalty`, `seed` and `parallel_tool_calls` are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the `x-deeprelay-ignored-params` response header. - **Rejected everywhere.** `logit_bias` and `function_call` return 400 `unsupported_parameter`; `input_audio` and `file` content parts return 400 `unsupported_content_part`. A non-strict `json_schema` sent to a model that can only guarantee JSON is served as `json_object` and reported as `response_format:downgraded`; a strict one is rejected. A `json_schema` over 64 KiB or nested deeper than 32 levels returns 400 `unsupported_parameter` (param `response_format`). An upstream rejection of a request the relay accepted returns 400 `upstream_rejected_request`. A non-chat model id returns 404 `model_not_found`. The request body is capped at 32 MiB (413 `request_too_large`). Every successful response carries `usage.cost` and `usage.cost_details` (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility.
|
|
135
|
+
* OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** `response_format`, `tools`/`tool_choice`, `logprobs`/`top_logprobs` and `image_url` content parts are sent only to a model whose `/v1/models` entry lists the capability in `supported_parameters` (`vision` for images). A model without it returns 400 `unsupported_parameter` whose message names the models that do support it. When the model supports the parameter but none of its currently routable upstreams does, the request fails with 503 `upstream_unavailable` rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** `reasoning_effort`, `presence_penalty`, `frequency_penalty`, `seed` and `parallel_tool_calls` are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the `x-deeprelay-ignored-params` response header. - **Rejected everywhere.** `logit_bias` and `function_call` return 400 `unsupported_parameter`; `input_audio` and `file` content parts return 400 `unsupported_content_part`. A non-strict `json_schema` sent to a model that can only guarantee JSON is served as `json_object` and reported as `response_format:downgraded`; a strict one is rejected. A `json_schema` over 64 KiB or nested deeper than 32 levels returns 400 `unsupported_parameter` (param `response_format`). An upstream rejection of a request the relay accepted returns 400 `upstream_rejected_request`. A non-chat model id returns 404 `model_not_found`. The request body is capped at 32 MiB (413 `request_too_large`). Every successful response carries `usage.cost` and `usage.cost_details` (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility. **Backup models.** When the API key has `fallback_models`, or the request sends `models` or X-Deeprelay-Fallback-Models, and every provider for the requested model fails before the first token with a temporary error (unavailable, timed out, rate limited upstream, or stalled), deeprelay tries the next backup model. It never switches after the first byte, and never on a client error, a quota or budget refusal, or a content-filter result. A backup is billed at its own price under the same billing mode as the requested model. The body `model` and X-Deeprelay-Served-Model name the model that served; X-Deeprelay-Requested-Model names the one asked for, and X-Deeprelay-Fallback-Reason says why it was passed over. If no model serves, the response is the requested model\'s own error, with X-Deeprelay-Fallback-Attempted.
|
|
133
136
|
* Create a chat completion (OpenAI-compatible)
|
|
134
137
|
*/
|
|
135
138
|
createChatCompletion(requestParameters, initOverrides) {
|
|
@@ -21,6 +21,7 @@ export interface ExportRequestsRequest {
|
|
|
21
21
|
clientRequestId?: string;
|
|
22
22
|
from?: Date;
|
|
23
23
|
to?: Date;
|
|
24
|
+
fallback?: boolean;
|
|
24
25
|
}
|
|
25
26
|
export interface GetRequestRequest {
|
|
26
27
|
id: string;
|
|
@@ -34,6 +35,7 @@ export interface ListRequestsRequest {
|
|
|
34
35
|
clientRequestId?: string;
|
|
35
36
|
from?: Date;
|
|
36
37
|
to?: Date;
|
|
38
|
+
fallback?: boolean;
|
|
37
39
|
cursor?: string;
|
|
38
40
|
limit?: number;
|
|
39
41
|
}
|
|
@@ -46,12 +48,12 @@ export declare class RequestsApi extends runtime.BaseAPI {
|
|
|
46
48
|
*/
|
|
47
49
|
exportRequestsRequestOpts(requestParameters: ExportRequestsRequest): Promise<runtime.RequestOpts>;
|
|
48
50
|
/**
|
|
49
|
-
* Streams every request-log row matching the filters as a CSV attachment, oldest columns first: `request_id, client_request_id, occurred_at, surface, model, key_id, key_name, key_prefix, status, http_status, error_code, finish_reason, prompt_tokens, completion_tokens, cached_tokens, reasoning_tokens, quota_units, cost, plan_covered, ttft_ms, duration_ms, ignored_params`. Takes the same filters and visibility rules as `GET /requests`, without the cursor and limit. The export is counted before anything is written. When the filters match more rows than the export cap, the answer is 422 `export_too_large` and the problem body carries `max_rows`; narrow the time range or add a filter, then export again. Requires the `serverless:read` scope. Exports have their own, tighter per-key rate limit.
|
|
51
|
+
* Streams every request-log row matching the filters as a CSV attachment, oldest columns first: `request_id, client_request_id, occurred_at, surface, model, key_id, key_name, key_prefix, status, http_status, error_code, finish_reason, prompt_tokens, completion_tokens, cached_tokens, reasoning_tokens, quota_units, cost, plan_covered, ttft_ms, duration_ms, ignored_params, requested_model, served_model, fallback_reason`. Takes the same filters and visibility rules as `GET /requests`, without the cursor and limit. The export is counted before anything is written. When the filters match more rows than the export cap, the answer is 422 `export_too_large` and the problem body carries `max_rows`; narrow the time range or add a filter, then export again. Requires the `serverless:read` scope. Exports have their own, tighter per-key rate limit.
|
|
50
52
|
* Export the request log as CSV
|
|
51
53
|
*/
|
|
52
54
|
exportRequestsRaw(requestParameters: ExportRequestsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
|
|
53
55
|
/**
|
|
54
|
-
* Streams every request-log row matching the filters as a CSV attachment, oldest columns first: `request_id, client_request_id, occurred_at, surface, model, key_id, key_name, key_prefix, status, http_status, error_code, finish_reason, prompt_tokens, completion_tokens, cached_tokens, reasoning_tokens, quota_units, cost, plan_covered, ttft_ms, duration_ms, ignored_params`. Takes the same filters and visibility rules as `GET /requests`, without the cursor and limit. The export is counted before anything is written. When the filters match more rows than the export cap, the answer is 422 `export_too_large` and the problem body carries `max_rows`; narrow the time range or add a filter, then export again. Requires the `serverless:read` scope. Exports have their own, tighter per-key rate limit.
|
|
56
|
+
* Streams every request-log row matching the filters as a CSV attachment, oldest columns first: `request_id, client_request_id, occurred_at, surface, model, key_id, key_name, key_prefix, status, http_status, error_code, finish_reason, prompt_tokens, completion_tokens, cached_tokens, reasoning_tokens, quota_units, cost, plan_covered, ttft_ms, duration_ms, ignored_params, requested_model, served_model, fallback_reason`. Takes the same filters and visibility rules as `GET /requests`, without the cursor and limit. The export is counted before anything is written. When the filters match more rows than the export cap, the answer is 422 `export_too_large` and the problem body carries `max_rows`; narrow the time range or add a filter, then export again. Requires the `serverless:read` scope. Exports have their own, tighter per-key rate limit.
|
|
55
57
|
* Export the request log as CSV
|
|
56
58
|
*/
|
|
57
59
|
exportRequests(requestParameters?: ExportRequestsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
|
package/dist/apis/RequestsApi.js
CHANGED
|
@@ -60,6 +60,9 @@ class RequestsApi extends runtime.BaseAPI {
|
|
|
60
60
|
if (requestParameters['to'] != null) {
|
|
61
61
|
queryParameters['to'] = requestParameters['to'].toISOString();
|
|
62
62
|
}
|
|
63
|
+
if (requestParameters['fallback'] != null) {
|
|
64
|
+
queryParameters['fallback'] = requestParameters['fallback'];
|
|
65
|
+
}
|
|
63
66
|
const headerParameters = {};
|
|
64
67
|
if (this.configuration && this.configuration.accessToken) {
|
|
65
68
|
const token = this.configuration.accessToken;
|
|
@@ -78,7 +81,7 @@ class RequestsApi extends runtime.BaseAPI {
|
|
|
78
81
|
});
|
|
79
82
|
}
|
|
80
83
|
/**
|
|
81
|
-
* Streams every request-log row matching the filters as a CSV attachment, oldest columns first: `request_id, client_request_id, occurred_at, surface, model, key_id, key_name, key_prefix, status, http_status, error_code, finish_reason, prompt_tokens, completion_tokens, cached_tokens, reasoning_tokens, quota_units, cost, plan_covered, ttft_ms, duration_ms, ignored_params`. Takes the same filters and visibility rules as `GET /requests`, without the cursor and limit. The export is counted before anything is written. When the filters match more rows than the export cap, the answer is 422 `export_too_large` and the problem body carries `max_rows`; narrow the time range or add a filter, then export again. Requires the `serverless:read` scope. Exports have their own, tighter per-key rate limit.
|
|
84
|
+
* Streams every request-log row matching the filters as a CSV attachment, oldest columns first: `request_id, client_request_id, occurred_at, surface, model, key_id, key_name, key_prefix, status, http_status, error_code, finish_reason, prompt_tokens, completion_tokens, cached_tokens, reasoning_tokens, quota_units, cost, plan_covered, ttft_ms, duration_ms, ignored_params, requested_model, served_model, fallback_reason`. Takes the same filters and visibility rules as `GET /requests`, without the cursor and limit. The export is counted before anything is written. When the filters match more rows than the export cap, the answer is 422 `export_too_large` and the problem body carries `max_rows`; narrow the time range or add a filter, then export again. Requires the `serverless:read` scope. Exports have their own, tighter per-key rate limit.
|
|
82
85
|
* Export the request log as CSV
|
|
83
86
|
*/
|
|
84
87
|
exportRequestsRaw(requestParameters, initOverrides) {
|
|
@@ -94,7 +97,7 @@ class RequestsApi extends runtime.BaseAPI {
|
|
|
94
97
|
});
|
|
95
98
|
}
|
|
96
99
|
/**
|
|
97
|
-
* Streams every request-log row matching the filters as a CSV attachment, oldest columns first: `request_id, client_request_id, occurred_at, surface, model, key_id, key_name, key_prefix, status, http_status, error_code, finish_reason, prompt_tokens, completion_tokens, cached_tokens, reasoning_tokens, quota_units, cost, plan_covered, ttft_ms, duration_ms, ignored_params`. Takes the same filters and visibility rules as `GET /requests`, without the cursor and limit. The export is counted before anything is written. When the filters match more rows than the export cap, the answer is 422 `export_too_large` and the problem body carries `max_rows`; narrow the time range or add a filter, then export again. Requires the `serverless:read` scope. Exports have their own, tighter per-key rate limit.
|
|
100
|
+
* Streams every request-log row matching the filters as a CSV attachment, oldest columns first: `request_id, client_request_id, occurred_at, surface, model, key_id, key_name, key_prefix, status, http_status, error_code, finish_reason, prompt_tokens, completion_tokens, cached_tokens, reasoning_tokens, quota_units, cost, plan_covered, ttft_ms, duration_ms, ignored_params, requested_model, served_model, fallback_reason`. Takes the same filters and visibility rules as `GET /requests`, without the cursor and limit. The export is counted before anything is written. When the filters match more rows than the export cap, the answer is 422 `export_too_large` and the problem body carries `max_rows`; narrow the time range or add a filter, then export again. Requires the `serverless:read` scope. Exports have their own, tighter per-key rate limit.
|
|
98
101
|
* Export the request log as CSV
|
|
99
102
|
*/
|
|
100
103
|
exportRequests() {
|
|
@@ -181,6 +184,9 @@ class RequestsApi extends runtime.BaseAPI {
|
|
|
181
184
|
if (requestParameters['to'] != null) {
|
|
182
185
|
queryParameters['to'] = requestParameters['to'].toISOString();
|
|
183
186
|
}
|
|
187
|
+
if (requestParameters['fallback'] != null) {
|
|
188
|
+
queryParameters['fallback'] = requestParameters['fallback'];
|
|
189
|
+
}
|
|
184
190
|
if (requestParameters['cursor'] != null) {
|
|
185
191
|
queryParameters['cursor'] = requestParameters['cursor'];
|
|
186
192
|
}
|
|
@@ -95,12 +95,12 @@ export declare class ApiKeysApi extends runtime.BaseAPI {
|
|
|
95
95
|
*/
|
|
96
96
|
updateApiKeyRequestOpts(requestParameters: UpdateApiKeyRequest): Promise<runtime.RequestOpts>;
|
|
97
97
|
/**
|
|
98
|
-
* Changes a key\'s name, budget, model allowlist, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
98
|
+
* Changes a key\'s name, budget, model allowlist, backup models, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models`, `fallback_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
99
99
|
* Update an API key\'s name or limits
|
|
100
100
|
*/
|
|
101
101
|
updateApiKeyRaw(requestParameters: UpdateApiKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiKey>>;
|
|
102
102
|
/**
|
|
103
|
-
* Changes a key\'s name, budget, model allowlist, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
103
|
+
* Changes a key\'s name, budget, model allowlist, backup models, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models`, `fallback_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
104
104
|
* Update an API key\'s name or limits
|
|
105
105
|
*/
|
|
106
106
|
updateApiKey(requestParameters: UpdateApiKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiKey>;
|
|
@@ -257,7 +257,7 @@ export class ApiKeysApi extends runtime.BaseAPI {
|
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
259
|
/**
|
|
260
|
-
* Changes a key\'s name, budget, model allowlist, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
260
|
+
* Changes a key\'s name, budget, model allowlist, backup models, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models`, `fallback_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
261
261
|
* Update an API key\'s name or limits
|
|
262
262
|
*/
|
|
263
263
|
updateApiKeyRaw(requestParameters, initOverrides) {
|
|
@@ -268,7 +268,7 @@ export class ApiKeysApi extends runtime.BaseAPI {
|
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
270
|
/**
|
|
271
|
-
* Changes a key\'s name, budget, model allowlist, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
271
|
+
* Changes a key\'s name, budget, model allowlist, backup models, rate limit or expiry. An absent field is left unchanged; an explicit `null` clears `budget_cents`, `allowed_models`, `fallback_models` or `expires_at`. `scopes` cannot be changed after minting, and unknown fields are refused (422), so a typo never looks like a successful change. Requires the `keys:manage` capability (403 `keys_manage_required` otherwise); a member can only change keys they created.
|
|
272
272
|
* Update an API key\'s name or limits
|
|
273
273
|
*/
|
|
274
274
|
updateApiKey(requestParameters, initOverrides) {
|
|
@@ -134,12 +134,12 @@ export declare class BillingApi extends runtime.BaseAPI {
|
|
|
134
134
|
*/
|
|
135
135
|
getReferralRequestOpts(): Promise<runtime.RequestOpts>;
|
|
136
136
|
/**
|
|
137
|
-
* Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link;
|
|
137
|
+
* Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; once a friend who signed up through it has made `qualify_deposit_cents` of net real deposits (card, auto-pay or crypto, less refunds), the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. Both rewards are reversed if the qualifying deposit is later refunded. The deposit commission is retired and `commission_pct` is 0; when it is non-zero the referrer also earns that percent of every real deposit the friend makes. `commission_earned_cents` still reports commission earned before retirement. Program rewards never apply to the subscription. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
|
|
138
138
|
* Get the org referral code, invite link, terms and stats
|
|
139
139
|
*/
|
|
140
140
|
getReferralRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Referral>>;
|
|
141
141
|
/**
|
|
142
|
-
* Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link;
|
|
142
|
+
* Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; once a friend who signed up through it has made `qualify_deposit_cents` of net real deposits (card, auto-pay or crypto, less refunds), the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. Both rewards are reversed if the qualifying deposit is later refunded. The deposit commission is retired and `commission_pct` is 0; when it is non-zero the referrer also earns that percent of every real deposit the friend makes. `commission_earned_cents` still reports commission earned before retirement. Program rewards never apply to the subscription. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
|
|
143
143
|
* Get the org referral code, invite link, terms and stats
|
|
144
144
|
*/
|
|
145
145
|
getReferral(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Referral>;
|
|
@@ -338,7 +338,7 @@ export class BillingApi extends runtime.BaseAPI {
|
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
340
|
/**
|
|
341
|
-
* Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link;
|
|
341
|
+
* Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; once a friend who signed up through it has made `qualify_deposit_cents` of net real deposits (card, auto-pay or crypto, less refunds), the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. Both rewards are reversed if the qualifying deposit is later refunded. The deposit commission is retired and `commission_pct` is 0; when it is non-zero the referrer also earns that percent of every real deposit the friend makes. `commission_earned_cents` still reports commission earned before retirement. Program rewards never apply to the subscription. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
|
|
342
342
|
* Get the org referral code, invite link, terms and stats
|
|
343
343
|
*/
|
|
344
344
|
getReferralRaw(initOverrides) {
|
|
@@ -349,7 +349,7 @@ export class BillingApi extends runtime.BaseAPI {
|
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
351
|
/**
|
|
352
|
-
* Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link;
|
|
352
|
+
* Returns the organization\'s shareable referral code and invite link (minting the code on first read), the program terms, the referrer\'s stats, and — when this organization itself signed up through someone else\'s link — its own progress toward the referee reward. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. The program: share the invite link; once a friend who signed up through it has made `qualify_deposit_cents` of net real deposits (card, auto-pay or crypto, less refunds), the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. Both rewards are reversed if the qualifying deposit is later refunded. The deposit commission is retired and `commission_pct` is 0; when it is non-zero the referrer also earns that percent of every real deposit the friend makes. `commission_earned_cents` still reports commission earned before retirement. Program rewards never apply to the subscription. The terms ride on the wire so a client never hard-codes the amounts. `referred` is ABSENT (not null) for an organization nobody referred — key on its presence. This is the same contract the dashboard\'s referral card reads.
|
|
353
353
|
* Get the org referral code, invite link, terms and stats
|
|
354
354
|
*/
|
|
355
355
|
getReferral(initOverrides) {
|
|
@@ -28,6 +28,7 @@ export interface CancelVideoRequest {
|
|
|
28
28
|
export interface CreateChatCompletionRequest {
|
|
29
29
|
chatCompletionRequest: ChatCompletionRequest;
|
|
30
30
|
xClientRequestId?: string;
|
|
31
|
+
xDeeprelayFallbackModels?: string;
|
|
31
32
|
}
|
|
32
33
|
export interface CreateEmbeddingsRequest {
|
|
33
34
|
embeddingsRequest: EmbeddingsRequest;
|
|
@@ -84,12 +85,12 @@ export declare class InferenceApi extends runtime.BaseAPI {
|
|
|
84
85
|
*/
|
|
85
86
|
createChatCompletionRequestOpts(requestParameters: CreateChatCompletionRequest): Promise<runtime.RequestOpts>;
|
|
86
87
|
/**
|
|
87
|
-
* OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** `response_format`, `tools`/`tool_choice`, `logprobs`/`top_logprobs` and `image_url` content parts are sent only to a model whose `/v1/models` entry lists the capability in `supported_parameters` (`vision` for images). A model without it returns 400 `unsupported_parameter` whose message names the models that do support it. When the model supports the parameter but none of its currently routable upstreams does, the request fails with 503 `upstream_unavailable` rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** `reasoning_effort`, `presence_penalty`, `frequency_penalty`, `seed` and `parallel_tool_calls` are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the `x-deeprelay-ignored-params` response header. - **Rejected everywhere.** `logit_bias` and `function_call` return 400 `unsupported_parameter`; `input_audio` and `file` content parts return 400 `unsupported_content_part`. A non-strict `json_schema` sent to a model that can only guarantee JSON is served as `json_object` and reported as `response_format:downgraded`; a strict one is rejected. A `json_schema` over 64 KiB or nested deeper than 32 levels returns 400 `unsupported_parameter` (param `response_format`). An upstream rejection of a request the relay accepted returns 400 `upstream_rejected_request`. A non-chat model id returns 404 `model_not_found`. The request body is capped at 32 MiB (413 `request_too_large`). Every successful response carries `usage.cost` and `usage.cost_details` (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility.
|
|
88
|
+
* OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** `response_format`, `tools`/`tool_choice`, `logprobs`/`top_logprobs` and `image_url` content parts are sent only to a model whose `/v1/models` entry lists the capability in `supported_parameters` (`vision` for images). A model without it returns 400 `unsupported_parameter` whose message names the models that do support it. When the model supports the parameter but none of its currently routable upstreams does, the request fails with 503 `upstream_unavailable` rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** `reasoning_effort`, `presence_penalty`, `frequency_penalty`, `seed` and `parallel_tool_calls` are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the `x-deeprelay-ignored-params` response header. - **Rejected everywhere.** `logit_bias` and `function_call` return 400 `unsupported_parameter`; `input_audio` and `file` content parts return 400 `unsupported_content_part`. A non-strict `json_schema` sent to a model that can only guarantee JSON is served as `json_object` and reported as `response_format:downgraded`; a strict one is rejected. A `json_schema` over 64 KiB or nested deeper than 32 levels returns 400 `unsupported_parameter` (param `response_format`). An upstream rejection of a request the relay accepted returns 400 `upstream_rejected_request`. A non-chat model id returns 404 `model_not_found`. The request body is capped at 32 MiB (413 `request_too_large`). Every successful response carries `usage.cost` and `usage.cost_details` (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility. **Backup models.** When the API key has `fallback_models`, or the request sends `models` or X-Deeprelay-Fallback-Models, and every provider for the requested model fails before the first token with a temporary error (unavailable, timed out, rate limited upstream, or stalled), deeprelay tries the next backup model. It never switches after the first byte, and never on a client error, a quota or budget refusal, or a content-filter result. A backup is billed at its own price under the same billing mode as the requested model. The body `model` and X-Deeprelay-Served-Model name the model that served; X-Deeprelay-Requested-Model names the one asked for, and X-Deeprelay-Fallback-Reason says why it was passed over. If no model serves, the response is the requested model\'s own error, with X-Deeprelay-Fallback-Attempted.
|
|
88
89
|
* Create a chat completion (OpenAI-compatible)
|
|
89
90
|
*/
|
|
90
91
|
createChatCompletionRaw(requestParameters: CreateChatCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChatCompletionResponse>>;
|
|
91
92
|
/**
|
|
92
|
-
* OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** `response_format`, `tools`/`tool_choice`, `logprobs`/`top_logprobs` and `image_url` content parts are sent only to a model whose `/v1/models` entry lists the capability in `supported_parameters` (`vision` for images). A model without it returns 400 `unsupported_parameter` whose message names the models that do support it. When the model supports the parameter but none of its currently routable upstreams does, the request fails with 503 `upstream_unavailable` rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** `reasoning_effort`, `presence_penalty`, `frequency_penalty`, `seed` and `parallel_tool_calls` are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the `x-deeprelay-ignored-params` response header. - **Rejected everywhere.** `logit_bias` and `function_call` return 400 `unsupported_parameter`; `input_audio` and `file` content parts return 400 `unsupported_content_part`. A non-strict `json_schema` sent to a model that can only guarantee JSON is served as `json_object` and reported as `response_format:downgraded`; a strict one is rejected. A `json_schema` over 64 KiB or nested deeper than 32 levels returns 400 `unsupported_parameter` (param `response_format`). An upstream rejection of a request the relay accepted returns 400 `upstream_rejected_request`. A non-chat model id returns 404 `model_not_found`. The request body is capped at 32 MiB (413 `request_too_large`). Every successful response carries `usage.cost` and `usage.cost_details` (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility.
|
|
93
|
+
* OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** `response_format`, `tools`/`tool_choice`, `logprobs`/`top_logprobs` and `image_url` content parts are sent only to a model whose `/v1/models` entry lists the capability in `supported_parameters` (`vision` for images). A model without it returns 400 `unsupported_parameter` whose message names the models that do support it. When the model supports the parameter but none of its currently routable upstreams does, the request fails with 503 `upstream_unavailable` rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** `reasoning_effort`, `presence_penalty`, `frequency_penalty`, `seed` and `parallel_tool_calls` are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the `x-deeprelay-ignored-params` response header. - **Rejected everywhere.** `logit_bias` and `function_call` return 400 `unsupported_parameter`; `input_audio` and `file` content parts return 400 `unsupported_content_part`. A non-strict `json_schema` sent to a model that can only guarantee JSON is served as `json_object` and reported as `response_format:downgraded`; a strict one is rejected. A `json_schema` over 64 KiB or nested deeper than 32 levels returns 400 `unsupported_parameter` (param `response_format`). An upstream rejection of a request the relay accepted returns 400 `upstream_rejected_request`. A non-chat model id returns 404 `model_not_found`. The request body is capped at 32 MiB (413 `request_too_large`). Every successful response carries `usage.cost` and `usage.cost_details` (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility. **Backup models.** When the API key has `fallback_models`, or the request sends `models` or X-Deeprelay-Fallback-Models, and every provider for the requested model fails before the first token with a temporary error (unavailable, timed out, rate limited upstream, or stalled), deeprelay tries the next backup model. It never switches after the first byte, and never on a client error, a quota or budget refusal, or a content-filter result. A backup is billed at its own price under the same billing mode as the requested model. The body `model` and X-Deeprelay-Served-Model name the model that served; X-Deeprelay-Requested-Model names the one asked for, and X-Deeprelay-Fallback-Reason says why it was passed over. If no model serves, the response is the requested model\'s own error, with X-Deeprelay-Fallback-Attempted.
|
|
93
94
|
* Create a chat completion (OpenAI-compatible)
|
|
94
95
|
*/
|
|
95
96
|
createChatCompletion(requestParameters: CreateChatCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChatCompletionResponse>;
|
|
@@ -97,6 +97,9 @@ export class InferenceApi extends runtime.BaseAPI {
|
|
|
97
97
|
if (requestParameters['xClientRequestId'] != null) {
|
|
98
98
|
headerParameters['X-Client-Request-Id'] = String(requestParameters['xClientRequestId']);
|
|
99
99
|
}
|
|
100
|
+
if (requestParameters['xDeeprelayFallbackModels'] != null) {
|
|
101
|
+
headerParameters['X-Deeprelay-Fallback-Models'] = String(requestParameters['xDeeprelayFallbackModels']);
|
|
102
|
+
}
|
|
100
103
|
if (this.configuration && this.configuration.accessToken) {
|
|
101
104
|
const token = this.configuration.accessToken;
|
|
102
105
|
const tokenString = yield token("bearerAuth", []);
|
|
@@ -115,7 +118,7 @@ export class InferenceApi extends runtime.BaseAPI {
|
|
|
115
118
|
});
|
|
116
119
|
}
|
|
117
120
|
/**
|
|
118
|
-
* OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** `response_format`, `tools`/`tool_choice`, `logprobs`/`top_logprobs` and `image_url` content parts are sent only to a model whose `/v1/models` entry lists the capability in `supported_parameters` (`vision` for images). A model without it returns 400 `unsupported_parameter` whose message names the models that do support it. When the model supports the parameter but none of its currently routable upstreams does, the request fails with 503 `upstream_unavailable` rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** `reasoning_effort`, `presence_penalty`, `frequency_penalty`, `seed` and `parallel_tool_calls` are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the `x-deeprelay-ignored-params` response header. - **Rejected everywhere.** `logit_bias` and `function_call` return 400 `unsupported_parameter`; `input_audio` and `file` content parts return 400 `unsupported_content_part`. A non-strict `json_schema` sent to a model that can only guarantee JSON is served as `json_object` and reported as `response_format:downgraded`; a strict one is rejected. A `json_schema` over 64 KiB or nested deeper than 32 levels returns 400 `unsupported_parameter` (param `response_format`). An upstream rejection of a request the relay accepted returns 400 `upstream_rejected_request`. A non-chat model id returns 404 `model_not_found`. The request body is capped at 32 MiB (413 `request_too_large`). Every successful response carries `usage.cost` and `usage.cost_details` (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility.
|
|
121
|
+
* OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** `response_format`, `tools`/`tool_choice`, `logprobs`/`top_logprobs` and `image_url` content parts are sent only to a model whose `/v1/models` entry lists the capability in `supported_parameters` (`vision` for images). A model without it returns 400 `unsupported_parameter` whose message names the models that do support it. When the model supports the parameter but none of its currently routable upstreams does, the request fails with 503 `upstream_unavailable` rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** `reasoning_effort`, `presence_penalty`, `frequency_penalty`, `seed` and `parallel_tool_calls` are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the `x-deeprelay-ignored-params` response header. - **Rejected everywhere.** `logit_bias` and `function_call` return 400 `unsupported_parameter`; `input_audio` and `file` content parts return 400 `unsupported_content_part`. A non-strict `json_schema` sent to a model that can only guarantee JSON is served as `json_object` and reported as `response_format:downgraded`; a strict one is rejected. A `json_schema` over 64 KiB or nested deeper than 32 levels returns 400 `unsupported_parameter` (param `response_format`). An upstream rejection of a request the relay accepted returns 400 `upstream_rejected_request`. A non-chat model id returns 404 `model_not_found`. The request body is capped at 32 MiB (413 `request_too_large`). Every successful response carries `usage.cost` and `usage.cost_details` (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility. **Backup models.** When the API key has `fallback_models`, or the request sends `models` or X-Deeprelay-Fallback-Models, and every provider for the requested model fails before the first token with a temporary error (unavailable, timed out, rate limited upstream, or stalled), deeprelay tries the next backup model. It never switches after the first byte, and never on a client error, a quota or budget refusal, or a content-filter result. A backup is billed at its own price under the same billing mode as the requested model. The body `model` and X-Deeprelay-Served-Model name the model that served; X-Deeprelay-Requested-Model names the one asked for, and X-Deeprelay-Fallback-Reason says why it was passed over. If no model serves, the response is the requested model\'s own error, with X-Deeprelay-Fallback-Attempted.
|
|
119
122
|
* Create a chat completion (OpenAI-compatible)
|
|
120
123
|
*/
|
|
121
124
|
createChatCompletionRaw(requestParameters, initOverrides) {
|
|
@@ -126,7 +129,7 @@ export class InferenceApi extends runtime.BaseAPI {
|
|
|
126
129
|
});
|
|
127
130
|
}
|
|
128
131
|
/**
|
|
129
|
-
* OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** `response_format`, `tools`/`tool_choice`, `logprobs`/`top_logprobs` and `image_url` content parts are sent only to a model whose `/v1/models` entry lists the capability in `supported_parameters` (`vision` for images). A model without it returns 400 `unsupported_parameter` whose message names the models that do support it. When the model supports the parameter but none of its currently routable upstreams does, the request fails with 503 `upstream_unavailable` rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** `reasoning_effort`, `presence_penalty`, `frequency_penalty`, `seed` and `parallel_tool_calls` are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the `x-deeprelay-ignored-params` response header. - **Rejected everywhere.** `logit_bias` and `function_call` return 400 `unsupported_parameter`; `input_audio` and `file` content parts return 400 `unsupported_content_part`. A non-strict `json_schema` sent to a model that can only guarantee JSON is served as `json_object` and reported as `response_format:downgraded`; a strict one is rejected. A `json_schema` over 64 KiB or nested deeper than 32 levels returns 400 `unsupported_parameter` (param `response_format`). An upstream rejection of a request the relay accepted returns 400 `upstream_rejected_request`. A non-chat model id returns 404 `model_not_found`. The request body is capped at 32 MiB (413 `request_too_large`). Every successful response carries `usage.cost` and `usage.cost_details` (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility.
|
|
132
|
+
* OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** `response_format`, `tools`/`tool_choice`, `logprobs`/`top_logprobs` and `image_url` content parts are sent only to a model whose `/v1/models` entry lists the capability in `supported_parameters` (`vision` for images). A model without it returns 400 `unsupported_parameter` whose message names the models that do support it. When the model supports the parameter but none of its currently routable upstreams does, the request fails with 503 `upstream_unavailable` rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** `reasoning_effort`, `presence_penalty`, `frequency_penalty`, `seed` and `parallel_tool_calls` are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the `x-deeprelay-ignored-params` response header. - **Rejected everywhere.** `logit_bias` and `function_call` return 400 `unsupported_parameter`; `input_audio` and `file` content parts return 400 `unsupported_content_part`. A non-strict `json_schema` sent to a model that can only guarantee JSON is served as `json_object` and reported as `response_format:downgraded`; a strict one is rejected. A `json_schema` over 64 KiB or nested deeper than 32 levels returns 400 `unsupported_parameter` (param `response_format`). An upstream rejection of a request the relay accepted returns 400 `upstream_rejected_request`. A non-chat model id returns 404 `model_not_found`. The request body is capped at 32 MiB (413 `request_too_large`). Every successful response carries `usage.cost` and `usage.cost_details` (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility. **Backup models.** When the API key has `fallback_models`, or the request sends `models` or X-Deeprelay-Fallback-Models, and every provider for the requested model fails before the first token with a temporary error (unavailable, timed out, rate limited upstream, or stalled), deeprelay tries the next backup model. It never switches after the first byte, and never on a client error, a quota or budget refusal, or a content-filter result. A backup is billed at its own price under the same billing mode as the requested model. The body `model` and X-Deeprelay-Served-Model name the model that served; X-Deeprelay-Requested-Model names the one asked for, and X-Deeprelay-Fallback-Reason says why it was passed over. If no model serves, the response is the requested model\'s own error, with X-Deeprelay-Fallback-Attempted.
|
|
130
133
|
* Create a chat completion (OpenAI-compatible)
|
|
131
134
|
*/
|
|
132
135
|
createChatCompletion(requestParameters, initOverrides) {
|
|
@@ -21,6 +21,7 @@ export interface ExportRequestsRequest {
|
|
|
21
21
|
clientRequestId?: string;
|
|
22
22
|
from?: Date;
|
|
23
23
|
to?: Date;
|
|
24
|
+
fallback?: boolean;
|
|
24
25
|
}
|
|
25
26
|
export interface GetRequestRequest {
|
|
26
27
|
id: string;
|
|
@@ -34,6 +35,7 @@ export interface ListRequestsRequest {
|
|
|
34
35
|
clientRequestId?: string;
|
|
35
36
|
from?: Date;
|
|
36
37
|
to?: Date;
|
|
38
|
+
fallback?: boolean;
|
|
37
39
|
cursor?: string;
|
|
38
40
|
limit?: number;
|
|
39
41
|
}
|
|
@@ -46,12 +48,12 @@ export declare class RequestsApi extends runtime.BaseAPI {
|
|
|
46
48
|
*/
|
|
47
49
|
exportRequestsRequestOpts(requestParameters: ExportRequestsRequest): Promise<runtime.RequestOpts>;
|
|
48
50
|
/**
|
|
49
|
-
* Streams every request-log row matching the filters as a CSV attachment, oldest columns first: `request_id, client_request_id, occurred_at, surface, model, key_id, key_name, key_prefix, status, http_status, error_code, finish_reason, prompt_tokens, completion_tokens, cached_tokens, reasoning_tokens, quota_units, cost, plan_covered, ttft_ms, duration_ms, ignored_params`. Takes the same filters and visibility rules as `GET /requests`, without the cursor and limit. The export is counted before anything is written. When the filters match more rows than the export cap, the answer is 422 `export_too_large` and the problem body carries `max_rows`; narrow the time range or add a filter, then export again. Requires the `serverless:read` scope. Exports have their own, tighter per-key rate limit.
|
|
51
|
+
* Streams every request-log row matching the filters as a CSV attachment, oldest columns first: `request_id, client_request_id, occurred_at, surface, model, key_id, key_name, key_prefix, status, http_status, error_code, finish_reason, prompt_tokens, completion_tokens, cached_tokens, reasoning_tokens, quota_units, cost, plan_covered, ttft_ms, duration_ms, ignored_params, requested_model, served_model, fallback_reason`. Takes the same filters and visibility rules as `GET /requests`, without the cursor and limit. The export is counted before anything is written. When the filters match more rows than the export cap, the answer is 422 `export_too_large` and the problem body carries `max_rows`; narrow the time range or add a filter, then export again. Requires the `serverless:read` scope. Exports have their own, tighter per-key rate limit.
|
|
50
52
|
* Export the request log as CSV
|
|
51
53
|
*/
|
|
52
54
|
exportRequestsRaw(requestParameters: ExportRequestsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
|
|
53
55
|
/**
|
|
54
|
-
* Streams every request-log row matching the filters as a CSV attachment, oldest columns first: `request_id, client_request_id, occurred_at, surface, model, key_id, key_name, key_prefix, status, http_status, error_code, finish_reason, prompt_tokens, completion_tokens, cached_tokens, reasoning_tokens, quota_units, cost, plan_covered, ttft_ms, duration_ms, ignored_params`. Takes the same filters and visibility rules as `GET /requests`, without the cursor and limit. The export is counted before anything is written. When the filters match more rows than the export cap, the answer is 422 `export_too_large` and the problem body carries `max_rows`; narrow the time range or add a filter, then export again. Requires the `serverless:read` scope. Exports have their own, tighter per-key rate limit.
|
|
56
|
+
* Streams every request-log row matching the filters as a CSV attachment, oldest columns first: `request_id, client_request_id, occurred_at, surface, model, key_id, key_name, key_prefix, status, http_status, error_code, finish_reason, prompt_tokens, completion_tokens, cached_tokens, reasoning_tokens, quota_units, cost, plan_covered, ttft_ms, duration_ms, ignored_params, requested_model, served_model, fallback_reason`. Takes the same filters and visibility rules as `GET /requests`, without the cursor and limit. The export is counted before anything is written. When the filters match more rows than the export cap, the answer is 422 `export_too_large` and the problem body carries `max_rows`; narrow the time range or add a filter, then export again. Requires the `serverless:read` scope. Exports have their own, tighter per-key rate limit.
|
|
55
57
|
* Export the request log as CSV
|
|
56
58
|
*/
|
|
57
59
|
exportRequests(requestParameters?: ExportRequestsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
|
|
@@ -57,6 +57,9 @@ export class RequestsApi extends runtime.BaseAPI {
|
|
|
57
57
|
if (requestParameters['to'] != null) {
|
|
58
58
|
queryParameters['to'] = requestParameters['to'].toISOString();
|
|
59
59
|
}
|
|
60
|
+
if (requestParameters['fallback'] != null) {
|
|
61
|
+
queryParameters['fallback'] = requestParameters['fallback'];
|
|
62
|
+
}
|
|
60
63
|
const headerParameters = {};
|
|
61
64
|
if (this.configuration && this.configuration.accessToken) {
|
|
62
65
|
const token = this.configuration.accessToken;
|
|
@@ -75,7 +78,7 @@ export class RequestsApi extends runtime.BaseAPI {
|
|
|
75
78
|
});
|
|
76
79
|
}
|
|
77
80
|
/**
|
|
78
|
-
* Streams every request-log row matching the filters as a CSV attachment, oldest columns first: `request_id, client_request_id, occurred_at, surface, model, key_id, key_name, key_prefix, status, http_status, error_code, finish_reason, prompt_tokens, completion_tokens, cached_tokens, reasoning_tokens, quota_units, cost, plan_covered, ttft_ms, duration_ms, ignored_params`. Takes the same filters and visibility rules as `GET /requests`, without the cursor and limit. The export is counted before anything is written. When the filters match more rows than the export cap, the answer is 422 `export_too_large` and the problem body carries `max_rows`; narrow the time range or add a filter, then export again. Requires the `serverless:read` scope. Exports have their own, tighter per-key rate limit.
|
|
81
|
+
* Streams every request-log row matching the filters as a CSV attachment, oldest columns first: `request_id, client_request_id, occurred_at, surface, model, key_id, key_name, key_prefix, status, http_status, error_code, finish_reason, prompt_tokens, completion_tokens, cached_tokens, reasoning_tokens, quota_units, cost, plan_covered, ttft_ms, duration_ms, ignored_params, requested_model, served_model, fallback_reason`. Takes the same filters and visibility rules as `GET /requests`, without the cursor and limit. The export is counted before anything is written. When the filters match more rows than the export cap, the answer is 422 `export_too_large` and the problem body carries `max_rows`; narrow the time range or add a filter, then export again. Requires the `serverless:read` scope. Exports have their own, tighter per-key rate limit.
|
|
79
82
|
* Export the request log as CSV
|
|
80
83
|
*/
|
|
81
84
|
exportRequestsRaw(requestParameters, initOverrides) {
|
|
@@ -91,7 +94,7 @@ export class RequestsApi extends runtime.BaseAPI {
|
|
|
91
94
|
});
|
|
92
95
|
}
|
|
93
96
|
/**
|
|
94
|
-
* Streams every request-log row matching the filters as a CSV attachment, oldest columns first: `request_id, client_request_id, occurred_at, surface, model, key_id, key_name, key_prefix, status, http_status, error_code, finish_reason, prompt_tokens, completion_tokens, cached_tokens, reasoning_tokens, quota_units, cost, plan_covered, ttft_ms, duration_ms, ignored_params`. Takes the same filters and visibility rules as `GET /requests`, without the cursor and limit. The export is counted before anything is written. When the filters match more rows than the export cap, the answer is 422 `export_too_large` and the problem body carries `max_rows`; narrow the time range or add a filter, then export again. Requires the `serverless:read` scope. Exports have their own, tighter per-key rate limit.
|
|
97
|
+
* Streams every request-log row matching the filters as a CSV attachment, oldest columns first: `request_id, client_request_id, occurred_at, surface, model, key_id, key_name, key_prefix, status, http_status, error_code, finish_reason, prompt_tokens, completion_tokens, cached_tokens, reasoning_tokens, quota_units, cost, plan_covered, ttft_ms, duration_ms, ignored_params, requested_model, served_model, fallback_reason`. Takes the same filters and visibility rules as `GET /requests`, without the cursor and limit. The export is counted before anything is written. When the filters match more rows than the export cap, the answer is 422 `export_too_large` and the problem body carries `max_rows`; narrow the time range or add a filter, then export again. Requires the `serverless:read` scope. Exports have their own, tighter per-key rate limit.
|
|
95
98
|
* Export the request log as CSV
|
|
96
99
|
*/
|
|
97
100
|
exportRequests() {
|
|
@@ -178,6 +181,9 @@ export class RequestsApi extends runtime.BaseAPI {
|
|
|
178
181
|
if (requestParameters['to'] != null) {
|
|
179
182
|
queryParameters['to'] = requestParameters['to'].toISOString();
|
|
180
183
|
}
|
|
184
|
+
if (requestParameters['fallback'] != null) {
|
|
185
|
+
queryParameters['fallback'] = requestParameters['fallback'];
|
|
186
|
+
}
|
|
181
187
|
if (requestParameters['cursor'] != null) {
|
|
182
188
|
queryParameters['cursor'] = requestParameters['cursor'];
|
|
183
189
|
}
|