Overview
Support Claude Code as a client of agentic-api, the way Codex is supported today. Claude Code speaks the Anthropic Messages API (/v1/messages), not Responses — so this is a new surface, but a stateless one: Claude Code sends the full conversation every turn, so the gateway holds no state (no storage, no rehydration, no persistence). Design doc and live-spike results: #98. Executes ROADMAP §4 Messages API.
What the gateway must implement
- Transparent
/v1/messages + /v1/messages/count_tokens proxy to vLLM.
- The Anthropic gateway protocol contract (forward
anthropic-* headers + error bodies unchanged, preserve the system attribution block, accept either auth header).
- A server-side tool loop that executes gateway-owned tools (
web_search, MCP) without exposing them to the client, mapping Anthropic tool_use/tool_result to the shared tool framework.
No storage layer. No previous_response_id analog. No stored-response object.
Spike findings (already settled, see #98)
Verified live against the real Claude Code CLI (2.1.208) + vLLM 0.25.1:
- Gateway-owned tools only work server-side. Claude Code executes every
tool_use against its own local registry and errors No such tool available on anything it didn't declare — it never waits for the gateway to supply a tool_result. Advertising a gateway tool to the client cannot work; the gateway must run the loop itself and surface only the final message.
- vLLM 0.25.1 accepts every advanced field Claude Code sends (
thinking adaptive/enabled, output_config, context_management, metadata) at HTTP 200, alone and combined — no field-level 400 hazard. Only real constraint is context-window sizing.
Stages
Overview
Support Claude Code as a client of
agentic-api, the way Codex is supported today. Claude Code speaks the Anthropic Messages API (/v1/messages), not Responses — so this is a new surface, but a stateless one: Claude Code sends the full conversation every turn, so the gateway holds no state (no storage, no rehydration, no persistence). Design doc and live-spike results: #98. Executes ROADMAP §4 Messages API.What the gateway must implement
/v1/messages+/v1/messages/count_tokensproxy to vLLM.anthropic-*headers + error bodies unchanged, preserve thesystemattribution block, accept either auth header).web_search, MCP) without exposing them to the client, mapping Anthropictool_use/tool_resultto the shared tool framework.No storage layer. No
previous_response_idanalog. No stored-response object.Spike findings (already settled, see #98)
Verified live against the real Claude Code CLI (2.1.208) + vLLM 0.25.1:
tool_useagainst its own local registry and errorsNo such tool availableon anything it didn't declare — it never waits for the gateway to supply atool_result. Advertising a gateway tool to the client cannot work; the gateway must run the loop itself and surface only the final message.thinkingadaptive/enabled,output_config,context_management,metadata) at HTTP 200, alone and combined — no field-level400hazard. Only real constraint is context-window sizing.Stages