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
| Code | Meaning | When |
|---|---|---|
200 | OK | The request succeeded. |
400 | Invalid request | Malformed 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. |
401 | Unauthorized | --api-key is set and the request’s Authorization: Bearer / x-api-key header is missing or wrong. |
404 | No such endpoint | The path isn't one of the served routes. |
405 | Method not allowed | Wrong HTTP method for the route. |
413 | Payload too large | The request body exceeds the 16 MiB cap (a guard against a hostile Content-Length). |
503 | Service unavailable | The 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.