Skip to main content
When the gateway itself cannot forward your request, it returns a JSON error body. Provider errors are sanitized and forwarded in the same shape.

Error body shape

Error codes

Provider errors

When the provider itself returns an error (e.g. 400 from OpenAI for an invalid model), the gateway sanitizes the response body — stripping any credential echoes — and forwards it in the same { error: { message, type, param, code } } shape with type: "provider_error". The HTTP status code from the provider is preserved.