GatewayDocsOpen workspace ↗
Developer preview · Synthetic data only Launch status ↗
Documentation/API reference

Errors & troubleshooting

Handle failures by error code and dispatch outcome, not by status alone.

Error format

json
{
  "error": {
    "code": "model_not_allowed",
    "message": "This key is not permitted to use this model."
  }
}

Error messages are sanitized and do not forward the provider’s raw error body. Use the stable error.code for handling logic. Not every denial has a generation ID, but every HTTP response has X-Request-ID.

Error reference

HTTPCodeAction
400unsupported_parameterRemove unsupported fields such as tools, provider routing, or response_format.
400invalid_messagesSupply 1–64 valid text messages with supported roles.
400invalid_max_tokens / invalid_temperatureUse values within the documented and model-specific bounds.
400input_too_largeShorten the messages; the gateway uses a conservative byte-based bound.
400invalid_idempotency_keyUse 1–100 ASCII letters, digits, hyphens, or underscores.
401invalid_api_keyCheck the environment, full key value, and key status.
402insufficient_credits / key_budget_exceededCheck available balance, pending holds, and key limit; reduce max_tokens if appropriate.
402staging_spend_limitThe aggregate internal test budget is exhausted or reserved.
403model_not_approved / model_not_allowed / model_unavailableChoose a configured, accessible model; unavailable aliases cannot be bypassed.
403healthcare_policy_deniedInspect workspace healthcare controls and the safe error message.
403onboarding_requiredComplete the current live account onboarding before usage.
409request_already_submitted / idempotency_conflictReconcile the original request. Do not assume a duplicate returns the original text.
413body_too_largeKeep the JSON body within 4 MiB for completions (256 KiB for dashboard APIs).
415content_typeSend Content-Type: application/json.
422sensitive_output_patternSynthetic-mode output was withheld after an identifier pattern; completed usage remains charged.
429rate_limitPause dispatch and retry later with bounded backoff and the same logical request ID.
502provider_rejectedKnown upstream rejection; the reserved credits were released.
502provider_outcome_unknown / invalid_provider_usageOutcome or accounting needs review. Credits remain reserved; avoid an automatic new request.
500internal_errorKeep the X-Request-ID and inspect activity before resubmitting.

Safe troubleshooting

  1. Record the HTTP status, error code, request IDs, model alias, and timestamp.
  2. Check the key’s model permissions, balance, held credits, and Activity entry.
  3. For healthcare denials, review the account and route status; do not downgrade the data label or change providers to evade a failed policy.
  4. For uncertain outcomes, keep the original idempotency key and follow reconciliation guidance.

Never send raw keys, prompts, patient details, or responses in a troubleshooting report. There is no published support SLA or public incident-status endpoint yet.

Search documentation

Search all 25 guides and references.