ClaudeStore/Docs
⚠ These docs are a work in progress. Some content may be inaccurate or temporarily AI-generated.

Streaming

Claude API streaming — real-time token-by-token responses. SSE format for both Anthropic and OpenAI-compatible endpoints.

Enable: stream: true. Format: Server-Sent Events (text/event-stream). Anthropic events: message_start, content_block_delta, message_stop. OpenAI events: choices[].delta.content chunks ending with [DONE].

Anthropic Streaming

Set "stream": true in your request body. The response uses Server-Sent Events (SSE):

Streaming Requestbash
curl https://api2.claudestore.store/v1/messages \
  -H "x-api-key: YOUR_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-sonnet-4.6",
    "max_tokens": 1024,
    "stream": true,
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Event Types

SSE Eventstext
event: message_start
data: {"type":"message_start","message":{"id":"msg_...","type":"message","role":"assistant","content":[],"model":"claude-sonnet-4.6"}}

event: content_block_start
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hello"}}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"! How can I help?"}}

event: content_block_stop
data: {"type":"content_block_stop","index":0}

event: message_stop
data: {"type":"message_stop"}

OpenAI-Compatible Streaming

Set "stream": true in the Chat Completions request:

OpenAI Streaming Requestbash
curl https://api2.claudestore.store/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-sonnet-4.6",
    "stream": true,
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Event Format

SSE Eventstext
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null}]}

data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]}

data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"!"},"finish_reason":null}]}

data: {"id":"chatcmpl-...","object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}

data: [DONE]

The stream terminates with data: [DONE].

Ready to start?

Get API access to all Claude models in under 2 minutes.

View Plans