Model Rover

Authentication and Errors

Authenticate requests, inspect response headers, and handle stable gateway errors.

API key authentication

Create a key in Token Management and keep it in server-side secret storage. The same sk- platform key supports all public protocol dialects.

Header or query parameterRecommended for
Authorization: Bearer $API_KEYOpenAI-compatible and model-native APIs
x-api-key: $API_KEYAnthropic SDKs
x-goog-api-key: $API_KEYGemini SDKs
?key=$API_KEYGemini clients that cannot set headers

Prefer headers. Query parameters can be retained in browser history, proxy logs, and analytics. Never expose a platform API key in public client-side code.

Authorization: Bearer sk-...
Content-Type: application/json

The gateway accepts protocol version headers such as anthropic-version, but the platform controls the version sent to upstream providers.

Response headers

HeaderMeaning
x-request-idStable request ID for logs, billing investigation, and support. Present on business responses.
x-dropped-paramsFields omitted during cross-protocol conversion because no safe equivalent exists.
Retry-AfterSuggested delay for rate or capacity responses when available.
Access-Control-Expose-HeadersMakes the request ID and configured aliases readable to browser clients.

All /v1/** paths support CORS. A successful preflight does not authenticate the later model request.

Request limits

Request kindDefault body limit
Chat and embeddings32 MiB
Images100 MiB
Video tasks50 MiB

A deployment can configure different limits. A body rejected at the transport boundary returns 413 request_too_large and the active limit in the message.

Platform-managed fields

The following controls do not select public gateway behavior:

  • provider, routing, and route are always rejected when present with a non-null value.
  • Paid or priority service tiers are managed by the platform. Neutral values such as auto, default, or standard can be accepted and removed before forwarding; paid-tier selections are rejected.
  • Idempotency-Key is rejected on model-call POST requests. It must not be interpreted as duplicate-call protection.

Error envelopes

The HTTP status retains its normal meaning. The JSON shape follows the endpoint dialect.

{
  "error": {
    "message": "model not found: vendor/model",
    "type": "invalid_request_error",
    "param": null,
    "code": "model_not_found"
  }
}

HTTP statuses

StatusMeaningTypical gateway codes
400Invalid shape, unsupported field, stateful feature, or capabilityinvalid_request, stateful_not_supported, capability_unsupported
401Missing, invalid, disabled, or expired API keyinvalid_api_key, api_key_disabled, api_key_expired
402Available balance is insufficientinsufficient_balance
404Model, task, or endpoint does not existmodel_not_found, task_not_found
413Request body exceeds the active limitrequest_too_large
429RPM, TPM, API-key, or concurrency limitrate_limited, tpm_request_too_large, concurrency_limited
502504No usable channel, upstream failure, or timeoutno_available_channel, all_channels_failed, upstream_error, upstream_timeout
503Gateway or wallet state is warming, or channels are at capacityservice_warming, wallet_warming, channel_capacity_exhausted

Other stable codes include api_key_limit_exceeded, wallet_disabled, content_policy, config_error, stream_broken, stream_idle_timeout, balance_truncated, task_expired, and internal_error.

Retry rules

Read-only GET requests can be retried with bounded exponential backoff. For 429 and capacity responses, honor Retry-After when present.

Do not automatically retry a model-creation POST after an ambiguous disconnect or timeout: the upstream may already have accepted billable work. Streaming clients should preserve received output and distinguish a normal terminal event from a broken or balance-truncated stream. For asynchronous delivery, follow the dedicated task and callback rules.

Help us improve this page

Found something unclear, outdated, or incorrect?

Last updated on