Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.cogito.decart.ai/llms.txt

Use this file to discover all available pages before exploring further.

Cogito returns a single, deterministic error shape on every failure:
{
  "error": {
    "type": "invalid_request_error",
    "code": "model_not_found",
    "message": "Model 'foo' is not available.",
    "request_id": "req_..."
  }
}
Always log request_id. We trace it through the gateway, scheduler, and inference cluster. Support can pinpoint your request from this single ID.

Error types

TypeHTTPWhen
invalid_request_error400Malformed JSON, missing required field, invalid params
authentication_error401Missing / revoked API key
permission_denied403Key doesn’t have access to a model or feature
not_found404Unknown model slug, unknown fine-tune
rate_limit_exceeded429Token-aware rate limit hit; retry with backoff
insufficient_quota429Spend cap reached or balance exhausted
internal_server_error500Cogito problem; retry safe
service_unavailable503Inference cluster temporarily degraded; retry with backoff

Common codes

  • invalid_api_key — header missing or revoked
  • model_not_found — slug typo or model retired
  • context_length_exceeded — prompt + max_tokens exceeds the model’s window
  • spend_cap_reached — your monthly hard cap; raise it in dashboard
  • tokens_per_minute_exceeded — TPM rate limit; back off and retry
  • requests_per_minute_exceeded — RPM rate limit; back off and retry
  • invalid_response_format — JSON schema is malformed or impossible

Retry-after

429 and 503 responses include a Retry-After header (seconds). Honor it. Exponential backoff on top of Retry-After is fine; ignoring it will get you rate-limited harder.