API reference

Streaming

Set stream: true and the response arrives as server-sent events. Each protocol keeps its own event vocabulary, so an SDK that already parses OpenAI or Anthropic streams needs no changes.

Chat completions

A sequence of chat.completion.chunk objects, terminated by data: [DONE]. Answer text arrives on delta.content; when a reasoning model is thinking, that text arrives separately on delta.reasoning_content.

data: {"id":"chatcmpl_...","object":"chat.completion.chunk","choices":[{"delta":{"content":"Hel"}}]}

data: {"id":"chatcmpl_...","object":"chat.completion.chunk","choices":[{"delta":{"content":"lo"}}]}

data: [DONE]

Responses

Text arrives as response.output_text.delta events, finishing with response.completed.

Messages

The Anthropic sequence: message_start, then content_block_start and a run of content_block_delta events, then content_block_stop and message_stop. Thinking, when enabled, arrives as its own content block ahead of the answer.

curl
curl -N https://api.overagent.cc/v1/messages \
  -H "x-api-key: $OVERAGENT_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "max_tokens": 256,
    "stream": true,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Billing on a cancelled stream

Disconnecting mid-stream stops the generation. You are billed for the tokens produced up to that point, and the rest of the hold returns to your available balance — see Billing.