Compat
Create message (Anthropic)
The Anthropic Messages API on the models plane: point an Anthropic SDK at `https://api.plungeai.com` with your `ozk_` key in `x-api-key`. Any model; `anthropic/*` gets your body as sent, every other model a translation.
Examples verified against code, not live (TI-78). Send the key as x-api-key (what the Anthropic SDKs send) or Authorization: Bearer; anthropic-version is accepted with any value. Errors wear Anthropic's envelope {type:'error', error:{type, message}, request_id}, on /v1/messages and /api/v1/messages alike.
Streaming (stream:true): message_start, then per content block content_block_start, content_block_delta (text_delta or input_json_delta) and content_block_stop, then message_delta (stop reason and usage) and message_stop. ping is the keepalive; a failure after the 200 ends the stream with an error event.
The anthropic-beta header is not forwarded upstream, so beta-gated features do not switch on. Responses carry text and tool_use blocks only.
Authorizations
Authorization: Bearer …. ozk_ key in the x-api-key header, as the Anthropic SDKs send it — POST /v1/messages only (Authorization: Bearer also works there and wins when both are sent). anthropic-version is accepted with any value.Authorization: Bearer ozk_…. ozk_ platform API key (Authorization: Bearer ozk_…)Authorization: Bearer sk-ocean-…. Legacy sk-ocean- inference key: still accepted on the money plane until the sk-ocean- sunset; new integrations use the ozk_ keyBody
application/jsonAnthropic Messages request (POST /v1/messages), any model slug. On an anthropic/* model the body is forwarded as sent, with only model (the upstream id) and max_tokens (the capped value) set by the gateway, so cache_control, thinking, documents and server tools reach Anthropic unchanged. On any other model it is translated to the chat-completions shape; blocks with no neutral form (thinking, server tools) are not sent. Gateway directives (models, fallbacks, sort, max_cost and OpenRouter's provider, route, transforms, plugins, usage, session_id) are consumed, never forwarded.
Example: "anthropic/claude-haiku-4-5"
Example: [{"role":"user","content":"Say hi in three words"}]
Option 1
Example: "text"
Option 1
Option 2
Example: 64
Default: false
Maximum array length: 3
Available options: price, latency, throughput
Response
An Anthropic message (model = the slug that actually served it). x-request-id and the x-ocean-* headers are kept. stream:true returns text/event-stream: message_start, then per block content_block_start / content_block_delta (text_delta, input_json_delta) / content_block_stop, then message_delta (stop_reason and usage) and message_stop; ping is the keepalive, and a failure after the 200 ends the stream with an error event.
application/jsontext/event-stream
Response headers
request_id in an error body.Example: "msg_0f3c…"
Available options: message
Available options: assistant
Available options: end_turn, max_tokens, stop_sequence, tool_use, pause_turn, refusal
invalid_request_error — invalid_json (body is not valid JSON), messages required, a role other than user/assistant, more than 3 fallbacks, or unsupported_service_tier
application/json
Available options: error
authentication_error — invalid_api_key: no x-api-key or Authorization: Bearer header, or not a valid key
application/json
Available options: error
billing_error — insufficient_balance (the wallet does not cover the request) or byok_required
application/json
Available options: error
permission_error — model_not_allowed (allow-list), content_blocked (guardrail) or an inactive account
application/json
Available options: error
not_found_error — model_not_found or preset_not_found
application/json
Available options: error
method_not_allowed — the path serves one method: the Allow header names it, plus OPTIONS
application/json
Response headers
rate_limit_error — rate_limit_exceeded, spend_cap_exceeded or insufficient_quota
application/json
Available options: error
api_error — every routing candidate failed
application/json
Available options: error
money_plane_unavailable — INFERENCE_GATEWAY_SERVICE not bound on this tier
application/json