Skip to content
DeepTokenInference Gateway
HomeDashboardModelsPromptsLeaderboardDocsPricingEnterpriseBlog
    Errors

    Introduction

    • Getting started
    • Quickstart
    • Integrations

    API

    • Authentication
    • Chat Completions
    • Models
    • Errors

    Billing

    • Billing
    • Organizations

    Introduction

    • Getting started
    • Quickstart
    • Integrations

    API

    • Authentication
    • Chat Completions
    • Models
    • Errors

    Billing

    • Billing
    • Organizations

    Errors

    The gateway returns OpenAI-compatible error envelopes with a DeepToken-specific category header so clients can branch retry behaviour without parsing strings.

    The envelope

    {
      "error": {
        "message": "human-readable description",
        "type": "category_name",
        "code": "specific_code"
      }
    }
    

    Every response also carries an X-Gateway-Error-Category header. The category is one of:

    CategoryMeaningRetry?
    platform_errorDeepToken-side faultYes, with backoff
    upstream_errorUpstream provider failureRetry only when the subtype and request semantics allow it
    quota_errorWallet, budget, or rate-limit signalTop up, adjust the budget, or wait for the window
    user_errorBad request, authentication, or permission failureFix the request

    Common codes

    • 401 invalid_api_key β€” key revoked or never existed
    • 403 model_not_allowed β€” your key's allowlist forbids the model
    • 403 ip_not_allowed β€” request IP is not in the key's allowlist
    • 402 org_wallet_empty β€” strict-mode org wallet has zero balance
    • 403 budget_limit_exceeded β€” project or API-key budget ceiling breached
    • 429 rate_limit_exceeded β€” request rate exceeded the configured window
    • 503 no_available_channel β€” no operational channel serves this model

    The gateway may route retryable upstream failures to another eligible channel. When an error reaches the client, inspect the HTTP status, error.code, category, and subtype before deciding to retry.

    When you should retry

    Retry 5xx platform_error responses with exponential backoff and jitter. Wait for the configured window after rate_limit_exceeded; adjust the budget or wait for its period after budget_limit_exceeded. Authentication, permission, model, and validation errors must be fixed before retrying.

    Previous

    Models

    Next

    Billing

    On this page

    • The envelope
    • Common codes
    • When you should retry