Docs
API Reference

Errors

The two error shapes by surface, in-stream errors, and the full status code table

The API returns different error shapes depending on the surface you call. Match your handler to the surface.

OpenAI-style errors

The OpenAI-style endpoints (/v1/chat/completions, /v1/models, /v1/files, /v1/audio) return the OpenAI-canonical nested error object. OpenAI SDKs and gateways (Bifrost, LiteLLM) parse it as error.message out of the box.

{
  "error": {
    "message": "Invalid API key format.",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_api_key"
  }
}

The error.type and error.code follow the HTTP status.

Statuserror.typeerror.code
400, 403, 404, 413invalid_request_errornull
401invalid_request_errorinvalid_api_key
429rate_limit_errorrate_limit_exceeded
500+server_errornull

A request body that fails validation returns 400 with a single collapsed message ("messages: Field required"), the same as OpenAI. The request ID is on the X-Request-Id response header.

Talos-specific endpoints

Endpoints outside the OpenAI standard (for example /v1/audit) keep the flat legacy envelope:

{
  "error": "Audit rate limit exceeded.",
  "code": "HTTP_429",
  "request_id": "req_..."
}

In-stream errors

When an inference error happens mid-stream, the stream emits one error chunk and then closes with [DONE].

{
  "error": {
    "message": "inference backend unavailable",
    "type": "service_unavailable",
    "code": "inference_error"
  }
}
data: [DONE]

Anthropic-style errors

The Anthropic-style endpoints (messages and batches) return the Anthropic error shape.

{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "max_tokens is required"
  }
}

The error.type is mapped from the HTTP status.

Statuserror.type
400invalid_request_error
422invalid_request_error
401authentication_error
403permission_error
404not_found_error
413request_too_large
429rate_limit_error
500api_error
503overloaded_error
529overloaded_error

Status codes

CodeWhen it occurs
200Success
201Resource created (for example a file or batch)
204Success with no body (for example a delete)
400Malformed or invalid request
401Missing or invalid API key
403Key lacks permission, or 0 agent slots
404Unknown path or resource
413Request body exceeds the context cap
415Unsupported media type
422Request failed validation
429Rate limit, concurrency, slot, or budget exceeded
500Internal error
502Upstream gateway error
503Service unavailable. Carries Retry-After

Next