Planck-Authauthenticates the request to Planck.x-api-keyauthenticates the request to Anthropic.
For provider-independent routing with an Anthropic-style request, use the
mapped
POST /v1/messages route instead.Stream with the Anthropic SDK
Event lifecycle
Native Anthropic streams use named SSE events rather than OpenAIchat.completion.chunk objects.
message_startopens the message and includes initial usage.content_block_startopens a text, thinking, or tool-use block.- One or more
content_block_deltaevents add content to that block. content_block_stopcloses the block.message_deltaupdates message-level fields such as the stop reason and cumulative usage.message_stopcloses the message.
ping events can appear anywhere between those events.
Native SSE response
Text, thinking, and tool deltas
Inspect the deltatype instead of assuming every content event contains text.
Tool arguments in
input_json_delta are partial JSON strings. They follow the same rule as streamed OpenAI tool calls: accumulate first, parse once the block is complete.
Errors and forward compatibility
An error can arrive after the HTTP stream has started:Error event
error events even when the HTTP response began with 200. Ignore unknown event types safely; Anthropic can add event types over time without changing the API version.
Choose the right route
Native Anthropic reference
Review authentication and native path behavior.
OpenAI-compatible streaming
Stream across supported providers with Chat Completions.