For AI agents: a documentation index is available at https://docs.plungeai.com/llms.txt. Append .md to any page URL, or send Accept: text/markdown, to get markdown. Setup instructions for agents are at https://docs.plungeai.com/agents.md. Execution planes take an ozk_ key; the models plane takes an sk-ocean- key.

Documentation Index: fetch the complete documentation index at /llms.txt. Use this file to discover all available pages before exploring further.
POST/v1/chat/completions

Examples verified against code, not live (TI-78). The models plane takes an sk-ocean- key ($PLUNGE_MODEL_KEY); an ozk_ key answers 401 invalid_api_key. Errors carry error.code in the body, never an X-Error-Code header.

Authorizations

Authorizationstringheaderrequired
Bearer token: Authorization: Bearer sk-ocean-…. sk-ocean- inference key (money plane, forwarded downstream)

Body

application/json

Money plane, sk-ocean- 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.

modelstring
A single model slug ("provider/model", e.g. "anthropic/claude-sonnet-5"), or "@preset/<slug>" to expand a stored model+routing+params bundle (request-explicit fields below still override the preset). Ignored if models[] is set.
modelsstring[]
Ordered fallback candidates — alternative to model. One retry per candidate on 429/5xx/network, then failover to the next; a candidate whose provider just failed out is excluded for 30s.
sortenum<string>
Reorders models[] before the first attempt. latency/throughput sort by rolling provider stats; a provider with no history yet sorts last.

Available options: price, latency, throughput

messagesChatMessage[]required
streamboolean

Default: false

temperaturenumber
Set to exactly 0 to make the request response-cache eligible.
max_tokensinteger
top_pnumber

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/json
  • text/event-stream

Response headers

x-cacheenum<string>
"miss" or "hit" — present only when the org has response caching enabled and the request was cache-eligible (temperature:0, stream not true); absent otherwise.
x-request-idstringfrom code
Server-minted request id.
x-cachestringfrom code
miss or hit when the opt-in response cache is on.
idstringrequired
objectstringrequired
modelstringrequired
The model that served this response — bill and log both key on this value.
choicesobject[]required
usageobject

Stream events

EventDescription
chat.completion.chunkOne delta of the completion in choices[0].delta.
[DONE]End of the stream.
chat.completion.chunk
data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"hi"},"finish_reason":null}]}
[DONE]
data: [DONE]

Planned: TI-33

Search is not available yet. Until it ships, use the page index or browse the sidebar.

Planned: TI-34

The docs assistant is not available yet. You can hand these docs to your own assistant instead.