Compat
Create chat completion
Chat completion on the OpenRouter-compatible /api/v1 base. The same engine as POST /v1/chat/completions, with OpenRouter’s error envelope.
Authorizations
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/jsonMoney plane, ozk_ auth. Transparent proxy to inference-gateway — any OpenAI-compatible field is passed through untouched; the fields below are the ones Phase 2 routing adds on top.
Example: "openai/gpt-4o-mini"
Available options: price, latency, throughput
Default: false
Example: 16
Response
Completion (model = the slug that actually served it, not necessarily the one requested). stream:true returns text/event-stream instead — see the developer guide for the streaming caveat.
application/jsontext/event-stream
Response headers
invalid_json — body is not valid JSON; invalid_request_error — the gateway rejected the request (a missing or malformed field)
application/json
Missing or invalid API key
application/json
byok_required — this provider needs your own connected key on this plan
application/json
model_not_allowed (routing candidates excluded by an allow-list) or content_blocked (prompt matched a guardrail regex)
application/json
preset_not_found — @preset/<slug> does not exist or is inactive; model_not_found — no such model in the catalog
application/json
method_not_allowed — the path serves one method: the Allow header names it, plus OPTIONS
application/json
Response headers
rate_limit_exceeded (per-key/per-provider) or spend_cap_exceeded (guardrail cap reached)
application/json