@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.
Files changed (105) hide show
  1. package/.openapi-generator/FILES +4 -0
  2. package/README.md +4 -2
  3. package/dist/apis/ApiKeysApi.d.ts +2 -2
  4. package/dist/apis/ApiKeysApi.js +2 -2
  5. package/dist/apis/BillingApi.d.ts +2 -2
  6. package/dist/apis/BillingApi.js +2 -2
  7. package/dist/apis/InferenceApi.d.ts +3 -2
  8. package/dist/apis/InferenceApi.js +5 -2
  9. package/dist/apis/RequestsApi.d.ts +4 -2
  10. package/dist/apis/RequestsApi.js +8 -2
  11. package/dist/esm/apis/ApiKeysApi.d.ts +2 -2
  12. package/dist/esm/apis/ApiKeysApi.js +2 -2
  13. package/dist/esm/apis/BillingApi.d.ts +2 -2
  14. package/dist/esm/apis/BillingApi.js +2 -2
  15. package/dist/esm/apis/InferenceApi.d.ts +3 -2
  16. package/dist/esm/apis/InferenceApi.js +5 -2
  17. package/dist/esm/apis/RequestsApi.d.ts +4 -2
  18. package/dist/esm/apis/RequestsApi.js +8 -2
  19. package/dist/esm/models/ApiKey.d.ts +19 -0
  20. package/dist/esm/models/ApiKey.js +9 -0
  21. package/dist/esm/models/ApiKeyCreate.d.ts +6 -0
  22. package/dist/esm/models/ApiKeyCreate.js +2 -0
  23. package/dist/esm/models/ApiKeyCreated.d.ts +19 -0
  24. package/dist/esm/models/ApiKeyCreated.js +9 -0
  25. package/dist/esm/models/ApiKeyFallbackEntry.d.ts +65 -0
  26. package/dist/esm/models/ApiKeyFallbackEntry.js +67 -0
  27. package/dist/esm/models/ApiKeyUpdate.d.ts +7 -1
  28. package/dist/esm/models/ApiKeyUpdate.js +2 -0
  29. package/dist/esm/models/ChatCompletionRequest.d.ts +6 -0
  30. package/dist/esm/models/ChatCompletionRequest.js +2 -0
  31. package/dist/esm/models/CreateWebhookEndpointRequest.d.ts +1 -0
  32. package/dist/esm/models/CreateWebhookEndpointRequest.js +2 -1
  33. package/dist/esm/models/RefereeStatus.d.ts +33 -4
  34. package/dist/esm/models/RefereeStatus.js +15 -1
  35. package/dist/esm/models/Referral.d.ts +10 -3
  36. package/dist/esm/models/Referral.js +2 -0
  37. package/dist/esm/models/RequestAttempt.d.ts +71 -0
  38. package/dist/esm/models/RequestAttempt.js +67 -0
  39. package/dist/esm/models/RequestLogEntry.d.ts +25 -0
  40. package/dist/esm/models/RequestLogEntry.js +9 -0
  41. package/dist/esm/models/WebhookEndpoint.d.ts +1 -0
  42. package/dist/esm/models/WebhookEndpoint.js +2 -1
  43. package/dist/esm/models/index.d.ts +2 -0
  44. package/dist/esm/models/index.js +2 -0
  45. package/dist/esm/runtime.js +1 -1
  46. package/dist/models/ApiKey.d.ts +19 -0
  47. package/dist/models/ApiKey.js +9 -0
  48. package/dist/models/ApiKeyCreate.d.ts +6 -0
  49. package/dist/models/ApiKeyCreate.js +2 -0
  50. package/dist/models/ApiKeyCreated.d.ts +19 -0
  51. package/dist/models/ApiKeyCreated.js +9 -0
  52. package/dist/models/ApiKeyFallbackEntry.d.ts +65 -0
  53. package/dist/models/ApiKeyFallbackEntry.js +75 -0
  54. package/dist/models/ApiKeyUpdate.d.ts +7 -1
  55. package/dist/models/ApiKeyUpdate.js +2 -0
  56. package/dist/models/ChatCompletionRequest.d.ts +6 -0
  57. package/dist/models/ChatCompletionRequest.js +2 -0
  58. package/dist/models/CreateWebhookEndpointRequest.d.ts +1 -0
  59. package/dist/models/CreateWebhookEndpointRequest.js +2 -1
  60. package/dist/models/RefereeStatus.d.ts +33 -4
  61. package/dist/models/RefereeStatus.js +16 -2
  62. package/dist/models/Referral.d.ts +10 -3
  63. package/dist/models/Referral.js +2 -0
  64. package/dist/models/RequestAttempt.d.ts +71 -0
  65. package/dist/models/RequestAttempt.js +75 -0
  66. package/dist/models/RequestLogEntry.d.ts +25 -0
  67. package/dist/models/RequestLogEntry.js +9 -0
  68. package/dist/models/WebhookEndpoint.d.ts +1 -0
  69. package/dist/models/WebhookEndpoint.js +2 -1
  70. package/dist/models/index.d.ts +2 -0
  71. package/dist/models/index.js +2 -0
  72. package/dist/runtime.js +1 -1
  73. package/docs/ApiKey.md +6 -0
  74. package/docs/ApiKeyCreate.md +2 -0
  75. package/docs/ApiKeyCreated.md +6 -0
  76. package/docs/ApiKeyFallbackEntry.md +43 -0
  77. package/docs/ApiKeyUpdate.md +3 -1
  78. package/docs/ApiKeysApi.md +1 -1
  79. package/docs/BillingApi.md +1 -1
  80. package/docs/ChatCompletionRequest.md +2 -0
  81. package/docs/InferenceApi.md +29 -26
  82. package/docs/RefereeStatus.md +6 -0
  83. package/docs/Referral.md +2 -0
  84. package/docs/RequestAttempt.md +45 -0
  85. package/docs/RequestLogEntry.md +8 -0
  86. package/docs/RequestsApi.md +9 -3
  87. package/package.json +1 -1
  88. package/src/apis/ApiKeysApi.ts +2 -2
  89. package/src/apis/BillingApi.ts +2 -2
  90. package/src/apis/InferenceApi.ts +7 -2
  91. package/src/apis/RequestsApi.ts +12 -2
  92. package/src/models/ApiKey.ts +32 -0
  93. package/src/models/ApiKeyCreate.ts +8 -0
  94. package/src/models/ApiKeyCreated.ts +32 -0
  95. package/src/models/ApiKeyFallbackEntry.ts +114 -0
  96. package/src/models/ApiKeyUpdate.ts +9 -1
  97. package/src/models/ChatCompletionRequest.ts +8 -0
  98. package/src/models/CreateWebhookEndpointRequest.ts +2 -1
  99. package/src/models/RefereeStatus.ts +41 -5
  100. package/src/models/Referral.ts +12 -3
  101. package/src/models/RequestAttempt.ts +121 -0
  102. package/src/models/RequestLogEntry.ts +40 -0
  103. package/src/models/WebhookEndpoint.ts +2 -1
  104. package/src/models/index.ts +2 -0
  105. package/src/runtime.ts +1 -1
