Skip to main content
abliteration.ai returns HTTP status codes with an error body that matches the upstream API’s shape — OpenAI shape on /v1/chat/completions and /v1/responses, Anthropic shape on /v1/messages.

OpenAI shape

{
  "error": {
    "message": "Invalid API key",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_api_key"
  }
}

Anthropic shape

{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "Invalid API key",
    "code": "invalid_api_key"
  }
}

Anthropic streaming error frame

When a stream fails mid-flight, the server emits an event: error SSE frame:
event: error
data: {"type": "error", "error": {"type": "api_error", "message": "..."}}
The stream then closes. Accumulate content defensively — a partial response is valid.

Status codes

StatusCauseFix
400Invalid request body, unsupported model, mixed tools + web_search_optionsCheck request shape
401Missing or invalid API keySend Authorization: Bearer $ABLIT_KEY
402Insufficient creditsTop up in the console
403Key lacks permission for this projectScope check in the console
422Upstream model rejected the payloadOften a malformed multi-turn replay — see known limitations
429Rate limitedBack off, honor Retry-After. See rate limits
5xxUpstream failureRetry with exponential backoff

Policy-blocked requests

On /policy/* endpoints, a policy decision rides alongside the normal response. When enforcement_action: block fires in enforced mode, the status is 4xx and the body includes the upstream-shape error plus a policy object describing the decision. When the action is rewrite or summarize (decision rewrite / summary), the status stays 200 but the content is modified. See policy endpoints and streaming policy metadata.