Errors, Codes & Request ID
Every response from https://api.vanix.io—whether 200 OK or an error—includes a unique x-oneapi-request-id header for instant root-cause analysis.
HTTP Error Reference
| HTTP Status | Typical Cause | Safe to Retry? | Remediation |
|---|---|---|---|
400 Bad Request | Malformed JSON, unsupported parameter (e.g., temperature on strict reasoning model), or context length exceeded. | No | Validate payload schema against the protocol reference. |
401 Unauthorized | Missing, mistyped, disabled, or expired API key, or wrong auth header for the protocol. | No | Check key status in Console and confirm header (Bearer vs x-api-key vs x-goog-api-key). |
403 Forbidden | Model blocked by token allowlist, client IP outside allowlist, or invalid Host header. | No | Update token restrictions in Console → API Tokens. |
404 Not Found | Unknown route or wrong base URL (e.g., /v1/v1/chat/completions). | No | Verify base_url matches the Protocol Header Matrix. |
429 Too Many Requests | Token quota exhausted, insufficient account balance, or rate-limit window reached. | Backoff (if rate limit) | Top up balance, increase token quota cap, or apply jittered exponential backoff. |
500 / 502 / 503 / 504 | Transient upstream provider fault or timeout. | Yes | Retry up to 2–3 times with exponential backoff (1s → 2s → 4s). |
Tracing with x-oneapi-request-id
Always log the x-oneapi-request-id response header in your application error handler:
ts
const res = await fetch('https://api.vanix.io/v1/chat/completions', { /* ... */ })
const requestId = res.headers.get('x-oneapi-request-id')
if (!res.ok) {
console.error(`Vanix API error ${res.status} [request_id=${requestId}]`, await res.text())
}Paste the request_id into Console → Logs to inspect exact upstream latency, prompt/completion tokens, cache hits, and upstream error diagnostics.