Skip to main content
The VLM Run Gateway returns OpenAI-compatible error bodies for most failure modes. Errors are wrapped in a detail object when returned by FastAPI:
Rate limit errors use a top-level error object instead (see Rate Limits).

HTTP status codes

Common errors

Capability violation (400)

Returned when the request content does not match the model’s declared capabilities. For example, sending a document_url to a model that only accepts images, or sending multiple images to a single-image OCR model.
Check each model’s capabilities on GET /v1/openai/models or the Models page before sending a request.

Invalid document (400)

Returned when a document_url points to a file that is not a valid PDF, exceeds size limits, or cannot be decoded.

Invalid media (400)

Returned when an image_url or a video_url points to a file the Gateway cannot decode: an unsupported container, a corrupt stream, a URL that does not resolve to media, or malformed base64. The Gateway returns a 400 with error.type = "invalid_request_error" and error.code = "invalid_media" rather than a 500. error.param names the offending content part.

Credits exhausted (402)

Returned when an authenticated caller’s organization has no credit left.

Model not found (404)

Returned when the model field does not match any registered model or alias. List available models with GET /v1/openai/models.

Rate limit exceeded (429)

Returned when a per-tier request quota is exhausted. Every public OpenAI route shares one budget per caller. See Rate Limits for bucket sizes and tier attribution.
Anonymous callers receive the message above and an X-VLMRun-Upgrade header. Authenticated callers receive Rate limit exceeded: <window>. Every 429 carries Retry-After, holding the longest exhausted window, so one wait of that length is enough. Retry after it elapses. A full request queue answers 429 too, with Retry-After: 60. The queue holds 128 waiting requests. That is capacity rather than quota, so the same call succeeds on retry.

Model unavailable (503)

Returned when the model’s deployment is not serving traffic, for example during a cold start. Retry-After carries the suggested wait, 30 seconds by default. This is distinct from the 504, which means the model accepted the request and then ran past the dispatch window.

Internal server error (500)

Uncaught exceptions return a sanitized body with no stack traces or internal paths. Every response includes an x-request-id header. On sanitized 500 errors, the same id is also returned as error.request_id in the JSON body. Include either value when contacting support@vlm.run.
You may send an x-request-id request header to supply your own correlation id; the Gateway echoes it on the response. When the header is omitted, the Gateway mints a new id.

Inference timeout (504)

Returned when the model does not return a response inside the Gateway’s dispatch window. The Gateway aborts the request after 270 seconds by default. That window is configurable per deployment, is subject to change, and is not a documented SLA.
The non-streaming path returns no partial result when the Gateway aborts the request. A timeout can happen when a model deployment is not yet serving traffic or is under heavy load. To reduce the chance of a timeout:
  • Retry after a short delay with exponential backoff.
  • Keep your client-side timeout above the Gateway’s dispatch window. An OpenAI SDK client with a low timeout= value can fail earlier with its own error.
  • Chunk the workload so each request carries a smaller payload.
  • Use stream=true so tokens arrive as the model produces them.
Capture the x-request-id response header and include it when contacting support@vlm.run.

Getting help

When reporting an issue, include:
  • The x-request-id response header (or error.request_id on sanitized 500 responses)
  • The HTTP status code and response body
  • The model value and content part types you sent
See also Rate Limits and the Chat Completions API reference for retry-relevant request parameters.