What problem does it solve? Building an Anthropic-compatible gateway for Claude Code requires emitting the exact SSE event sequence (message_start, content_block_delta, message_delta, message_stop) that the client expects; missing or malformed events cause Claude Code to treat the stream as broken and fall back or fail. ## Core Features & Use Cases - Canonical Event Sequencing: Defines the required order of message_start, content_block_start/delta/stop, message_delta, and message_stop frames for text, tool_use, and thinking blocks. - Tool Use Streaming: Specifies how to stream tool calls via input_json_delta partial_json chunks and set stop_reason to tool_use so the client can execute tools and continue the loop. - Fallback & Bad-Stream Rules: Documents when Claude Code falls back to stream:false and which conditions (empty streams, missing message_start, timeouts, 404s) are treated as broken streams. - Use Case: You are adding a /v1/messages endpoint to an OpenAI-compatible proxy and need it to work with Claude Code; follow this Skill to emit correct Anthropic wire-format events and a consistent non-streaming JSON fallback. ## Quick Start Ask the AI to implement the /v1/messages streaming endpoint for the gateway following the claude-code-api-streaming event sequence and wire format reference.