Paper Instruments
Ultramarine API

Errors

Error fields, status codes, and retries.

Errors use the OpenAI envelope. Messages uses the Anthropic envelope. Read error.param for the invalid field. Include error.request_id in support requests:

{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_value",
    "message": "reasoning_effort must be low, high, or max.",
    "param": "reasoning_effort",
    "request_id": "req_01J..."
  }
}

Status codes

StatusCode examplesAction
400 / 422invalid_value, unsupported_parameter, invalid_json, missing_required_parameter, invalid_requestFix the request.
401invalid_api_key, missing_api_keyCheck the key and environment.
403billing_account_suspendedContact Paper Instruments.
404model_not_found, resource_missing, response_not_foundCheck the model or resource ID.
429rate_limit_exceeded, concurrency_limit_exceededWait for retry-after; reduce output limits or concurrency.
429insufficient_quotaAdd funds or check your organization's monthly token budget.
502upstream_errorRetry with backoff.
503no_capacity, admission_unavailable, accounting_unavailableRetry with backoff.

Retries

Honor retry-after and x-should-retry: false. Quota errors carry x-should-retry: false. Use exponential backoff with jitter and a retry limit.

Retried requests may incur additional charges.

Handle stream errors after HTTP 200. Chat Completions ends successful streams with [DONE]; Responses uses terminal response events; Messages ends with message_stop.

Responses include x-request-id; errors also include it in the body.

On this page