Troubleshooting
Start with the health endpoints, then check startup logs and request-level errors.
Health endpoints
All three endpoints are unauthenticated:
| Endpoint | Returns |
|---|---|
GET /api/health | Always 200. Includes status, services.database (SELECT 1), and services.redis (status, healthy, enabled; disabled when Redis is off). Also includes services.rate_limiting (informational, never degrades status): backend (redis for one shared window across the deployment, memory for one window per process, so N workers enforce N times the configured limit), shared, and disabled (rate_limit_disabled) |
GET /api/health/ready | 200 {"status":"ready"} when healthy, otherwise 503. Use this for orchestrator readiness probes |
GET /api/health/live | Always 200 {"status":"alive"}. Liveness only, with no dependency checks |
Startup failures
The process exits on misconfiguration instead of starting partially configured. Check the container or console logs for the error:
| Error | Cause / fix |
|---|---|
| Migration error on boot | Database unreachable, wrong credentials, or a failed migration. The port is never bound; fix the database and restart |
Could not find alembic.ini | alembic.ini is missing from the current working directory and repository root |
| Redis connection error at boot | REDIS_ENABLED=true but Redis is unreachable. Startup does not degrade silently |
Invalid TRUSTED_PROXIES CIDR | Fix the CIDR syntax; validated at startup |
| Settings validation error | Invalid numeric or range setting, such as DB_POOL_SIZE < 1 or REDIS_TIMEOUT <= 0 |
| Config validation error | A stored provider, model, or user record is invalid; the error message names the record |
Symptom → cause → fix
| Symptom | Cause | Fix |
|---|---|---|
401 authorization header missing / invalid authorization header format | No key sent, or Authorization does not use Bearer | Send Authorization: Bearer sk-… or x-api-key: sk-…. Console JWTs do not work on /v1/* |
429 too_many_auth_failures with Retry-After | API-key IP lockout is enabled (off by default) and this IP exceeded max_failed_api_key_attempts invalid keys | Wait out Retry-After and fix the key. Because lockout is per IP, one bad client blocks all traffic from that address (such as 127.0.0.1 locally). Disable it under Settings → Advanced → Security & Rate Limiting, toggle Disable Throttling, or restart to clear in-process counters |
403 model_not_allowed | Key or user allowlist excludes the model | Update the allowlist or use an allowed model. An empty allowlist denies all models |
404 model_not_found | Model name is not in the model mappings | Add the mapping or fix the name. Virtual models require smart routing to be enabled |
500 configuration_error mentioning a virtual model | auto/fast/best used while smart routing is disabled, or on a non-chat endpoint | Enable smart routing, or use a concrete model name |
429 rate_limit_exceeded | Per-key RPM cap or auth rate limit reached | Raise rate_limit_rpm or wait for the 60 s window to reset |
429 budget_exceeded / user_budget_exceeded | Key or account budget exhausted | Raise or reset the budget (account budgets can only be reset by an admin) |
413 body_size_exceeded | Request body exceeds max_request_body_size_bytes (64 MiB default) | Raise the limit or shrink the request |
499 client_disconnected in logs | The socket closed before the response finished: an SDK/browser read timeout, proxy_read_timeout in your reverse proxy, or a CDN 524 | Raise the client or proxy read timeout, keep response keepalive enabled, or use streaming for long calls. Closing after the last frame is logged as success |
| Response arrives as 200 with an error JSON body | Keepalive heartbeat mode had already committed HTTP 200 before the failure occurred | Expected tradeoff; inspect the response body and check the proxy logs for the underlying error. See Reverse Proxy & TLS |
| Browser reports a CORS failure instead of a real status | Auth, body-size, and rate-limit checks reject requests before CORS headers are added | Reproduce with curl to see the real status code, then fix the underlying error |
| Streaming request stalls with no data | Upstream is silent; the proxy is sending : keep-alive comment frames | Normal behavior. Disable response buffering in your reverse proxy if it buffers SSE |
Admin UI missing at / (API works) | frontend/dist did not exist at startup | Run uv run llm-proxy --build-frontend and restart |
Logs screen shows rows with {"_bodies_disabled": true} | Log Input/Output is off by default, so request/response bodies, upstream error bodies, and MCP/web-search payloads are omitted while metadata rows are still written | Enable Log Input/Output in Settings → Log Management. x-log-full: true has no effect while the master switch is off |
Logs screen shows {"_sampled_out": true} on some rows with body logging on | Body Sampling Rate is below 1.0, so that request was not sampled | Set Body Sampling Rate to 1.0, or send x-log-full: true on requests you want captured |
| Usage stats empty while logs exist | Usage and logs are recorded separately | Check the date range; usage records are pruned according to the log retention window |
503 redis_not_available on Responses endpoints | Redis is disabled, but stored responses require Redis | Enable Redis, or avoid the response-storage endpoints |
| MCP server refuses to start | Deny-by-default policy blocks commands or env vars not on the allowlist | Allowlist the exact command in Settings → General → MCP Security (see MCP Servers) |
MCP 403 Access denied to MCP server | Key allowlist excludes the server | Update the key's MCP allowlist |
| MCP returns 404 for an existing server | Server is stopped, disabled, or crashed at startup | Check status in the console; disable and re-enable to restart |
| MCP changes do not take effect | Updating a server does not restart a running instance | Disable and re-enable the server |
web_search tool calls return web_search_tool_result_error | Search backend is unreachable, rate-limited, or has an invalid key | The model still answers; check the Web Search log tab and backend configuration |
| Smart routing picks unexpected models | Classifier signals or mode weights | Review Settings → Advanced → Smart Routing; enable verbose_routing_logs and check per-request feedback |
| Claude Code warns the session "isn't eligible" for no-charge auto mode | The upstream does not support server-side auto-mode checks | See Claude Code auto mode below |
Claude Code auto mode
Claude Code (v2.1.278+) in auto mode asks the upstream to run safety checks by sending a safeguards request field and the dangerous-tool-use-2026-09-03 anthropic-beta value. The upstream must answer with a safeguard_results response field (for streaming, inside the terminal message_delta), keyed by tool-use id. When that is absent, Claude Code falls back to its own classifier (billed as token usage) and shows a notice on the first checked action.
Auto mode continues to work normally when this happens.
- Non-Anthropic upstreams (Ollama, vLLM, SGLang, and third-party Claude-compatible providers such as z.ai, Kimi, MiniMax, Moonshot, DeepSeek, and Qwen) do not implement server-side checks, so the notice is expected on those routes.
- Anthropic-format upstreams work when these fields pass through end to end. Native Anthropic passthrough forwards
safeguards,anthropic-beta, and all response keys verbatim; the converted path also preservessafeguard_results. - To silence the notice, set
CLAUDE_CODE_AUTO_MODE_SERVER=0in the environment where Claude Code starts.
To check the active state of a session, run /status in Claude Code and look at Auto mode server: Enabled means server-side checks are active, and Disabled means the session fell back to the client classifier.
Getting more detail
- Request id: every response includes
X-Request-Id, which you can search on the Logs screen. An inboundx-request-idis used for tracing and routing, while the response header always contains the server-generated id. - Application logs: set
LOG_LEVEL=DEBUG(requires restart) or pass--log-file. - Audit trail: admin actions and security events appear under Logs → Audit Logs, with Verify Integrity to check the hash chain.
- Provider failures: errors include the upstream status and message.
502indicates a provider, network, or parse failure;504indicates a timeout (upstream calls use a fixed 600 s read timeout and 10 s connect timeout; the providertimeoutfield is not applied).