Errors and headers

Every status and code the gateway returns, and every header it reads or sets.

Errors

Errors use OpenAI's envelope, so an SDK parses them with the code path it already has. A different shape would turn a clean 402 into an unhandled exception.

StatusCodeMeaning
400invalid_request_errorThe body did not parse, or a field is out of range. OpenAI’s own code, so an SDK handles it with the path it already has.
401invalid_api_keyThe key is missing, malformed, revoked or disabled.
402insufficient_quotaNot enough credit to cover the request. Top up and retry.
402budget_exceededThis key has reached its monthly cap. Raise it, or use another key.
402plan_limit_exceededYour plan's allowance is used up, or you have as many of something as it permits. The message says which.
403model_unavailable_in_regionThe model is not available from the requesting region.
404model_not_foundNo such model id. Check /v1/models for the current catalogue.
404request_not_foundNo request with that id, when scoring one.
400security_check_failedA security check found something high severity, in block mode: prompt injection, a card number, an IBAN or an API key. The message names the kinds. Nothing was sent to a provider and nothing was charged.
413request_too_largeThe request body is larger than the gateway accepts.
429rate_limit_exceededToo many requests on this key: too many at once, or too many requests or tokens in the last minute. retry-after says how long to wait.
502provider_unavailableNo usable provider for that model, and no fallback succeeded.
502upstream_errorThe provider answered with an error we could not translate into anything more useful.

Two of these are 402 and mean different things. A budget is a cap you set and can raise; a plan limit is answered by upgrading. The message says which.

Request headers

HeaderMeaning
AuthorizationrequiredBearer vk_live_… Your gateway key.
x-vatan-prop-<name>optionalAn attribution tag. Up to 16 per request; values over 256 characters are truncated.
x-vatan-cacheoptionalSeconds to allow a cached response for this exact request. Omit for no caching.
x-vatan-session-idoptionalGroups this request into a conversation.
x-vatan-session-nameoptionalA label for that conversation. The first request to name one wins.
x-vatan-user-idoptionalYour own identifier for the person this request is for. Opaque to us.
x-vatan-promptoptionalA stored prompt this request came from, as name or name@version.
x-vatan-securityoptionaloff, flag or block for this request, overriding the organisation's default. An unrecognised value falls back to that default rather than to off.

Response headers

HeaderMeaning
x-vatan-request-idThis request's id. Post it to /v1/feedback to score the answer.
x-vatan-modelThe model that actually served it, which differs from the one you asked for when a fallback was used.
x-vatan-cacheHIT or MISS. Only present when you sent x-vatan-cache.
retry-afterSeconds to wait, on a 429.