What problem does it solve? Building an OpenAI-compatible or Anthropic-compatible gateway that accepts Claude Code traffic requires handling many message shapes: string or array content, tool_use/tool_result pairing, images, documents, thinking blocks, and cache_control extensions. This Skill guides the implementation of tolerant server-side parsing for the /v1/messages endpoint so requests do not fail on recoverable structural variations. ## Core Features & Use Cases - Content Block Compatibility: Parse and forward text, tool_use, tool_result, image, document, thinking, redacted_thinking, server_tool_use, and cache_edits blocks in both user and assistant messages. - Tolerant Tool Pairing: Match tool_result.tool_use_id with tool_use.id, and degrade gracefully on orphaned tool_results or missing results instead of returning 500 errors. - System Prompt Handling: Accept system as a string or an array of text blocks, ignoring cache_control when prompt caching is unsupported while preserving the text. - Use Case: You are building a proxy that forwards Claude Code requests to an upstream model. Use this Skill to implement request validation that ignores unknown extension fields, converts unsupported media to explicit 400 errors or text placeholders, and keeps tool-call chains intact for the upstream model. ## Quick Start Use this Skill to implement tolerant /v1/messages request parsing for my Claude Code gateway, including tool_use and tool_result pairing and graceful handling of unknown fields.