@@ -86,19 +86,19 @@ example().catch(console.error);
86
86
  | **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
87
87
  | **403** | API key lacks the required scope (&#x60;insufficient_scope&#x60;), or the key has a model allowlist that does not include the requested model (&#x60;model_not_allowed_for_key&#x60;; also the answer for a model that does not exist, so a restricted key cannot probe the catalog). OpenAI error envelope. | * X-Deeprelay-Error-Code - <br> |
88
88
  | **404** | Model or resource not found (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
89
- | **409** | Invalid request (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
90
- | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
89
+ | **409** | Invalid request (OpenAI error envelope). | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * X-Deeprelay-Error-Code - <br> |
90
+ | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
91
91
 
92
92
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
93
93
 
94
94
 
95
95
  ## createChatCompletion
96
96
 
97
- > ChatCompletionResponse createChatCompletion(chatCompletionRequest, xClientRequestId)
97
+ > ChatCompletionResponse createChatCompletion(chatCompletionRequest, xClientRequestId, xDeeprelayFallbackModels)
98
98
 
99
99
  Create a chat completion (OpenAI-compatible)
100
100
 
101
- OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** &#x60;response_format&#x60;, &#x60;tools&#x60;/&#x60;tool_choice&#x60;, &#x60;logprobs&#x60;/&#x60;top_logprobs&#x60; and &#x60;image_url&#x60; content parts are sent only to a model whose &#x60;/v1/models&#x60; entry lists the capability in &#x60;supported_parameters&#x60; (&#x60;vision&#x60; for images). A model without it returns 400 &#x60;unsupported_parameter&#x60; 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 &#x60;upstream_unavailable&#x60; rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** &#x60;reasoning_effort&#x60;, &#x60;presence_penalty&#x60;, &#x60;frequency_penalty&#x60;, &#x60;seed&#x60; and &#x60;parallel_tool_calls&#x60; are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the &#x60;x-deeprelay-ignored-params&#x60; response header. - **Rejected everywhere.** &#x60;logit_bias&#x60; and &#x60;function_call&#x60; return 400 &#x60;unsupported_parameter&#x60;; &#x60;input_audio&#x60; and &#x60;file&#x60; content parts return 400 &#x60;unsupported_content_part&#x60;. A non-strict &#x60;json_schema&#x60; sent to a model that can only guarantee JSON is served as &#x60;json_object&#x60; and reported as &#x60;response_format:downgraded&#x60;; a strict one is rejected. A &#x60;json_schema&#x60; over 64 KiB or nested deeper than 32 levels returns 400 &#x60;unsupported_parameter&#x60; (param &#x60;response_format&#x60;). An upstream rejection of a request the relay accepted returns 400 &#x60;upstream_rejected_request&#x60;. A non-chat model id returns 404 &#x60;model_not_found&#x60;. The request body is capped at 32 MiB (413 &#x60;request_too_large&#x60;). Every successful response carries &#x60;usage.cost&#x60; and &#x60;usage.cost_details&#x60; (on a stream, only in the final usage chunk). See https://deeprelay.ai/docs/api/inference#openai-compatibility.
101
+ OpenAI-compatible chat completion. Parameters fall into three groups: - **Semantic parameters are gated per model.** &#x60;response_format&#x60;, &#x60;tools&#x60;/&#x60;tool_choice&#x60;, &#x60;logprobs&#x60;/&#x60;top_logprobs&#x60; and &#x60;image_url&#x60; content parts are sent only to a model whose &#x60;/v1/models&#x60; entry lists the capability in &#x60;supported_parameters&#x60; (&#x60;vision&#x60; for images). A model without it returns 400 &#x60;unsupported_parameter&#x60; 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 &#x60;upstream_unavailable&#x60; rather than being silently degraded. - **Hints are forwarded or dropped, never rejected.** &#x60;reasoning_effort&#x60;, &#x60;presence_penalty&#x60;, &#x60;frequency_penalty&#x60;, &#x60;seed&#x60; and &#x60;parallel_tool_calls&#x60; are forwarded to an upstream that accepts them and otherwise dropped. Every drop is reported in the &#x60;x-deeprelay-ignored-params&#x60; response header. - **Rejected everywhere.** &#x60;logit_bias&#x60; and &#x60;function_call&#x60; return 400 &#x60;unsupported_parameter&#x60;; &#x60;input_audio&#x60; and &#x60;file&#x60; content parts return 400 &#x60;unsupported_content_part&#x60;. A non-strict &#x60;json_schema&#x60; sent to a model that can only guarantee JSON is served as &#x60;json_object&#x60; and reported as &#x60;response_format:downgraded&#x60;; a strict one is rejected. A &#x60;json_schema&#x60; over 64 KiB or nested deeper than 32 levels returns 400 &#x60;unsupported_parameter&#x60; (param &#x60;response_format&#x60;). An upstream rejection of a request the relay accepted returns 400 &#x60;upstream_rejected_request&#x60;. A non-chat model id returns 404 &#x60;model_not_found&#x60;. The request body is capped at 32 MiB (413 &#x60;request_too_large&#x60;). Every successful response carries &#x60;usage.cost&#x60; and &#x60;usage.cost_details&#x60; (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 &#x60;fallback_models&#x60;, or the request sends &#x60;models&#x60; 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 &#x60;model&#x60; 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\&#39;s own error, with X-Deeprelay-Fallback-Attempted.
102
102
 
103
103
  ### Example
104
104
 
@@ -122,6 +122,8 @@ async function example() {
122
122
  chatCompletionRequest: ...,
123
123
  // string | Your own correlation id for this call, up to 128 characters. It is stored on the request-log row as `client_request_id` and can be filtered on with `GET /requests?client_request_id=`. When it is absent, an inbound `X-Request-Id` is kept in its place; the response\'s own `X-Request-Id` is always minted by deeprelay. Surrounding whitespace and control characters are removed; a longer value is dropped, never truncated. It is never used as a lookup key, so it does not need to be unique. (optional)
124
124
  xClientRequestId: xClientRequestId_example,
125
+ // string | Backup models for this request only, in priority order: a comma-separated list of up to 3 model ids, for example `deeprelay/glm-5.3,deeprelay/kimi-k3`. It replaces the API key\'s `fallback_models` for this request; the two lists are never merged. `none` (or an empty value) turns model fallback off for this request. If every provider for the requested model fails before the first token with a temporary error, deeprelay tries the next listed model. Each backup must still pass the key\'s model allowlist, the request\'s billing mode and the request\'s capability needs; one that does not is skipped, so this header can never widen what the key may call. More than 3 models, a malformed id, `none` mixed with ids, or this header together with a `models` body field is a 400 `invalid_request`. Not accepted by Liquid, which always serves exactly the requested model. (optional)
126
+ xDeeprelayFallbackModels: deeprelay/glm-5.3,deeprelay/kimi-k3,
125
127
  } satisfies CreateChatCompletionRequest;
126
128
 
127
129
  try {
@@ -143,6 +145,7 @@ example().catch(console.error);
143
145
  |------------- | ------------- | ------------- | -------------|
144
146
  | **chatCompletionRequest** | [ChatCompletionRequest](ChatCompletionRequest.md) | | |
145
147
  | **xClientRequestId** | `string` | Your own correlation id for this call, up to 128 characters. It is stored on the request-log row as &#x60;client_request_id&#x60; and can be filtered on with &#x60;GET /requests?client_request_id&#x3D;&#x60;. When it is absent, an inbound &#x60;X-Request-Id&#x60; is kept in its place; the response\&#39;s own &#x60;X-Request-Id&#x60; is always minted by deeprelay. Surrounding whitespace and control characters are removed; a longer value is dropped, never truncated. It is never used as a lookup key, so it does not need to be unique. | [Optional] [Defaults to `undefined`] |
148
+ | **xDeeprelayFallbackModels** | `string` | Backup models for this request only, in priority order: a comma-separated list of up to 3 model ids, for example &#x60;deeprelay/glm-5.3,deeprelay/kimi-k3&#x60;. It replaces the API key\&#39;s &#x60;fallback_models&#x60; for this request; the two lists are never merged. &#x60;none&#x60; (or an empty value) turns model fallback off for this request. If every provider for the requested model fails before the first token with a temporary error, deeprelay tries the next listed model. Each backup must still pass the key\&#39;s model allowlist, the request\&#39;s billing mode and the request\&#39;s capability needs; one that does not is skipped, so this header can never widen what the key may call. More than 3 models, a malformed id, &#x60;none&#x60; mixed with ids, or this header together with a &#x60;models&#x60; body field is a 400 &#x60;invalid_request&#x60;. Not accepted by Liquid, which always serves exactly the requested model. | [Optional] [Defaults to `undefined`] |
146
149
 
147
150
  ### Return type
148
151
 
@@ -161,17 +164,17 @@ example().catch(console.error);
161
164
  ### HTTP response details
162
165
  | Status code | Description | Response headers |
163
166
  |-------------|-------------|------------------|
164
- | **200** | Successful response. application/json for non-streaming requests; text/event-stream for streaming requests (stream&#x3D;true). | * x-deeprelay-ignored-params - <br> * x-deeprelay-cost - <br> * x-deeprelay-quota-input-remaining - <br> * x-deeprelay-quota-output-remaining - <br> * x-deeprelay-quota-reset - <br> * x-deeprelay-quota-weekly-input-remaining - <br> * x-deeprelay-quota-weekly-input-limit - <br> * x-deeprelay-quota-weekly-output-remaining - <br> * x-deeprelay-quota-weekly-output-limit - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> |
165
- | **400** | Invalid request (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
167
+ | **200** | Successful response. application/json for non-streaming requests; text/event-stream for streaming requests (stream&#x3D;true). | * X-Deeprelay-Served-Model - <br> * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Reason - <br> * x-deeprelay-ignored-params - <br> * x-deeprelay-cost - <br> * x-deeprelay-quota-input-remaining - <br> * x-deeprelay-quota-output-remaining - <br> * x-deeprelay-quota-reset - <br> * x-deeprelay-quota-weekly-input-remaining - <br> * x-deeprelay-quota-weekly-input-limit - <br> * x-deeprelay-quota-weekly-output-remaining - <br> * x-deeprelay-quota-weekly-output-limit - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> |
168
+ | **400** | Invalid request (OpenAI error envelope). | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * X-Deeprelay-Error-Code - <br> |
166
169
  | **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
167
170
  | **402** | Insufficient balance or a spend limit reached (OpenAI error envelope, SERV-06): &#x60;insufficient_balance&#x60;, &#x60;daily_limit_reached&#x60;, &#x60;spending_limit_reached&#x60;, &#x60;api_key_budget_exceeded&#x60; (this API key\&#39;s monthly budget) or &#x60;member_spend_limit_reached&#x60; (the member\&#39;s monthly spend limit). Carries &#x60;x-should-retry: false&#x60;: the same request will not succeed until the wallet or the limit changes. | * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
168
171
  | **403** | API key lacks the required scope (&#x60;insufficient_scope&#x60;), or the key has a model allowlist that does not include the requested model (&#x60;model_not_allowed_for_key&#x60;; also the answer for a model that does not exist, so a restricted key cannot probe the catalog). OpenAI error envelope. | * X-Deeprelay-Error-Code - <br> |
169
172
  | **404** | Model or resource not found (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
170
173
  | **413** | Request body too large (OpenAI error envelope, code request_too_large). | * X-Deeprelay-Error-Code - <br> |
171
174
  | **422** | Request validation failed (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
172
- | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
175
+ | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
173
176
  | **500** | Internal server error (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
174
- | **503** | No upstream could serve the request (OpenAI error envelope, &#x60;upstream_unavailable&#x60;): every capable upstream is down, shedding load, or none of the model\&#39;s routable upstreams supports a capability the request needs. Always carries Retry-After (whole seconds, rounded up) and retry-after-ms; on an overload the wait is jittered between 2 and 2.5 seconds. | * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * X-Deeprelay-Error-Code - <br> |
177
+ | **503** | No upstream could serve the request (OpenAI error envelope, &#x60;upstream_unavailable&#x60;): every capable upstream is down, shedding load, or none of the model\&#39;s routable upstreams supports a capability the request needs. Always carries Retry-After (whole seconds, rounded up) and retry-after-ms; on an overload the wait is jittered between 2 and 2.5 seconds. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * X-Deeprelay-Error-Code - <br> |
175
178
 
176
179
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
177
180
 
@@ -246,17 +249,17 @@ example().catch(console.error);
246
249
  | Status code | Description | Response headers |
247
250
  |-------------|-------------|------------------|
248
251
  | **200** | One embedding vector per input, in request order. | - |
249
- | **400** | Invalid request (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
252
+ | **400** | Invalid request (OpenAI error envelope). | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * X-Deeprelay-Error-Code - <br> |
250
253
  | **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
251
254
  | **402** | Insufficient balance or a spend limit reached (OpenAI error envelope, SERV-06): &#x60;insufficient_balance&#x60;, &#x60;daily_limit_reached&#x60;, &#x60;spending_limit_reached&#x60;, &#x60;api_key_budget_exceeded&#x60; (this API key\&#39;s monthly budget) or &#x60;member_spend_limit_reached&#x60; (the member\&#39;s monthly spend limit). Carries &#x60;x-should-retry: false&#x60;: the same request will not succeed until the wallet or the limit changes. | * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
252
255
  | **403** | API key lacks the required scope (&#x60;insufficient_scope&#x60;), or the key has a model allowlist that does not include the requested model (&#x60;model_not_allowed_for_key&#x60;; also the answer for a model that does not exist, so a restricted key cannot probe the catalog). OpenAI error envelope. | * X-Deeprelay-Error-Code - <br> |
253
256
  | **404** | Model or resource not found (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
254
257
  | **413** | Request body too large (OpenAI error envelope, code request_too_large). | * X-Deeprelay-Error-Code - <br> |
255
- | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
258
+ | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
256
259
  | **500** | Internal server error (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
257
- | **502** | The upstream answered but its response could not be used (OpenAI error envelope): code upstream_response_too_large when the vector payload exceeded the per-request size limit, or upstream_error for a malformed / misaligned response. Not retryable as-is for upstream_response_too_large — send fewer inputs. | * X-Deeprelay-Error-Code - <br> |
258
- | **503** | No upstream could serve the request (OpenAI error envelope, &#x60;upstream_unavailable&#x60;): every capable upstream is down, shedding load, or none of the model\&#39;s routable upstreams supports a capability the request needs. Always carries Retry-After (whole seconds, rounded up) and retry-after-ms; on an overload the wait is jittered between 2 and 2.5 seconds. | * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * X-Deeprelay-Error-Code - <br> |
259
- | **504** | Upstream provider exceeded the synchronous per-attempt deadline (OpenAI error envelope). 504 semantic — distinct from 503 OpenAIUpstreamUnavailable which signals a connection or routing failure rather than a timeout. | * X-Deeprelay-Error-Code - <br> |
260
+ | **502** | The upstream answered but its response could not be used (OpenAI error envelope): code upstream_response_too_large when the vector payload exceeded the per-request size limit, or upstream_error for a malformed / misaligned response. Not retryable as-is for upstream_response_too_large — send fewer inputs. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * X-Deeprelay-Error-Code - <br> |
261
+ | **503** | No upstream could serve the request (OpenAI error envelope, &#x60;upstream_unavailable&#x60;): every capable upstream is down, shedding load, or none of the model\&#39;s routable upstreams supports a capability the request needs. Always carries Retry-After (whole seconds, rounded up) and retry-after-ms; on an overload the wait is jittered between 2 and 2.5 seconds. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * X-Deeprelay-Error-Code - <br> |
262
+ | **504** | Upstream provider exceeded the synchronous per-attempt deadline (OpenAI error envelope). 504 semantic — distinct from 503 OpenAIUpstreamUnavailable which signals a connection or routing failure rather than a timeout. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * X-Deeprelay-Error-Code - <br> |
260
263
 
261
264
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
262
265
 
@@ -334,16 +337,16 @@ example().catch(console.error);
334
337
  | Status code | Description | Response headers |
335
338
  |-------------|-------------|------------------|
336
339
  | **200** | OpenAI-shaped image generation response (b64_json only). | - |
337
- | **400** | Invalid request (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
340
+ | **400** | Invalid request (OpenAI error envelope). | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * X-Deeprelay-Error-Code - <br> |
338
341
  | **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
339
342
  | **402** | Insufficient balance or a spend limit reached (OpenAI error envelope, SERV-06): &#x60;insufficient_balance&#x60;, &#x60;daily_limit_reached&#x60;, &#x60;spending_limit_reached&#x60;, &#x60;api_key_budget_exceeded&#x60; (this API key\&#39;s monthly budget) or &#x60;member_spend_limit_reached&#x60; (the member\&#39;s monthly spend limit). Carries &#x60;x-should-retry: false&#x60;: the same request will not succeed until the wallet or the limit changes. | * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
340
343
  | **403** | API key lacks the required scope (&#x60;insufficient_scope&#x60;), or the key has a model allowlist that does not include the requested model (&#x60;model_not_allowed_for_key&#x60;; also the answer for a model that does not exist, so a restricted key cannot probe the catalog). OpenAI error envelope. | * X-Deeprelay-Error-Code - <br> |
341
344
  | **404** | Model or resource not found (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
342
345
  | **422** | Request validation failed (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
343
- | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
346
+ | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
344
347
  | **500** | Internal server error (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
345
- | **503** | No upstream could serve the request (OpenAI error envelope, &#x60;upstream_unavailable&#x60;): every capable upstream is down, shedding load, or none of the model\&#39;s routable upstreams supports a capability the request needs. Always carries Retry-After (whole seconds, rounded up) and retry-after-ms; on an overload the wait is jittered between 2 and 2.5 seconds. | * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * X-Deeprelay-Error-Code - <br> |
346
- | **504** | Upstream provider exceeded the synchronous per-attempt deadline (OpenAI error envelope). 504 semantic — distinct from 503 OpenAIUpstreamUnavailable which signals a connection or routing failure rather than a timeout. | * X-Deeprelay-Error-Code - <br> |
348
+ | **503** | No upstream could serve the request (OpenAI error envelope, &#x60;upstream_unavailable&#x60;): every capable upstream is down, shedding load, or none of the model\&#39;s routable upstreams supports a capability the request needs. Always carries Retry-After (whole seconds, rounded up) and retry-after-ms; on an overload the wait is jittered between 2 and 2.5 seconds. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * X-Deeprelay-Error-Code - <br> |
349
+ | **504** | Upstream provider exceeded the synchronous per-attempt deadline (OpenAI error envelope). 504 semantic — distinct from 503 OpenAIUpstreamUnavailable which signals a connection or routing failure rather than a timeout. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * X-Deeprelay-Error-Code - <br> |
347
350
 
348
351
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
349
352
 
@@ -421,12 +424,12 @@ example().catch(console.error);
421
424
  | Status code | Description | Response headers |
422
425
  |-------------|-------------|------------------|
423
426
  | **200** | A video generation job object. | - |
424
- | **400** | Invalid request (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
427
+ | **400** | Invalid request (OpenAI error envelope). | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * X-Deeprelay-Error-Code - <br> |
425
428
  | **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
426
429
  | **402** | Insufficient balance or a spend limit reached (OpenAI error envelope, SERV-06): &#x60;insufficient_balance&#x60;, &#x60;daily_limit_reached&#x60;, &#x60;spending_limit_reached&#x60;, &#x60;api_key_budget_exceeded&#x60; (this API key\&#39;s monthly budget) or &#x60;member_spend_limit_reached&#x60; (the member\&#39;s monthly spend limit). Carries &#x60;x-should-retry: false&#x60;: the same request will not succeed until the wallet or the limit changes. | * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
427
430
  | **403** | API key lacks the required scope (&#x60;insufficient_scope&#x60;), or the key has a model allowlist that does not include the requested model (&#x60;model_not_allowed_for_key&#x60;; also the answer for a model that does not exist, so a restricted key cannot probe the catalog). OpenAI error envelope. | * X-Deeprelay-Error-Code - <br> |
428
431
  | **404** | Model or resource not found (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
429
- | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
432
+ | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
430
433
  | **500** | Internal server error (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
431
434
 
432
435
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -502,7 +505,7 @@ example().catch(console.error);
502
505
  | **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
503
506
  | **403** | API key lacks the required scope (&#x60;insufficient_scope&#x60;), or the key has a model allowlist that does not include the requested model (&#x60;model_not_allowed_for_key&#x60;; also the answer for a model that does not exist, so a restricted key cannot probe the catalog). OpenAI error envelope. | * X-Deeprelay-Error-Code - <br> |
504
507
  | **404** | Model or resource not found (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
505
- | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
508
+ | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
506
509
 
507
510
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
508
511
 
@@ -575,7 +578,7 @@ example().catch(console.error);
575
578
  | **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
576
579
  | **403** | API key lacks the required scope (&#x60;insufficient_scope&#x60;), or the key has a model allowlist that does not include the requested model (&#x60;model_not_allowed_for_key&#x60;; also the answer for a model that does not exist, so a restricted key cannot probe the catalog). OpenAI error envelope. | * X-Deeprelay-Error-Code - <br> |
577
580
  | **404** | Model or resource not found (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
578
- | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
581
+ | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
579
582
 
580
583
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
581
584
 
@@ -651,7 +654,7 @@ example().catch(console.error);
651
654
  | **403** | API key lacks the required scope (&#x60;insufficient_scope&#x60;), or the key has a model allowlist that does not include the requested model (&#x60;model_not_allowed_for_key&#x60;; also the answer for a model that does not exist, so a restricted key cannot probe the catalog). OpenAI error envelope. | * X-Deeprelay-Error-Code - <br> |
652
655
  | **404** | Model or resource not found (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
653
656
  | **410** | The requested artifact has expired and is no longer available (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
654
- | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
657
+ | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
655
658
 
656
659
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
657
660
 
@@ -724,7 +727,7 @@ example().catch(console.error);
724
727
  |-------------|-------------|------------------|
725
728
  | **200** | OK | - |
726
729
  | **404** | Model or resource not found (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
727
- | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
730
+ | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
728
731
 
729
732
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
730
733
 
@@ -800,10 +803,10 @@ example().catch(console.error);
800
803
  |-------------|-------------|------------------|
801
804
  | **200** | OpenAI-shaped model list. | * Cache-Control - &#x60;public, max-age&#x3D;60&#x60; without a key; &#x60;private&#x60; with one. <br> * ETag - Strong validator for the anonymous listing. <br> |
802
805
  | **304** | Not modified; the If-None-Match ETag still matches. | - |
803
- | **400** | Invalid request (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
806
+ | **400** | Invalid request (OpenAI error envelope). | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * X-Deeprelay-Error-Code - <br> |
804
807
  | **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
805
808
  | **403** | API key lacks the required scope (&#x60;insufficient_scope&#x60;), or the key has a model allowlist that does not include the requested model (&#x60;model_not_allowed_for_key&#x60;; also the answer for a model that does not exist, so a restricted key cannot probe the catalog). OpenAI error envelope. | * X-Deeprelay-Error-Code - <br> |
806
- | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
809
+ | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
807
810
 
808
811
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
809
812
 
@@ -878,7 +881,7 @@ example().catch(console.error);
878
881
  | **200** | A page of video generation jobs. | - |
879
882
  | **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
880
883
  | **403** | API key lacks the required scope (&#x60;insufficient_scope&#x60;), or the key has a model allowlist that does not include the requested model (&#x60;model_not_allowed_for_key&#x60;; also the answer for a model that does not exist, so a restricted key cannot probe the catalog). OpenAI error envelope. | * X-Deeprelay-Error-Code - <br> |
881
- | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
884
+ | **429** | Rate limit or subscription quota exceeded (OpenAI error envelope). A per-key or per-IP rate limit (&#x60;rate_limit_exceeded&#x60;) carries Retry-After, the whole seconds to wait, rounded up (minimum 1), and retry-after-ms, the exact wait; both are the time until one request is allowed, not a full refill. A per-key denial also carries the x-ratelimit-*-requests headers. A subscription quota denial (&#x60;subscription_quota_exhausted&#x60;, raised only when the wallet cannot cover the pay-as-you-go fallback) carries &#x60;x-should-retry: false&#x60; and no Retry-After. When the tripped gate is a rolling 7-day cap (&#x60;param: weekly_input_tokens&#x60; or &#x60;param: weekly_output_tokens&#x60;), the error object also carries &#x60;quota_frees_at&#x60;, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. &#x60;param&#x60; names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\&#39;s estimated input alone exceeds what is left in the tighter of the monthly and rolling 7-day input allowances), or output_overshoot (the same for the estimated output — the completion bound). On an overshoot the quota is not exhausted — send a smaller request (or a smaller max_tokens) or add credits. | * X-Deeprelay-Requested-Model - <br> * X-Deeprelay-Fallback-Attempted - <br> * Retry-After - Seconds the client should wait before retrying. <br> * retry-after-ms - <br> * x-ratelimit-limit-requests - <br> * x-ratelimit-remaining-requests - <br> * x-ratelimit-reset-requests - <br> * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
882
885
 
883
886
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
884
887
 
@@ -8,6 +8,9 @@ Present only when the organization signed up through someone else\'s invite link
8
8
  Name | Type
9
9
  ------------ | -------------
10
10
  `status` | string
11
+ `gate` | string
12
+ `progressCents` | number
13
+ `goalCents` | number
11
14
  `spentCents` | number
12
15
  `qualifySpendCents` | number
13
16
  `rewardCents` | number
@@ -23,6 +26,9 @@ import type { RefereeStatus } from '@deeprelay/sdk'
23
26
  // TODO: Update the object below with actual values
24
27
  const example = {
25
28
  "status": null,
29
+ "gate": null,
30
+ "progressCents": null,
31
+ "goalCents": null,
26
32
  "spentCents": null,
27
33
  "qualifySpendCents": null,
28
34
  "rewardCents": null,
package/docs/Referral.md CHANGED
@@ -16,6 +16,7 @@ Name | Type
16
16
  `commissionEarnedCents` | number
17
17
  `rewardCents` | number
18
18
  `refereeRewardCents` | number
19
+ `qualifyDepositCents` | number
19
20
  `qualifySpendCents` | number
20
21
  `holdDays` | number
21
22
  `commissionPct` | number
@@ -37,6 +38,7 @@ const example = {
37
38
  "commissionEarnedCents": null,
38
39
  "rewardCents": null,
39
40
  "refereeRewardCents": null,
41
+ "qualifyDepositCents": null,
40
42
  "qualifySpendCents": null,
41
43
  "holdDays": null,
42
44
  "commissionPct": null,
@@ -0,0 +1,45 @@
1
+
2
+ # RequestAttempt
3
+
4
+ One model in a request\'s backup-model trail.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `model` | string
11
+ `outcome` | string
12
+ `reason` | string
13
+ `durationMs` | number
14
+ `ttftMs` | number
15
+ `tries` | number
16
+
17
+ ## Example
18
+
19
+ ```typescript
20
+ import type { RequestAttempt } from '@deeprelay/sdk'
21
+
22
+ // TODO: Update the object below with actual values
23
+ const example = {
24
+ "model": null,
25
+ "outcome": null,
26
+ "reason": null,
27
+ "durationMs": null,
28
+ "ttftMs": null,
29
+ "tries": null,
30
+ } satisfies RequestAttempt
31
+
32
+ console.log(example)
33
+
34
+ // Convert the instance to a JSON string
35
+ const exampleJSON: string = JSON.stringify(example)
36
+ console.log(exampleJSON)
37
+
38
+ // Parse the JSON string back to an object
39
+ const exampleParsed = JSON.parse(exampleJSON) as RequestAttempt
40
+ console.log(exampleParsed)
41
+ ```
42
+
43
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
44
+
45
+
@@ -34,6 +34,10 @@ Name | Type
34
34
  `imageCount` | number
35
35
  `videoSeconds` | number
36
36
  `suppressedCount` | number
37
+ `requestedModel` | string
38
+ `servedModel` | string
39
+ `fallbackReason` | string
40
+ `attempts` | [Array&lt;RequestAttempt&gt;](RequestAttempt.md)
37
41
 
38
42
  ## Example
39
43
 
@@ -69,6 +73,10 @@ const example = {
69
73
  "imageCount": null,
70
74
  "videoSeconds": null,
71
75
  "suppressedCount": null,
76
+ "requestedModel": null,
77
+ "servedModel": null,
78
+ "fallbackReason": null,
79
+ "attempts": null,
72
80
  } satisfies RequestLogEntry
73
81
 
74
82
  console.log(example)
@@ -12,11 +12,11 @@ All URIs are relative to *https://api.deeprelay.ai/v1*
12
12
 
13
13
  ## exportRequests
14
14
 
15
- > string exportRequests(key, model, surface, status, errorCode, clientRequestId, from, to)
15
+ > string exportRequests(key, model, surface, status, errorCode, clientRequestId, from, to, fallback)
16
16
 
17
17
  Export the request log as CSV
18
18
 
19
- Streams every request-log row matching the filters as a CSV attachment, oldest columns first: &#x60;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&#x60;. Takes the same filters and visibility rules as &#x60;GET /requests&#x60;, 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 &#x60;export_too_large&#x60; and the problem body carries &#x60;max_rows&#x60;; narrow the time range or add a filter, then export again. Requires the &#x60;serverless:read&#x60; scope. Exports have their own, tighter per-key rate limit.
19
+ Streams every request-log row matching the filters as a CSV attachment, oldest columns first: &#x60;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&#x60;. Takes the same filters and visibility rules as &#x60;GET /requests&#x60;, 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 &#x60;export_too_large&#x60; and the problem body carries &#x60;max_rows&#x60;; narrow the time range or add a filter, then export again. Requires the &#x60;serverless:read&#x60; scope. Exports have their own, tighter per-key rate limit.
20
20
 
21
21
  ### Example
22
22
 
@@ -52,6 +52,8 @@ async function example() {
52
52
  from: 2013-10-20T19:20:30+01:00,
53
53
  // Date | Exclusive RFC 3339 range end. Defaults to now; must be after `from`. (optional)
54
54
  to: 2013-10-20T19:20:30+01:00,
55
+ // boolean | `true` returns only rows a backup model served or where backups were tried (`fallback_reason` is set); `false` or absent applies no filter. Any other value is a 400. (optional)
56
+ fallback: true,
55
57
  } satisfies ExportRequestsRequest;
56
58
 
57
59
  try {
@@ -79,6 +81,7 @@ example().catch(console.error);
79
81
  | **clientRequestId** | `string` | Only rows whose &#x60;X-Client-Request-Id&#x60; equals this value. | [Optional] [Defaults to `undefined`] |
80
82
  | **from** | `Date` | Inclusive RFC 3339 range start. Defaults to the start of the 90-day window; an older value is clamped to it. | [Optional] [Defaults to `undefined`] |
81
83
  | **to** | `Date` | Exclusive RFC 3339 range end. Defaults to now; must be after &#x60;from&#x60;. | [Optional] [Defaults to `undefined`] |
84
+ | **fallback** | `boolean` | &#x60;true&#x60; returns only rows a backup model served or where backups were tried (&#x60;fallback_reason&#x60; is set); &#x60;false&#x60; or absent applies no filter. Any other value is a 400. | [Optional] [Defaults to `undefined`] |
82
85
 
83
86
  ### Return type
84
87
 
@@ -182,7 +185,7 @@ example().catch(console.error);
182
185
 
183
186
  ## listRequests
184
187
 
185
- > RequestLogPage listRequests(key, model, surface, status, errorCode, clientRequestId, from, to, cursor, limit)
188
+ > RequestLogPage listRequests(key, model, surface, status, errorCode, clientRequestId, from, to, fallback, cursor, limit)
186
189
 
187
190
  List requests (the request log)
188
191
 
@@ -222,6 +225,8 @@ async function example() {
222
225
  from: 2013-10-20T19:20:30+01:00,
223
226
  // Date | Exclusive RFC 3339 range end. Defaults to now; must be after `from`. (optional)
224
227
  to: 2013-10-20T19:20:30+01:00,
228
+ // boolean | `true` returns only rows a backup model served or where backups were tried (`fallback_reason` is set); `false` or absent applies no filter. Any other value is a 400. (optional)
229
+ fallback: true,
225
230
  // string (optional)
226
231
  cursor: cursor_example,
227
232
  // number | Page size. Defaults to 50; values above 100 are clamped to 100. (optional)
@@ -253,6 +258,7 @@ example().catch(console.error);
253
258
  | **clientRequestId** | `string` | Only rows whose &#x60;X-Client-Request-Id&#x60; equals this value. | [Optional] [Defaults to `undefined`] |
254
259
  | **from** | `Date` | Inclusive RFC 3339 range start. Defaults to the start of the 90-day window; an older value is clamped to it. | [Optional] [Defaults to `undefined`] |
255
260
  | **to** | `Date` | Exclusive RFC 3339 range end. Defaults to now; must be after &#x60;from&#x60;. | [Optional] [Defaults to `undefined`] |
261
+ | **fallback** | `boolean` | &#x60;true&#x60; returns only rows a backup model served or where backups were tried (&#x60;fallback_reason&#x60; is set); &#x60;false&#x60; or absent applies no filter. Any other value is a 400. | [Optional] [Defaults to `undefined`] |
256
262
  | **cursor** | `string` | | [Optional] [Defaults to `undefined`] |
257
263
  | **limit** | `number` | Page size. Defaults to 50; values above 100 are clamped to 100. | [Optional] [Defaults to `50`] |
258
264
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deeprelay/sdk",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "TypeScript SDK for the deeprelay Public Developer API",
5
5
  "author": "deeprelay Support <support@deeprelay.ai>",
6
6
  "repository": {
@@ -335,7 +335,7 @@ export class ApiKeysApi extends runtime.BaseAPI {
335
335
  }
336
336
 
337
337
  /**
338
- * 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.
338
+ * 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.
339
339
  * Update an API key\'s name or limits
340
340
  */
341
341
  async updateApiKeyRaw(requestParameters: UpdateApiKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiKey>> {
@@ -346,7 +346,7 @@ export class ApiKeysApi extends runtime.BaseAPI {
346
346
  }
347
347
 
348
348
  /**
349
- * 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.
349
+ * 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.
350
350
  * Update an API key\'s name or limits
351
351
  */
352
352
  async updateApiKey(requestParameters: UpdateApiKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiKey> {
@@ -446,7 +446,7 @@ export class BillingApi extends runtime.BaseAPI {
446
446
  }
447
447
 
448
448
  /**
449
- * 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; when a friend signs up through it and spends `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The referrer also earns `commission_pct` percent of every real deposit the friend makes, credited as spend-only promotional credit when the deposit clears (`commission_earned_cents`). 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.
449
+ * 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.
450
450
  * Get the org referral code, invite link, terms and stats
451
451
  */
452
452
  async getReferralRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Referral>> {
@@ -457,7 +457,7 @@ export class BillingApi extends runtime.BaseAPI {
457
457
  }
458
458
 
459
459
  /**
460
- * 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; when a friend signs up through it and spends `qualify_spend_cents` on inference, the referrer receives `reward_cents` and the friend receives `referee_reward_cents`, both as non-withdrawable credit, after a `hold_days` chargeback hold. The referrer also earns `commission_pct` percent of every real deposit the friend makes, credited as spend-only promotional credit when the deposit clears (`commission_earned_cents`). 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.
460
+ * 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.
461
461
  * Get the org referral code, invite link, terms and stats
462
462
  */
463
463
  async getReferral(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Referral> {
@@ -86,6 +86,7 @@ export interface CancelVideoRequest {
86
86
  export interface CreateChatCompletionRequest {
87
87
  chatCompletionRequest: ChatCompletionRequest;
88
88
  xClientRequestId?: string;
89
+ xDeeprelayFallbackModels?: string;
89
90
  }
90
91
 
91
92
  export interface CreateEmbeddingsRequest {
@@ -210,6 +211,10 @@ export class InferenceApi extends runtime.BaseAPI {
210
211
  headerParameters['X-Client-Request-Id'] = String(requestParameters['xClientRequestId']);
211
212
  }
212
213
 
214
+ if (requestParameters['xDeeprelayFallbackModels'] != null) {
215
+ headerParameters['X-Deeprelay-Fallback-Models'] = String(requestParameters['xDeeprelayFallbackModels']);
216
+ }
217
+
213
218
  if (this.configuration && this.configuration.accessToken) {
214
219
  const token = this.configuration.accessToken;
215
220
  const tokenString = await token("bearerAuth", []);
@@ -231,7 +236,7 @@ export class InferenceApi extends runtime.BaseAPI {
231
236
  }
232
237
 
233
238
  /**
234
- * 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.
239
+ * 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.
235
240
  * Create a chat completion (OpenAI-compatible)
236
241
  */
237
242
  async createChatCompletionRaw(requestParameters: CreateChatCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChatCompletionResponse>> {
@@ -242,7 +247,7 @@ export class InferenceApi extends runtime.BaseAPI {
242
247
  }
243
248
 
244
249
  /**
245
- * 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.
250
+ * 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.
246
251
  * Create a chat completion (OpenAI-compatible)
247
252
  */
248
253
  async createChatCompletion(requestParameters: CreateChatCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChatCompletionResponse> {