Skip to content

Errors & status codes

Every failure returns a JSON error body with an appropriate status code, in the same shape the OpenAI and Anthropic clients expect.

Error shape

$ error
  {
    "error": {
      "message": "messages must not be empty",
      "type": "invalid_request_error"
    }
  }

Status codes

CodeMeaningWhen
200OKThe request succeeded.
400Invalid requestMalformed JSON, empty messages, a prompt that won’t encode, streaming on a path that doesn’t support it, an out-of-range logit_bias, or a JSON Schema or grammar dlm can’t honor.
401Unauthorized--api-key is set and the request’s Authorization: Bearer / x-api-key header is missing or wrong.
404No such endpointThe path isn't one of the served routes.
405Method not allowedWrong HTTP method for the route.
413Payload too largeThe request body exceeds the 16 MiB cap (a guard against a hostile Content-Length).
503Service unavailableThe server is past its connection cap, or a request waited longer than --queue-timeout for a batch slot. Carries Retry-After.

Auth applies to every route — including GET /metrics — except GET /, GET /health and GET /healthz, which stay open for liveness checks. See Deployment & security for auth setup and Troubleshooting for fixes.