@deeprelay/sdk 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +66 -0
- package/README.md +47 -11
- package/dist/apis/AlertsApi.d.ts +50 -0
- package/dist/apis/AlertsApi.js +127 -0
- package/dist/apis/ApiKeysApi.d.ts +107 -0
- package/dist/apis/ApiKeysApi.js +284 -0
- package/dist/apis/BillingApi.d.ts +25 -7
- package/dist/apis/BillingApi.js +57 -7
- package/dist/apis/InferenceApi.d.ts +12 -1
- package/dist/apis/InferenceApi.js +22 -1
- package/dist/apis/MetaApi.d.ts +1 -1
- package/dist/apis/MetaApi.js +1 -1
- package/dist/apis/RequestsApi.d.ts +130 -0
- package/dist/apis/RequestsApi.js +269 -0
- package/dist/apis/UsageApi.d.ts +15 -1
- package/dist/apis/UsageApi.js +19 -2
- package/dist/apis/WebhooksApi.d.ts +1 -1
- package/dist/apis/WebhooksApi.js +1 -1
- package/dist/apis/index.d.ts +3 -0
- package/dist/apis/index.js +3 -0
- package/dist/esm/apis/AlertsApi.d.ts +50 -0
- package/dist/esm/apis/AlertsApi.js +123 -0
- package/dist/esm/apis/ApiKeysApi.d.ts +107 -0
- package/dist/esm/apis/ApiKeysApi.js +280 -0
- package/dist/esm/apis/BillingApi.d.ts +25 -7
- package/dist/esm/apis/BillingApi.js +57 -7
- package/dist/esm/apis/InferenceApi.d.ts +12 -1
- package/dist/esm/apis/InferenceApi.js +22 -1
- package/dist/esm/apis/MetaApi.d.ts +1 -1
- package/dist/esm/apis/MetaApi.js +1 -1
- package/dist/esm/apis/RequestsApi.d.ts +130 -0
- package/dist/esm/apis/RequestsApi.js +265 -0
- package/dist/esm/apis/UsageApi.d.ts +15 -1
- package/dist/esm/apis/UsageApi.js +18 -1
- package/dist/esm/apis/WebhooksApi.d.ts +1 -1
- package/dist/esm/apis/WebhooksApi.js +1 -1
- package/dist/esm/apis/index.d.ts +3 -0
- package/dist/esm/apis/index.js +3 -0
- package/dist/esm/models/AlertEmailToggles.d.ts +50 -0
- package/dist/esm/models/AlertEmailToggles.js +55 -0
- package/dist/esm/models/AlertSettings.d.ts +51 -0
- package/dist/esm/models/AlertSettings.js +56 -0
- package/dist/esm/models/AlertSettingsUpdate.d.ts +39 -0
- package/dist/esm/models/AlertSettingsUpdate.js +48 -0
- package/dist/esm/models/ApiKey.d.ts +123 -0
- package/dist/esm/models/ApiKey.js +96 -0
- package/dist/esm/models/ApiKeyCreate.d.ts +70 -0
- package/dist/esm/models/ApiKeyCreate.js +57 -0
- package/dist/esm/models/ApiKeyCreated.d.ts +129 -0
- package/dist/esm/models/ApiKeyCreated.js +100 -0
- package/dist/esm/models/ApiKeyList.d.ts +33 -0
- package/dist/esm/models/ApiKeyList.js +44 -0
- package/dist/esm/models/ApiKeyScopes.d.ts +65 -0
- package/dist/esm/models/ApiKeyScopes.js +66 -0
- package/dist/esm/models/ApiKeyUpdate.d.ts +62 -0
- package/dist/esm/models/ApiKeyUpdate.js +51 -0
- package/dist/esm/models/Balance.d.ts +1 -1
- package/dist/esm/models/Balance.js +1 -1
- package/dist/esm/models/ChatChoice.d.ts +11 -1
- package/dist/esm/models/ChatChoice.js +3 -1
- package/dist/esm/models/ChatCompletionRequest.d.ts +78 -2
- package/dist/esm/models/ChatCompletionRequest.js +26 -1
- package/dist/esm/models/ChatCompletionRequestResponseFormat.d.ts +31 -0
- package/dist/esm/models/ChatCompletionRequestResponseFormat.js +52 -0
- package/dist/esm/models/ChatCompletionRequestToolChoice.d.ts +23 -0
- package/dist/esm/models/ChatCompletionRequestToolChoice.js +50 -0
- package/dist/esm/models/ChatCompletionResponse.d.ts +1 -1
- package/dist/esm/models/ChatCompletionResponse.js +1 -1
- package/dist/esm/models/ChatMessage.d.ts +22 -2
- package/dist/esm/models/ChatMessage.js +10 -5
- package/dist/esm/models/CostDetails.d.ts +59 -0
- package/dist/esm/models/CostDetails.js +59 -0
- package/dist/esm/models/CreateCryptoDepositRequest.d.ts +4 -1
- package/dist/esm/models/CreateCryptoDepositRequest.js +4 -2
- package/dist/esm/models/CreateWebhookEndpointRequest.d.ts +5 -1
- package/dist/esm/models/CreateWebhookEndpointRequest.js +6 -2
- package/dist/esm/models/CryptoDeposit.d.ts +3 -1
- package/dist/esm/models/CryptoDeposit.js +4 -2
- package/dist/esm/models/Embedding.d.ts +1 -1
- package/dist/esm/models/Embedding.js +1 -1
- package/dist/esm/models/EmbeddingsRequest.d.ts +1 -1
- package/dist/esm/models/EmbeddingsRequest.js +1 -1
- package/dist/esm/models/EmbeddingsRequestInput.d.ts +1 -1
- package/dist/esm/models/EmbeddingsRequestInput.js +1 -1
- package/dist/esm/models/EmbeddingsResponse.d.ts +1 -1
- package/dist/esm/models/EmbeddingsResponse.js +1 -1
- package/dist/esm/models/EmbeddingsUsage.d.ts +1 -1
- package/dist/esm/models/EmbeddingsUsage.js +1 -1
- package/dist/esm/models/GetHealth200Response.d.ts +1 -1
- package/dist/esm/models/GetHealth200Response.js +1 -1
- package/dist/esm/models/ImagesGenerationsRequest.d.ts +2 -2
- package/dist/esm/models/ImagesGenerationsRequest.js +1 -1
- package/dist/esm/models/ImagesResponse.d.ts +1 -1
- package/dist/esm/models/ImagesResponse.js +1 -1
- package/dist/esm/models/ImagesResponseDataInner.d.ts +1 -1
- package/dist/esm/models/ImagesResponseDataInner.js +1 -1
- package/dist/esm/models/ImagesResponseUsage.d.ts +1 -1
- package/dist/esm/models/ImagesResponseUsage.js +1 -1
- package/dist/esm/models/InferencePreflight.d.ts +5 -2
- package/dist/esm/models/InferencePreflight.js +4 -1
- package/dist/esm/models/JSONSchemaFormat.d.ts +54 -0
- package/dist/esm/models/JSONSchemaFormat.js +49 -0
- package/dist/esm/models/ListDeposits200Response.d.ts +1 -1
- package/dist/esm/models/ListDeposits200Response.js +1 -1
- package/dist/esm/models/Model.d.ts +54 -5
- package/dist/esm/models/Model.js +21 -2
- package/dist/esm/models/ModelList.d.ts +1 -1
- package/dist/esm/models/ModelList.js +1 -1
- package/dist/esm/models/ModelMetrics.d.ts +101 -0
- package/dist/esm/models/ModelMetrics.js +85 -0
- package/dist/esm/models/ModelParametersInner.d.ts +1 -1
- package/dist/esm/models/ModelParametersInner.js +1 -1
- package/dist/esm/models/ModelPricing.d.ts +1 -1
- package/dist/esm/models/ModelPricing.js +1 -1
- package/dist/esm/models/ModelRate.d.ts +1 -1
- package/dist/esm/models/ModelRate.js +1 -1
- package/dist/esm/models/OpenAIErrorEnvelope.d.ts +1 -1
- package/dist/esm/models/OpenAIErrorEnvelope.js +1 -1
- package/dist/esm/models/OpenAIErrorEnvelopeError.d.ts +8 -2
- package/dist/esm/models/OpenAIErrorEnvelopeError.js +3 -1
- package/dist/esm/models/PeakWindow.d.ts +1 -1
- package/dist/esm/models/PeakWindow.js +1 -1
- package/dist/esm/models/Problem.d.ts +22 -1
- package/dist/esm/models/Problem.js +14 -1
- package/dist/esm/models/RefereeStatus.d.ts +1 -1
- package/dist/esm/models/RefereeStatus.js +1 -1
- package/dist/esm/models/Referral.d.ts +14 -2
- package/dist/esm/models/Referral.js +9 -1
- package/dist/esm/models/RequestLogEntry.d.ts +210 -0
- package/dist/esm/models/RequestLogEntry.js +129 -0
- package/dist/esm/models/RequestLogPage.d.ts +45 -0
- package/dist/esm/models/RequestLogPage.js +52 -0
- package/dist/esm/models/ResponseFormatJSONObject.d.ts +39 -0
- package/dist/esm/models/ResponseFormatJSONObject.js +51 -0
- package/dist/esm/models/ResponseFormatJSONSchema.d.ts +46 -0
- package/dist/esm/models/ResponseFormatJSONSchema.js +56 -0
- package/dist/esm/models/ResponseFormatText.d.ts +39 -0
- package/dist/esm/models/ResponseFormatText.js +51 -0
- package/dist/esm/models/SpendingLimit.d.ts +1 -1
- package/dist/esm/models/SpendingLimit.js +1 -1
- package/dist/esm/models/StreamOptions.d.ts +1 -1
- package/dist/esm/models/StreamOptions.js +1 -1
- package/dist/esm/models/Subscription.d.ts +9 -2
- package/dist/esm/models/Subscription.js +6 -1
- package/dist/esm/models/SubscriptionCheckoutRequest.d.ts +18 -4
- package/dist/esm/models/SubscriptionCheckoutRequest.js +10 -1
- package/dist/esm/models/SubscriptionCheckoutSession.d.ts +21 -1
- package/dist/esm/models/SubscriptionCheckoutSession.js +12 -1
- package/dist/esm/models/SubscriptionModelUsage.d.ts +68 -0
- package/dist/esm/models/SubscriptionModelUsage.js +67 -0
- package/dist/esm/models/SubscriptionPlan.d.ts +4 -4
- package/dist/esm/models/SubscriptionPlan.js +1 -1
- package/dist/esm/models/SubscriptionPortalRequest.d.ts +1 -1
- package/dist/esm/models/SubscriptionPortalRequest.js +1 -1
- package/dist/esm/models/SubscriptionPortalSession.d.ts +1 -1
- package/dist/esm/models/SubscriptionPortalSession.js +1 -1
- package/dist/esm/models/SubscriptionPrice.d.ts +1 -1
- package/dist/esm/models/SubscriptionPrice.js +1 -1
- package/dist/esm/models/SubscriptionQuota.d.ts +10 -4
- package/dist/esm/models/SubscriptionQuota.js +8 -4
- package/dist/esm/models/SubscriptionTier.d.ts +53 -0
- package/dist/esm/models/SubscriptionTier.js +55 -0
- package/dist/esm/models/SubscriptionUpgradeRequest.d.ts +32 -0
- package/dist/esm/models/SubscriptionUpgradeRequest.js +43 -0
- package/dist/esm/models/SubscriptionUsage.d.ts +28 -3
- package/dist/esm/models/SubscriptionUsage.js +15 -4
- package/dist/esm/models/Tool.d.ts +46 -0
- package/dist/esm/models/Tool.js +56 -0
- package/dist/esm/models/ToolCall.d.ts +60 -0
- package/dist/esm/models/ToolCall.js +56 -0
- package/dist/esm/models/ToolCallFunction.d.ts +39 -0
- package/dist/esm/models/ToolCallFunction.js +47 -0
- package/dist/esm/models/ToolChoiceFunction.d.ts +46 -0
- package/dist/esm/models/ToolChoiceFunction.js +56 -0
- package/dist/esm/models/ToolChoiceFunctionFunction.d.ts +32 -0
- package/dist/esm/models/ToolChoiceFunctionFunction.js +43 -0
- package/dist/esm/models/ToolFunction.d.ts +47 -0
- package/dist/esm/models/ToolFunction.js +47 -0
- package/dist/esm/models/UpdateSpendingLimitRequest.d.ts +1 -1
- package/dist/esm/models/UpdateSpendingLimitRequest.js +1 -1
- package/dist/esm/models/Usage.d.ts +29 -1
- package/dist/esm/models/Usage.js +12 -1
- package/dist/esm/models/UsageBucket.d.ts +39 -6
- package/dist/esm/models/UsageBucket.js +11 -1
- package/dist/esm/models/UsageCompletionTokensDetails.d.ts +32 -0
- package/dist/esm/models/UsageCompletionTokensDetails.js +41 -0
- package/dist/esm/models/UsagePage.d.ts +2 -1
- package/dist/esm/models/UsagePage.js +1 -1
- package/dist/esm/models/UsagePromptTokensDetails.d.ts +33 -0
- package/dist/esm/models/UsagePromptTokensDetails.js +41 -0
- package/dist/esm/models/VideoCreateRequest.d.ts +1 -1
- package/dist/esm/models/VideoCreateRequest.js +1 -1
- package/dist/esm/models/VideoJob.d.ts +1 -1
- package/dist/esm/models/VideoJob.js +1 -1
- package/dist/esm/models/VideoList.d.ts +1 -1
- package/dist/esm/models/VideoList.js +1 -1
- package/dist/esm/models/WebhookEndpoint.d.ts +5 -1
- package/dist/esm/models/WebhookEndpoint.js +6 -2
- package/dist/esm/models/WebhookEndpointPage.d.ts +1 -1
- package/dist/esm/models/WebhookEndpointPage.js +1 -1
- package/dist/esm/models/index.d.ts +30 -0
- package/dist/esm/models/index.js +30 -0
- package/dist/esm/runtime.d.ts +1 -1
- package/dist/esm/runtime.js +2 -2
- package/dist/models/AlertEmailToggles.d.ts +50 -0
- package/dist/models/AlertEmailToggles.js +62 -0
- package/dist/models/AlertSettings.d.ts +51 -0
- package/dist/models/AlertSettings.js +63 -0
- package/dist/models/AlertSettingsUpdate.d.ts +39 -0
- package/dist/models/AlertSettingsUpdate.js +55 -0
- package/dist/models/ApiKey.d.ts +123 -0
- package/dist/models/ApiKey.js +103 -0
- package/dist/models/ApiKeyCreate.d.ts +70 -0
- package/dist/models/ApiKeyCreate.js +64 -0
- package/dist/models/ApiKeyCreated.d.ts +129 -0
- package/dist/models/ApiKeyCreated.js +107 -0
- package/dist/models/ApiKeyList.d.ts +33 -0
- package/dist/models/ApiKeyList.js +51 -0
- package/dist/models/ApiKeyScopes.d.ts +65 -0
- package/dist/models/ApiKeyScopes.js +74 -0
- package/dist/models/ApiKeyUpdate.d.ts +62 -0
- package/dist/models/ApiKeyUpdate.js +58 -0
- package/dist/models/Balance.d.ts +1 -1
- package/dist/models/Balance.js +1 -1
- package/dist/models/ChatChoice.d.ts +11 -1
- package/dist/models/ChatChoice.js +3 -1
- package/dist/models/ChatCompletionRequest.d.ts +78 -2
- package/dist/models/ChatCompletionRequest.js +26 -1
- package/dist/models/ChatCompletionRequestResponseFormat.d.ts +31 -0
- package/dist/models/ChatCompletionRequestResponseFormat.js +58 -0
- package/dist/models/ChatCompletionRequestToolChoice.d.ts +23 -0
- package/dist/models/ChatCompletionRequestToolChoice.js +56 -0
- package/dist/models/ChatCompletionResponse.d.ts +1 -1
- package/dist/models/ChatCompletionResponse.js +1 -1
- package/dist/models/ChatMessage.d.ts +22 -2
- package/dist/models/ChatMessage.js +10 -5
- package/dist/models/CostDetails.d.ts +59 -0
- package/dist/models/CostDetails.js +66 -0
- package/dist/models/CreateCryptoDepositRequest.d.ts +4 -1
- package/dist/models/CreateCryptoDepositRequest.js +4 -2
- package/dist/models/CreateWebhookEndpointRequest.d.ts +5 -1
- package/dist/models/CreateWebhookEndpointRequest.js +6 -2
- package/dist/models/CryptoDeposit.d.ts +3 -1
- package/dist/models/CryptoDeposit.js +4 -2
- package/dist/models/Embedding.d.ts +1 -1
- package/dist/models/Embedding.js +1 -1
- package/dist/models/EmbeddingsRequest.d.ts +1 -1
- package/dist/models/EmbeddingsRequest.js +1 -1
- package/dist/models/EmbeddingsRequestInput.d.ts +1 -1
- package/dist/models/EmbeddingsRequestInput.js +1 -1
- package/dist/models/EmbeddingsResponse.d.ts +1 -1
- package/dist/models/EmbeddingsResponse.js +1 -1
- package/dist/models/EmbeddingsUsage.d.ts +1 -1
- package/dist/models/EmbeddingsUsage.js +1 -1
- package/dist/models/GetHealth200Response.d.ts +1 -1
- package/dist/models/GetHealth200Response.js +1 -1
- package/dist/models/ImagesGenerationsRequest.d.ts +2 -2
- package/dist/models/ImagesGenerationsRequest.js +1 -1
- package/dist/models/ImagesResponse.d.ts +1 -1
- package/dist/models/ImagesResponse.js +1 -1
- package/dist/models/ImagesResponseDataInner.d.ts +1 -1
- package/dist/models/ImagesResponseDataInner.js +1 -1
- package/dist/models/ImagesResponseUsage.d.ts +1 -1
- package/dist/models/ImagesResponseUsage.js +1 -1
- package/dist/models/InferencePreflight.d.ts +5 -2
- package/dist/models/InferencePreflight.js +4 -1
- package/dist/models/JSONSchemaFormat.d.ts +54 -0
- package/dist/models/JSONSchemaFormat.js +56 -0
- package/dist/models/ListDeposits200Response.d.ts +1 -1
- package/dist/models/ListDeposits200Response.js +1 -1
- package/dist/models/Model.d.ts +54 -5
- package/dist/models/Model.js +21 -2
- package/dist/models/ModelList.d.ts +1 -1
- package/dist/models/ModelList.js +1 -1
- package/dist/models/ModelMetrics.d.ts +101 -0
- package/dist/models/ModelMetrics.js +93 -0
- package/dist/models/ModelParametersInner.d.ts +1 -1
- package/dist/models/ModelParametersInner.js +1 -1
- package/dist/models/ModelPricing.d.ts +1 -1
- package/dist/models/ModelPricing.js +1 -1
- package/dist/models/ModelRate.d.ts +1 -1
- package/dist/models/ModelRate.js +1 -1
- package/dist/models/OpenAIErrorEnvelope.d.ts +1 -1
- package/dist/models/OpenAIErrorEnvelope.js +1 -1
- package/dist/models/OpenAIErrorEnvelopeError.d.ts +8 -2
- package/dist/models/OpenAIErrorEnvelopeError.js +3 -1
- package/dist/models/PeakWindow.d.ts +1 -1
- package/dist/models/PeakWindow.js +1 -1
- package/dist/models/Problem.d.ts +22 -1
- package/dist/models/Problem.js +14 -1
- package/dist/models/RefereeStatus.d.ts +1 -1
- package/dist/models/RefereeStatus.js +1 -1
- package/dist/models/Referral.d.ts +14 -2
- package/dist/models/Referral.js +9 -1
- package/dist/models/RequestLogEntry.d.ts +210 -0
- package/dist/models/RequestLogEntry.js +137 -0
- package/dist/models/RequestLogPage.d.ts +45 -0
- package/dist/models/RequestLogPage.js +59 -0
- package/dist/models/ResponseFormatJSONObject.d.ts +39 -0
- package/dist/models/ResponseFormatJSONObject.js +59 -0
- package/dist/models/ResponseFormatJSONSchema.d.ts +46 -0
- package/dist/models/ResponseFormatJSONSchema.js +64 -0
- package/dist/models/ResponseFormatText.d.ts +39 -0
- package/dist/models/ResponseFormatText.js +59 -0
- package/dist/models/SpendingLimit.d.ts +1 -1
- package/dist/models/SpendingLimit.js +1 -1
- package/dist/models/StreamOptions.d.ts +1 -1
- package/dist/models/StreamOptions.js +1 -1
- package/dist/models/Subscription.d.ts +9 -2
- package/dist/models/Subscription.js +6 -1
- package/dist/models/SubscriptionCheckoutRequest.d.ts +18 -4
- package/dist/models/SubscriptionCheckoutRequest.js +11 -1
- package/dist/models/SubscriptionCheckoutSession.d.ts +21 -1
- package/dist/models/SubscriptionCheckoutSession.js +13 -1
- package/dist/models/SubscriptionModelUsage.d.ts +68 -0
- package/dist/models/SubscriptionModelUsage.js +74 -0
- package/dist/models/SubscriptionPlan.d.ts +4 -4
- package/dist/models/SubscriptionPlan.js +1 -1
- package/dist/models/SubscriptionPortalRequest.d.ts +1 -1
- package/dist/models/SubscriptionPortalRequest.js +1 -1
- package/dist/models/SubscriptionPortalSession.d.ts +1 -1
- package/dist/models/SubscriptionPortalSession.js +1 -1
- package/dist/models/SubscriptionPrice.d.ts +1 -1
- package/dist/models/SubscriptionPrice.js +1 -1
- package/dist/models/SubscriptionQuota.d.ts +10 -4
- package/dist/models/SubscriptionQuota.js +8 -4
- package/dist/models/SubscriptionTier.d.ts +53 -0
- package/dist/models/SubscriptionTier.js +62 -0
- package/dist/models/SubscriptionUpgradeRequest.d.ts +32 -0
- package/dist/models/SubscriptionUpgradeRequest.js +50 -0
- package/dist/models/SubscriptionUsage.d.ts +28 -3
- package/dist/models/SubscriptionUsage.js +15 -4
- package/dist/models/Tool.d.ts +46 -0
- package/dist/models/Tool.js +64 -0
- package/dist/models/ToolCall.d.ts +60 -0
- package/dist/models/ToolCall.js +64 -0
- package/dist/models/ToolCallFunction.d.ts +39 -0
- package/dist/models/ToolCallFunction.js +54 -0
- package/dist/models/ToolChoiceFunction.d.ts +46 -0
- package/dist/models/ToolChoiceFunction.js +64 -0
- package/dist/models/ToolChoiceFunctionFunction.d.ts +32 -0
- package/dist/models/ToolChoiceFunctionFunction.js +50 -0
- package/dist/models/ToolFunction.d.ts +47 -0
- package/dist/models/ToolFunction.js +54 -0
- package/dist/models/UpdateSpendingLimitRequest.d.ts +1 -1
- package/dist/models/UpdateSpendingLimitRequest.js +1 -1
- package/dist/models/Usage.d.ts +29 -1
- package/dist/models/Usage.js +12 -1
- package/dist/models/UsageBucket.d.ts +39 -6
- package/dist/models/UsageBucket.js +11 -1
- package/dist/models/UsageCompletionTokensDetails.d.ts +32 -0
- package/dist/models/UsageCompletionTokensDetails.js +48 -0
- package/dist/models/UsagePage.d.ts +2 -1
- package/dist/models/UsagePage.js +1 -1
- package/dist/models/UsagePromptTokensDetails.d.ts +33 -0
- package/dist/models/UsagePromptTokensDetails.js +48 -0
- package/dist/models/VideoCreateRequest.d.ts +1 -1
- package/dist/models/VideoCreateRequest.js +1 -1
- package/dist/models/VideoJob.d.ts +1 -1
- package/dist/models/VideoJob.js +1 -1
- package/dist/models/VideoList.d.ts +1 -1
- package/dist/models/VideoList.js +1 -1
- package/dist/models/WebhookEndpoint.d.ts +5 -1
- package/dist/models/WebhookEndpoint.js +6 -2
- package/dist/models/WebhookEndpointPage.d.ts +1 -1
- package/dist/models/WebhookEndpointPage.js +1 -1
- package/dist/models/index.d.ts +30 -0
- package/dist/models/index.js +30 -0
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +2 -2
- package/docs/AlertEmailToggles.md +40 -0
- package/docs/AlertSettings.md +40 -0
- package/docs/AlertSettingsUpdate.md +36 -0
- package/docs/AlertsApi.md +151 -0
- package/docs/ApiKey.md +65 -0
- package/docs/ApiKeyCreate.md +46 -0
- package/docs/ApiKeyCreated.md +67 -0
- package/docs/ApiKeyList.md +34 -0
- package/docs/ApiKeyScopes.md +38 -0
- package/docs/ApiKeyUpdate.md +45 -0
- package/docs/ApiKeysApi.md +389 -0
- package/docs/BillingApi.md +83 -3
- package/docs/ChatChoice.md +2 -0
- package/docs/ChatCompletionRequest.md +22 -0
- package/docs/ChatCompletionRequestResponseFormat.md +37 -0
- package/docs/ChatCompletionRequestToolChoice.md +37 -0
- package/docs/ChatMessage.md +4 -0
- package/docs/CostDetails.md +43 -0
- package/docs/InferenceApi.md +94 -71
- package/docs/JSONSchemaFormat.md +41 -0
- package/docs/Model.md +16 -0
- package/docs/ModelMetrics.md +55 -0
- package/docs/OpenAIErrorEnvelopeError.md +2 -0
- package/docs/Problem.md +4 -0
- package/docs/Referral.md +6 -2
- package/docs/RequestLogEntry.md +87 -0
- package/docs/RequestLogPage.md +38 -0
- package/docs/RequestsApi.md +282 -0
- package/docs/ResponseFormatJSONObject.md +35 -0
- package/docs/ResponseFormatJSONSchema.md +36 -0
- package/docs/ResponseFormatText.md +34 -0
- package/docs/Subscription.md +3 -1
- package/docs/SubscriptionCheckoutRequest.md +2 -0
- package/docs/SubscriptionCheckoutSession.md +4 -0
- package/docs/SubscriptionModelUsage.md +47 -0
- package/docs/SubscriptionPlan.md +1 -1
- package/docs/SubscriptionQuota.md +5 -3
- package/docs/SubscriptionTier.md +41 -0
- package/docs/SubscriptionUpgradeRequest.md +34 -0
- package/docs/SubscriptionUsage.md +10 -2
- package/docs/Tool.md +36 -0
- package/docs/ToolCall.md +41 -0
- package/docs/ToolCallFunction.md +36 -0
- package/docs/ToolChoiceFunction.md +36 -0
- package/docs/ToolChoiceFunctionFunction.md +34 -0
- package/docs/ToolFunction.md +38 -0
- package/docs/Usage.md +8 -0
- package/docs/UsageApi.md +17 -9
- package/docs/UsageBucket.md +11 -0
- package/docs/UsageCompletionTokensDetails.md +34 -0
- package/docs/UsagePromptTokensDetails.md +35 -0
- package/package.json +1 -1
- package/src/apis/AlertsApi.ts +145 -0
- package/src/apis/ApiKeysApi.ts +357 -0
- package/src/apis/BillingApi.ts +73 -7
- package/src/apis/InferenceApi.ts +32 -1
- package/src/apis/MetaApi.ts +1 -1
- package/src/apis/RequestsApi.ts +335 -0
- package/src/apis/UsageApi.ts +23 -1
- package/src/apis/WebhooksApi.ts +1 -1
- package/src/apis/index.ts +3 -0
- package/src/models/AlertEmailToggles.ts +93 -0
- package/src/models/AlertSettings.ts +101 -0
- package/src/models/AlertSettingsUpdate.ts +83 -0
- package/src/models/ApiKey.ts +205 -0
- package/src/models/ApiKeyCreate.ts +115 -0
- package/src/models/ApiKeyCreated.ts +214 -0
- package/src/models/ApiKeyList.ts +74 -0
- package/src/models/ApiKeyScopes.ts +106 -0
- package/src/models/ApiKeyUpdate.ts +105 -0
- package/src/models/Balance.ts +1 -1
- package/src/models/ChatChoice.ts +11 -1
- package/src/models/ChatCompletionRequest.ts +118 -2
- package/src/models/ChatCompletionRequestResponseFormat.ts +84 -0
- package/src/models/ChatCompletionRequestToolChoice.ts +70 -0
- package/src/models/ChatCompletionResponse.ts +1 -1
- package/src/models/ChatMessage.ts +35 -5
- package/src/models/CostDetails.ts +105 -0
- package/src/models/CreateCryptoDepositRequest.ts +5 -2
- package/src/models/CreateWebhookEndpointRequest.ts +6 -2
- package/src/models/CryptoDeposit.ts +4 -2
- package/src/models/Embedding.ts +1 -1
- package/src/models/EmbeddingsRequest.ts +1 -1
- package/src/models/EmbeddingsRequestInput.ts +1 -1
- package/src/models/EmbeddingsResponse.ts +1 -1
- package/src/models/EmbeddingsUsage.ts +1 -1
- package/src/models/GetHealth200Response.ts +1 -1
- package/src/models/ImagesGenerationsRequest.ts +2 -2
- package/src/models/ImagesResponse.ts +1 -1
- package/src/models/ImagesResponseDataInner.ts +1 -1
- package/src/models/ImagesResponseUsage.ts +1 -1
- package/src/models/InferencePreflight.ts +5 -2
- package/src/models/JSONSchemaFormat.ts +92 -0
- package/src/models/ListDeposits200Response.ts +1 -1
- package/src/models/Model.ts +78 -6
- package/src/models/ModelList.ts +1 -1
- package/src/models/ModelMetrics.ts +165 -0
- package/src/models/ModelParametersInner.ts +1 -1
- package/src/models/ModelPricing.ts +1 -1
- package/src/models/ModelRate.ts +1 -1
- package/src/models/OpenAIErrorEnvelope.ts +1 -1
- package/src/models/OpenAIErrorEnvelopeError.ts +10 -2
- package/src/models/PeakWindow.ts +1 -1
- package/src/models/Problem.ts +26 -1
- package/src/models/RefereeStatus.ts +1 -1
- package/src/models/Referral.ts +20 -2
- package/src/models/RequestLogEntry.ts +307 -0
- package/src/models/RequestLogPage.ts +92 -0
- package/src/models/ResponseFormatJSONObject.ts +78 -0
- package/src/models/ResponseFormatJSONSchema.ts +95 -0
- package/src/models/ResponseFormatText.ts +78 -0
- package/src/models/SpendingLimit.ts +1 -1
- package/src/models/StreamOptions.ts +1 -1
- package/src/models/Subscription.ts +18 -2
- package/src/models/SubscriptionCheckoutRequest.ts +23 -4
- package/src/models/SubscriptionCheckoutSession.ts +28 -1
- package/src/models/SubscriptionModelUsage.ts +120 -0
- package/src/models/SubscriptionPlan.ts +4 -4
- package/src/models/SubscriptionPortalRequest.ts +1 -1
- package/src/models/SubscriptionPortalSession.ts +1 -1
- package/src/models/SubscriptionPrice.ts +1 -1
- package/src/models/SubscriptionQuota.ts +16 -7
- package/src/models/SubscriptionTier.ts +108 -0
- package/src/models/SubscriptionUpgradeRequest.ts +66 -0
- package/src/models/SubscriptionUsage.ts +47 -6
- package/src/models/Tool.ts +95 -0
- package/src/models/ToolCall.ts +110 -0
- package/src/models/ToolCallFunction.ts +76 -0
- package/src/models/ToolChoiceFunction.ts +95 -0
- package/src/models/ToolChoiceFunctionFunction.ts +66 -0
- package/src/models/ToolFunction.ts +83 -0
- package/src/models/UpdateSpendingLimitRequest.ts +1 -1
- package/src/models/Usage.ts +56 -1
- package/src/models/UsageBucket.ts +49 -6
- package/src/models/UsageCompletionTokensDetails.ts +65 -0
- package/src/models/UsagePage.ts +2 -1
- package/src/models/UsagePromptTokensDetails.ts +66 -0
- package/src/models/VideoCreateRequest.ts +1 -1
- package/src/models/VideoJob.ts +1 -1
- package/src/models/VideoList.ts +1 -1
- package/src/models/WebhookEndpoint.ts +6 -2
- package/src/models/WebhookEndpointPage.ts +1 -1
- package/src/models/index.ts +30 -0
- package/src/runtime.ts +2 -2
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# ChatCompletionRequestResponseFormat
|
|
3
|
+
|
|
4
|
+
Constrain the reply format. Gated per model: `json_object` needs \"response_format\" in the model\'s supported_parameters, and a strict `json_schema` needs \"structured_outputs\". A model without the capability returns 400 unsupported_parameter naming the models that have it. A non-strict json_schema on a model with only \"response_format\" is served as json_object and reported as `response_format:downgraded` in x-deeprelay-ignored-params. The relay never emulates JSON mode by prompting.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`type` | string
|
|
11
|
+
`jsonSchema` | [JSONSchemaFormat](JSONSchemaFormat.md)
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { ChatCompletionRequestResponseFormat } from '@deeprelay/sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"type": null,
|
|
21
|
+
"jsonSchema": null,
|
|
22
|
+
} satisfies ChatCompletionRequestResponseFormat
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as ChatCompletionRequestResponseFormat
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# ChatCompletionRequestToolChoice
|
|
3
|
+
|
|
4
|
+
How the model should pick a tool: the strings \"none\", \"auto\" or \"required\", or an object naming one function. Requires a non-empty tools array unless it is \"none\".
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`type` | string
|
|
11
|
+
`_function` | [ToolChoiceFunctionFunction](ToolChoiceFunctionFunction.md)
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { ChatCompletionRequestToolChoice } from '@deeprelay/sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"type": null,
|
|
21
|
+
"_function": null,
|
|
22
|
+
} satisfies ChatCompletionRequestToolChoice
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as ChatCompletionRequestToolChoice
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
36
|
+
|
|
37
|
+
|
package/docs/ChatMessage.md
CHANGED
|
@@ -8,6 +8,8 @@ Name | Type
|
|
|
8
8
|
------------ | -------------
|
|
9
9
|
`role` | string
|
|
10
10
|
`content` | string
|
|
11
|
+
`toolCalls` | [Array<ToolCall>](ToolCall.md)
|
|
12
|
+
`toolCallId` | string
|
|
11
13
|
|
|
12
14
|
## Example
|
|
13
15
|
|
|
@@ -18,6 +20,8 @@ import type { ChatMessage } from '@deeprelay/sdk'
|
|
|
18
20
|
const example = {
|
|
19
21
|
"role": null,
|
|
20
22
|
"content": null,
|
|
23
|
+
"toolCalls": null,
|
|
24
|
+
"toolCallId": null,
|
|
21
25
|
} satisfies ChatMessage
|
|
22
26
|
|
|
23
27
|
console.log(example)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
# CostDetails
|
|
3
|
+
|
|
4
|
+
How this call was priced, in USD (exact decimals, up to 8 places). list_price_equivalent = plan_covered_amount + charged_amount. A call is either fully covered by the subscription or fully charged: there is no partial coverage.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`listPriceEquivalent` | number
|
|
11
|
+
`planCoveredAmount` | number
|
|
12
|
+
`chargedAmount` | number
|
|
13
|
+
`quotaUnitsUsed` | number
|
|
14
|
+
`cacheSavings` | number
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import type { CostDetails } from '@deeprelay/sdk'
|
|
20
|
+
|
|
21
|
+
// TODO: Update the object below with actual values
|
|
22
|
+
const example = {
|
|
23
|
+
"listPriceEquivalent": null,
|
|
24
|
+
"planCoveredAmount": null,
|
|
25
|
+
"chargedAmount": null,
|
|
26
|
+
"quotaUnitsUsed": null,
|
|
27
|
+
"cacheSavings": null,
|
|
28
|
+
} satisfies CostDetails
|
|
29
|
+
|
|
30
|
+
console.log(example)
|
|
31
|
+
|
|
32
|
+
// Convert the instance to a JSON string
|
|
33
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
34
|
+
console.log(exampleJSON)
|
|
35
|
+
|
|
36
|
+
// Parse the JSON string back to an object
|
|
37
|
+
const exampleParsed = JSON.parse(exampleJSON) as CostDetails
|
|
38
|
+
console.log(exampleParsed)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
42
|
+
|
|
43
|
+
|
package/docs/InferenceApi.md
CHANGED
|
@@ -83,21 +83,23 @@ example().catch(console.error);
|
|
|
83
83
|
| Status code | Description | Response headers |
|
|
84
84
|
|-------------|-------------|------------------|
|
|
85
85
|
| **200** | A video generation job object. | - |
|
|
86
|
-
| **401** | Missing or invalid API key (OpenAI error envelope). | - |
|
|
87
|
-
| **403** | API key lacks the required scope (OpenAI error envelope
|
|
88
|
-
| **404** | Model or resource not found (OpenAI error envelope). | - |
|
|
89
|
-
| **409** | Invalid request (OpenAI error envelope). | - |
|
|
90
|
-
| **429** | Rate limit exceeded (OpenAI error envelope). Retry-After
|
|
86
|
+
| **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
87
|
+
| **403** | API key lacks the required scope (`insufficient_scope`), or the key has a model allowlist that does not include the requested model (`model_not_allowed_for_key`; 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
|
+
| **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 (`rate_limit_exceeded`) 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 (`subscription_quota_exhausted`, raised only when the wallet cannot cover the pay-as-you-go fallback) carries `x-should-retry: false` and no Retry-After. When the tripped gate is a rolling 7-day cap (`param: weekly_input_tokens` or `param: weekly_output_tokens`), the error object also carries `quota_frees_at`, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. `param` names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\'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> |
|
|
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)
|
|
97
|
+
> ChatCompletionResponse createChatCompletion(chatCompletionRequest, xClientRequestId)
|
|
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.** `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.
|
|
102
|
+
|
|
101
103
|
### Example
|
|
102
104
|
|
|
103
105
|
```ts
|
|
@@ -118,6 +120,8 @@ async function example() {
|
|
|
118
120
|
const body = {
|
|
119
121
|
// ChatCompletionRequest
|
|
120
122
|
chatCompletionRequest: ...,
|
|
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
|
+
xClientRequestId: xClientRequestId_example,
|
|
121
125
|
} satisfies CreateChatCompletionRequest;
|
|
122
126
|
|
|
123
127
|
try {
|
|
@@ -138,6 +142,7 @@ example().catch(console.error);
|
|
|
138
142
|
| Name | Type | Description | Notes |
|
|
139
143
|
|------------- | ------------- | ------------- | -------------|
|
|
140
144
|
| **chatCompletionRequest** | [ChatCompletionRequest](ChatCompletionRequest.md) | | |
|
|
145
|
+
| **xClientRequestId** | `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] [Defaults to `undefined`] |
|
|
141
146
|
|
|
142
147
|
### Return type
|
|
143
148
|
|
|
@@ -156,23 +161,24 @@ example().catch(console.error);
|
|
|
156
161
|
### HTTP response details
|
|
157
162
|
| Status code | Description | Response headers |
|
|
158
163
|
|-------------|-------------|------------------|
|
|
159
|
-
| **200** | Successful response. application/json for non-streaming requests; text/event-stream for streaming requests (stream=true). | - |
|
|
160
|
-
| **400** | Invalid request (OpenAI error envelope). | - |
|
|
161
|
-
| **401** | Missing or invalid API key (OpenAI error envelope). | - |
|
|
162
|
-
| **402** | Insufficient balance (OpenAI error envelope, SERV-06). | - |
|
|
163
|
-
| **403** | API key lacks the required scope (OpenAI error envelope
|
|
164
|
-
| **404** | Model or resource not found (OpenAI error envelope). | - |
|
|
165
|
-
| **
|
|
166
|
-
| **
|
|
167
|
-
| **
|
|
168
|
-
| **
|
|
164
|
+
| **200** | Successful response. application/json for non-streaming requests; text/event-stream for streaming requests (stream=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> |
|
|
166
|
+
| **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
167
|
+
| **402** | Insufficient balance or a spend limit reached (OpenAI error envelope, SERV-06): `insufficient_balance`, `daily_limit_reached`, `spending_limit_reached`, `api_key_budget_exceeded` (this API key\'s monthly budget) or `member_spend_limit_reached` (the member\'s monthly spend limit). Carries `x-should-retry: false`: the same request will not succeed until the wallet or the limit changes. | * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
|
|
168
|
+
| **403** | API key lacks the required scope (`insufficient_scope`), or the key has a model allowlist that does not include the requested model (`model_not_allowed_for_key`; 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
|
+
| **404** | Model or resource not found (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
170
|
+
| **413** | Request body too large (OpenAI error envelope, code request_too_large). | * X-Deeprelay-Error-Code - <br> |
|
|
171
|
+
| **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 (`rate_limit_exceeded`) 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 (`subscription_quota_exhausted`, raised only when the wallet cannot cover the pay-as-you-go fallback) carries `x-should-retry: false` and no Retry-After. When the tripped gate is a rolling 7-day cap (`param: weekly_input_tokens` or `param: weekly_output_tokens`), the error object also carries `quota_frees_at`, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. `param` names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\'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> |
|
|
173
|
+
| **500** | Internal server error (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
174
|
+
| **503** | No upstream could serve the request (OpenAI error envelope, `upstream_unavailable`): every capable upstream is down, shedding load, or none of the model\'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> |
|
|
169
175
|
|
|
170
176
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
171
177
|
|
|
172
178
|
|
|
173
179
|
## createEmbeddings
|
|
174
180
|
|
|
175
|
-
> EmbeddingsResponse createEmbeddings(embeddingsRequest)
|
|
181
|
+
> EmbeddingsResponse createEmbeddings(embeddingsRequest, xClientRequestId)
|
|
176
182
|
|
|
177
183
|
Create embeddings (OpenAI-compatible)
|
|
178
184
|
|
|
@@ -198,6 +204,8 @@ async function example() {
|
|
|
198
204
|
const body = {
|
|
199
205
|
// EmbeddingsRequest
|
|
200
206
|
embeddingsRequest: ...,
|
|
207
|
+
// 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)
|
|
208
|
+
xClientRequestId: xClientRequestId_example,
|
|
201
209
|
} satisfies CreateEmbeddingsRequest;
|
|
202
210
|
|
|
203
211
|
try {
|
|
@@ -218,6 +226,7 @@ example().catch(console.error);
|
|
|
218
226
|
| Name | Type | Description | Notes |
|
|
219
227
|
|------------- | ------------- | ------------- | -------------|
|
|
220
228
|
| **embeddingsRequest** | [EmbeddingsRequest](EmbeddingsRequest.md) | | |
|
|
229
|
+
| **xClientRequestId** | `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] [Defaults to `undefined`] |
|
|
221
230
|
|
|
222
231
|
### Return type
|
|
223
232
|
|
|
@@ -237,24 +246,24 @@ example().catch(console.error);
|
|
|
237
246
|
| Status code | Description | Response headers |
|
|
238
247
|
|-------------|-------------|------------------|
|
|
239
248
|
| **200** | One embedding vector per input, in request order. | - |
|
|
240
|
-
| **400** | Invalid request (OpenAI error envelope). | - |
|
|
241
|
-
| **401** | Missing or invalid API key (OpenAI error envelope). | - |
|
|
242
|
-
| **402** | Insufficient balance (OpenAI error envelope, SERV-06). | - |
|
|
243
|
-
| **403** | API key lacks the required scope (OpenAI error envelope
|
|
244
|
-
| **404** | Model or resource not found (OpenAI error envelope). | - |
|
|
245
|
-
| **413** | Request body too large (OpenAI error envelope, code request_too_large). | - |
|
|
246
|
-
| **429** | Rate limit exceeded (OpenAI error envelope). Retry-After
|
|
247
|
-
| **500** | Internal server error (OpenAI error envelope). | - |
|
|
248
|
-
| **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. | - |
|
|
249
|
-
| **503** |
|
|
250
|
-
| **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. | - |
|
|
249
|
+
| **400** | Invalid request (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
250
|
+
| **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
251
|
+
| **402** | Insufficient balance or a spend limit reached (OpenAI error envelope, SERV-06): `insufficient_balance`, `daily_limit_reached`, `spending_limit_reached`, `api_key_budget_exceeded` (this API key\'s monthly budget) or `member_spend_limit_reached` (the member\'s monthly spend limit). Carries `x-should-retry: false`: the same request will not succeed until the wallet or the limit changes. | * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
|
|
252
|
+
| **403** | API key lacks the required scope (`insufficient_scope`), or the key has a model allowlist that does not include the requested model (`model_not_allowed_for_key`; 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
|
+
| **404** | Model or resource not found (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
254
|
+
| **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 (`rate_limit_exceeded`) 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 (`subscription_quota_exhausted`, raised only when the wallet cannot cover the pay-as-you-go fallback) carries `x-should-retry: false` and no Retry-After. When the tripped gate is a rolling 7-day cap (`param: weekly_input_tokens` or `param: weekly_output_tokens`), the error object also carries `quota_frees_at`, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. `param` names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\'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> |
|
|
256
|
+
| **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, `upstream_unavailable`): every capable upstream is down, shedding load, or none of the model\'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> |
|
|
251
260
|
|
|
252
261
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
253
262
|
|
|
254
263
|
|
|
255
264
|
## createImage
|
|
256
265
|
|
|
257
|
-
> ImagesResponse createImage(imagesGenerationsRequest, idempotencyKey)
|
|
266
|
+
> ImagesResponse createImage(imagesGenerationsRequest, idempotencyKey, xClientRequestId)
|
|
258
267
|
|
|
259
268
|
Create image (OpenAI-compatible)
|
|
260
269
|
|
|
@@ -282,6 +291,8 @@ async function example() {
|
|
|
282
291
|
imagesGenerationsRequest: ...,
|
|
283
292
|
// string (optional)
|
|
284
293
|
idempotencyKey: idempotencyKey_example,
|
|
294
|
+
// 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)
|
|
295
|
+
xClientRequestId: xClientRequestId_example,
|
|
285
296
|
} satisfies CreateImageRequest;
|
|
286
297
|
|
|
287
298
|
try {
|
|
@@ -303,6 +314,7 @@ example().catch(console.error);
|
|
|
303
314
|
|------------- | ------------- | ------------- | -------------|
|
|
304
315
|
| **imagesGenerationsRequest** | [ImagesGenerationsRequest](ImagesGenerationsRequest.md) | | |
|
|
305
316
|
| **idempotencyKey** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
317
|
+
| **xClientRequestId** | `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] [Defaults to `undefined`] |
|
|
306
318
|
|
|
307
319
|
### Return type
|
|
308
320
|
|
|
@@ -322,23 +334,23 @@ example().catch(console.error);
|
|
|
322
334
|
| Status code | Description | Response headers |
|
|
323
335
|
|-------------|-------------|------------------|
|
|
324
336
|
| **200** | OpenAI-shaped image generation response (b64_json only). | - |
|
|
325
|
-
| **400** | Invalid request (OpenAI error envelope). | - |
|
|
326
|
-
| **401** | Missing or invalid API key (OpenAI error envelope). | - |
|
|
327
|
-
| **402** | Insufficient balance (OpenAI error envelope, SERV-06). | - |
|
|
328
|
-
| **403** | API key lacks the required scope (OpenAI error envelope
|
|
329
|
-
| **404** | Model or resource not found (OpenAI error envelope). | - |
|
|
330
|
-
| **422** | Request validation failed (OpenAI error envelope). | - |
|
|
331
|
-
| **429** | Rate limit exceeded (OpenAI error envelope). Retry-After
|
|
332
|
-
| **500** | Internal server error (OpenAI error envelope). | - |
|
|
333
|
-
| **503** |
|
|
334
|
-
| **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. | - |
|
|
337
|
+
| **400** | Invalid request (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
338
|
+
| **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
339
|
+
| **402** | Insufficient balance or a spend limit reached (OpenAI error envelope, SERV-06): `insufficient_balance`, `daily_limit_reached`, `spending_limit_reached`, `api_key_budget_exceeded` (this API key\'s monthly budget) or `member_spend_limit_reached` (the member\'s monthly spend limit). Carries `x-should-retry: false`: the same request will not succeed until the wallet or the limit changes. | * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
|
|
340
|
+
| **403** | API key lacks the required scope (`insufficient_scope`), or the key has a model allowlist that does not include the requested model (`model_not_allowed_for_key`; 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
|
+
| **404** | Model or resource not found (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
342
|
+
| **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 (`rate_limit_exceeded`) 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 (`subscription_quota_exhausted`, raised only when the wallet cannot cover the pay-as-you-go fallback) carries `x-should-retry: false` and no Retry-After. When the tripped gate is a rolling 7-day cap (`param: weekly_input_tokens` or `param: weekly_output_tokens`), the error object also carries `quota_frees_at`, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. `param` names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\'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> |
|
|
344
|
+
| **500** | Internal server error (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
345
|
+
| **503** | No upstream could serve the request (OpenAI error envelope, `upstream_unavailable`): every capable upstream is down, shedding load, or none of the model\'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> |
|
|
335
347
|
|
|
336
348
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
337
349
|
|
|
338
350
|
|
|
339
351
|
## createVideo
|
|
340
352
|
|
|
341
|
-
> VideoJob createVideo(videoCreateRequest, idempotencyKey)
|
|
353
|
+
> VideoJob createVideo(videoCreateRequest, idempotencyKey, xClientRequestId)
|
|
342
354
|
|
|
343
355
|
Create a video generation job (async)
|
|
344
356
|
|
|
@@ -366,6 +378,8 @@ async function example() {
|
|
|
366
378
|
videoCreateRequest: ...,
|
|
367
379
|
// string (optional)
|
|
368
380
|
idempotencyKey: idempotencyKey_example,
|
|
381
|
+
// 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)
|
|
382
|
+
xClientRequestId: xClientRequestId_example,
|
|
369
383
|
} satisfies CreateVideoRequest;
|
|
370
384
|
|
|
371
385
|
try {
|
|
@@ -387,6 +401,7 @@ example().catch(console.error);
|
|
|
387
401
|
|------------- | ------------- | ------------- | -------------|
|
|
388
402
|
| **videoCreateRequest** | [VideoCreateRequest](VideoCreateRequest.md) | | |
|
|
389
403
|
| **idempotencyKey** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
404
|
+
| **xClientRequestId** | `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] [Defaults to `undefined`] |
|
|
390
405
|
|
|
391
406
|
### Return type
|
|
392
407
|
|
|
@@ -406,13 +421,13 @@ example().catch(console.error);
|
|
|
406
421
|
| Status code | Description | Response headers |
|
|
407
422
|
|-------------|-------------|------------------|
|
|
408
423
|
| **200** | A video generation job object. | - |
|
|
409
|
-
| **400** | Invalid request (OpenAI error envelope). | - |
|
|
410
|
-
| **401** | Missing or invalid API key (OpenAI error envelope). | - |
|
|
411
|
-
| **402** | Insufficient balance (OpenAI error envelope, SERV-06). | - |
|
|
412
|
-
| **403** | API key lacks the required scope (OpenAI error envelope
|
|
413
|
-
| **404** | Model or resource not found (OpenAI error envelope). | - |
|
|
414
|
-
| **429** | Rate limit exceeded (OpenAI error envelope). Retry-After
|
|
415
|
-
| **500** | Internal server error (OpenAI error envelope). | - |
|
|
424
|
+
| **400** | Invalid request (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
425
|
+
| **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
426
|
+
| **402** | Insufficient balance or a spend limit reached (OpenAI error envelope, SERV-06): `insufficient_balance`, `daily_limit_reached`, `spending_limit_reached`, `api_key_budget_exceeded` (this API key\'s monthly budget) or `member_spend_limit_reached` (the member\'s monthly spend limit). Carries `x-should-retry: false`: the same request will not succeed until the wallet or the limit changes. | * x-should-retry - <br> * X-Deeprelay-Error-Code - <br> |
|
|
427
|
+
| **403** | API key lacks the required scope (`insufficient_scope`), or the key has a model allowlist that does not include the requested model (`model_not_allowed_for_key`; 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
|
+
| **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 (`rate_limit_exceeded`) 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 (`subscription_quota_exhausted`, raised only when the wallet cannot cover the pay-as-you-go fallback) carries `x-should-retry: false` and no Retry-After. When the tripped gate is a rolling 7-day cap (`param: weekly_input_tokens` or `param: weekly_output_tokens`), the error object also carries `quota_frees_at`, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. `param` names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\'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> |
|
|
430
|
+
| **500** | Internal server error (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
416
431
|
|
|
417
432
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
418
433
|
|
|
@@ -423,6 +438,8 @@ example().catch(console.error);
|
|
|
423
438
|
|
|
424
439
|
Get a specific model (OpenAI-compatible)
|
|
425
440
|
|
|
441
|
+
A key with a model allowlist gets 403 `model_not_allowed_for_key` for a model off its list, and the same 403 for an id that does not exist.
|
|
442
|
+
|
|
426
443
|
### Example
|
|
427
444
|
|
|
428
445
|
```ts
|
|
@@ -482,10 +499,10 @@ example().catch(console.error);
|
|
|
482
499
|
| Status code | Description | Response headers |
|
|
483
500
|
|-------------|-------------|------------------|
|
|
484
501
|
| **200** | OpenAI-shaped single model. | - |
|
|
485
|
-
| **401** | Missing or invalid API key (OpenAI error envelope). | - |
|
|
486
|
-
| **403** | API key lacks the required scope (OpenAI error envelope
|
|
487
|
-
| **404** | Model or resource not found (OpenAI error envelope). | - |
|
|
488
|
-
| **429** | Rate limit exceeded (OpenAI error envelope). Retry-After
|
|
502
|
+
| **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
503
|
+
| **403** | API key lacks the required scope (`insufficient_scope`), or the key has a model allowlist that does not include the requested model (`model_not_allowed_for_key`; 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
|
+
| **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 (`rate_limit_exceeded`) 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 (`subscription_quota_exhausted`, raised only when the wallet cannot cover the pay-as-you-go fallback) carries `x-should-retry: false` and no Retry-After. When the tripped gate is a rolling 7-day cap (`param: weekly_input_tokens` or `param: weekly_output_tokens`), the error object also carries `quota_frees_at`, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. `param` names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\'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> |
|
|
489
506
|
|
|
490
507
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
491
508
|
|
|
@@ -555,10 +572,10 @@ example().catch(console.error);
|
|
|
555
572
|
| Status code | Description | Response headers |
|
|
556
573
|
|-------------|-------------|------------------|
|
|
557
574
|
| **200** | A video generation job object. | - |
|
|
558
|
-
| **401** | Missing or invalid API key (OpenAI error envelope). | - |
|
|
559
|
-
| **403** | API key lacks the required scope (OpenAI error envelope
|
|
560
|
-
| **404** | Model or resource not found (OpenAI error envelope). | - |
|
|
561
|
-
| **429** | Rate limit exceeded (OpenAI error envelope). Retry-After
|
|
575
|
+
| **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
576
|
+
| **403** | API key lacks the required scope (`insufficient_scope`), or the key has a model allowlist that does not include the requested model (`model_not_allowed_for_key`; 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
|
+
| **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 (`rate_limit_exceeded`) 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 (`subscription_quota_exhausted`, raised only when the wallet cannot cover the pay-as-you-go fallback) carries `x-should-retry: false` and no Retry-After. When the tripped gate is a rolling 7-day cap (`param: weekly_input_tokens` or `param: weekly_output_tokens`), the error object also carries `quota_frees_at`, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. `param` names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\'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> |
|
|
562
579
|
|
|
563
580
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
564
581
|
|
|
@@ -630,11 +647,11 @@ example().catch(console.error);
|
|
|
630
647
|
| Status code | Description | Response headers |
|
|
631
648
|
|-------------|-------------|------------------|
|
|
632
649
|
| **200** | The generated video stream. | - |
|
|
633
|
-
| **401** | Missing or invalid API key (OpenAI error envelope). | - |
|
|
634
|
-
| **403** | API key lacks the required scope (OpenAI error envelope
|
|
635
|
-
| **404** | Model or resource not found (OpenAI error envelope). | - |
|
|
636
|
-
| **410** | The requested artifact has expired and is no longer available (OpenAI error envelope). | - |
|
|
637
|
-
| **429** | Rate limit exceeded (OpenAI error envelope). Retry-After
|
|
650
|
+
| **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
651
|
+
| **403** | API key lacks the required scope (`insufficient_scope`), or the key has a model allowlist that does not include the requested model (`model_not_allowed_for_key`; 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
|
+
| **404** | Model or resource not found (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
653
|
+
| **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 (`rate_limit_exceeded`) 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 (`subscription_quota_exhausted`, raised only when the wallet cannot cover the pay-as-you-go fallback) carries `x-should-retry: false` and no Retry-After. When the tripped gate is a rolling 7-day cap (`param: weekly_input_tokens` or `param: weekly_output_tokens`), the error object also carries `quota_frees_at`, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. `param` names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\'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> |
|
|
638
655
|
|
|
639
656
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
640
657
|
|
|
@@ -706,18 +723,20 @@ example().catch(console.error);
|
|
|
706
723
|
| Status code | Description | Response headers |
|
|
707
724
|
|-------------|-------------|------------------|
|
|
708
725
|
| **200** | OK | - |
|
|
709
|
-
| **404** | Model or resource not found (OpenAI error envelope). | - |
|
|
710
|
-
| **429** | Rate limit exceeded (OpenAI error envelope). Retry-After
|
|
726
|
+
| **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 (`rate_limit_exceeded`) 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 (`subscription_quota_exhausted`, raised only when the wallet cannot cover the pay-as-you-go fallback) carries `x-should-retry: false` and no Retry-After. When the tripped gate is a rolling 7-day cap (`param: weekly_input_tokens` or `param: weekly_output_tokens`), the error object also carries `quota_frees_at`, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. `param` names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\'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> |
|
|
711
728
|
|
|
712
729
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
713
730
|
|
|
714
731
|
|
|
715
732
|
## listModels
|
|
716
733
|
|
|
717
|
-
> ModelList listModels(modality)
|
|
734
|
+
> ModelList listModels(modality, ifNoneMatch)
|
|
718
735
|
|
|
719
736
|
List available models (OpenAI-compatible)
|
|
720
737
|
|
|
738
|
+
Works with or without an API key, and returns the same body either way. Without a key the response is publicly cacheable (`Cache-Control: public, max-age=60`), carries a strong `ETag` (send `If-None-Match` to get a 304), and is rate-limited per client IP (429 `rate_limit_exceeded` with Retry-After). With a key it is `Cache-Control: private` and counts against the key\'s rate limit; an invalid key returns 401, it does not fall back to anonymous access. Error responses are `no-store`. Each entry\'s `supported_parameters` is backed by live capability probes of the model\'s upstreams: it is the list to check before sending a gated parameter (`response_format`, `structured_outputs`, `logprobs`, `tools`, `vision`, ...). One exception to \"the same body\": a key with a model allowlist (`allowed_models`) sees only the models on its list. Each entry may carry a `metrics` object (always the last key): measured time to first token, decode rate and success rate over a rolling window of deeprelay customer traffic. Below the sample minimum `insufficient_data` is true and the figure is omitted, never zero.
|
|
739
|
+
|
|
721
740
|
### Example
|
|
722
741
|
|
|
723
742
|
```ts
|
|
@@ -738,6 +757,8 @@ async function example() {
|
|
|
738
757
|
const body = {
|
|
739
758
|
// 'chat' | 'image' | 'video' | 'embedding' (optional)
|
|
740
759
|
modality: modality_example,
|
|
760
|
+
// string | An ETag from an earlier anonymous response; a match returns 304. (optional)
|
|
761
|
+
ifNoneMatch: ifNoneMatch_example,
|
|
741
762
|
} satisfies ListModelsRequest;
|
|
742
763
|
|
|
743
764
|
try {
|
|
@@ -758,6 +779,7 @@ example().catch(console.error);
|
|
|
758
779
|
| Name | Type | Description | Notes |
|
|
759
780
|
|------------- | ------------- | ------------- | -------------|
|
|
760
781
|
| **modality** | `chat`, `image`, `video`, `embedding` | | [Optional] [Defaults to `undefined`] [Enum: chat, image, video, embedding] |
|
|
782
|
+
| **ifNoneMatch** | `string` | An ETag from an earlier anonymous response; a match returns 304. | [Optional] [Defaults to `undefined`] |
|
|
761
783
|
|
|
762
784
|
### Return type
|
|
763
785
|
|
|
@@ -776,11 +798,12 @@ example().catch(console.error);
|
|
|
776
798
|
### HTTP response details
|
|
777
799
|
| Status code | Description | Response headers |
|
|
778
800
|
|-------------|-------------|------------------|
|
|
779
|
-
| **200** | OpenAI-shaped model list. | - |
|
|
780
|
-
| **
|
|
781
|
-
| **
|
|
782
|
-
| **
|
|
783
|
-
| **
|
|
801
|
+
| **200** | OpenAI-shaped model list. | * Cache-Control - `public, max-age=60` without a key; `private` with one. <br> * ETag - Strong validator for the anonymous listing. <br> |
|
|
802
|
+
| **304** | Not modified; the If-None-Match ETag still matches. | - |
|
|
803
|
+
| **400** | Invalid request (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
804
|
+
| **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
805
|
+
| **403** | API key lacks the required scope (`insufficient_scope`), or the key has a model allowlist that does not include the requested model (`model_not_allowed_for_key`; 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 (`rate_limit_exceeded`) 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 (`subscription_quota_exhausted`, raised only when the wallet cannot cover the pay-as-you-go fallback) carries `x-should-retry: false` and no Retry-After. When the tripped gate is a rolling 7-day cap (`param: weekly_input_tokens` or `param: weekly_output_tokens`), the error object also carries `quota_frees_at`, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. `param` names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\'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> |
|
|
784
807
|
|
|
785
808
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
786
809
|
|
|
@@ -853,9 +876,9 @@ example().catch(console.error);
|
|
|
853
876
|
| Status code | Description | Response headers |
|
|
854
877
|
|-------------|-------------|------------------|
|
|
855
878
|
| **200** | A page of video generation jobs. | - |
|
|
856
|
-
| **401** | Missing or invalid API key (OpenAI error envelope). | - |
|
|
857
|
-
| **403** | API key lacks the required scope (OpenAI error envelope
|
|
858
|
-
| **429** | Rate limit exceeded (OpenAI error envelope). Retry-After
|
|
879
|
+
| **401** | Missing or invalid API key (OpenAI error envelope). | * X-Deeprelay-Error-Code - <br> |
|
|
880
|
+
| **403** | API key lacks the required scope (`insufficient_scope`), or the key has a model allowlist that does not include the requested model (`model_not_allowed_for_key`; 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 (`rate_limit_exceeded`) 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 (`subscription_quota_exhausted`, raised only when the wallet cannot cover the pay-as-you-go fallback) carries `x-should-retry: false` and no Retry-After. When the tripped gate is a rolling 7-day cap (`param: weekly_input_tokens` or `param: weekly_output_tokens`), the error object also carries `quota_frees_at`, the RFC 3339 time the window frees enough capacity — the earlier of the two windows. `param` names the tripped gate: monthly_input_tokens, monthly_output_tokens, weekly_input_tokens, weekly_output_tokens, max_usage, input_overshoot (this request\'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> |
|
|
859
882
|
|
|
860
883
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
861
884
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
# JSONSchemaFormat
|
|
3
|
+
|
|
4
|
+
The schema is forwarded byte-for-byte. It may be at most 64 KiB and nested at most 32 levels deep; larger or deeper schemas return 400 unsupported_parameter (param response_format).
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`name` | string
|
|
11
|
+
`description` | string
|
|
12
|
+
`schema` | { [key: string]: any; }
|
|
13
|
+
`strict` | boolean
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import type { JSONSchemaFormat } from '@deeprelay/sdk'
|
|
19
|
+
|
|
20
|
+
// TODO: Update the object below with actual values
|
|
21
|
+
const example = {
|
|
22
|
+
"name": null,
|
|
23
|
+
"description": null,
|
|
24
|
+
"schema": null,
|
|
25
|
+
"strict": null,
|
|
26
|
+
} satisfies JSONSchemaFormat
|
|
27
|
+
|
|
28
|
+
console.log(example)
|
|
29
|
+
|
|
30
|
+
// Convert the instance to a JSON string
|
|
31
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
32
|
+
console.log(exampleJSON)
|
|
33
|
+
|
|
34
|
+
// Parse the JSON string back to an object
|
|
35
|
+
const exampleParsed = JSON.parse(exampleJSON) as JSONSchemaFormat
|
|
36
|
+
console.log(exampleParsed)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
40
|
+
|
|
41
|
+
|