anthropic package and change two lines in client
construction. System prompts, tool use, streaming events, and
cache_control blocks all pass through the gateway verbatim.
Base URL — host root, no
/v1. The Anthropic SDK appends
/v1/messages itself, so the base URL is
https://api.aireserve.com — unlike OpenAI-flavored clients,
which need the /v1 suffix.messages.create /
count_tokens convention, one dependency for every wire format:
ANTHROPIC_BASE_URL / ANTHROPIC_AUTH_TOKEN environment
variables. See the Claude Code recipe.
What carries over verbatim. System prompts, tool use
(
tool_use / tool_result blocks), streaming events
(message_start … message_stop), and
prompt caching — cache_control markers are
forwarded to Anthropic unchanged, with the same minimums and 5-minute lifetime. What
changes: the key and its environment variable, the base URL, and the model namespace —
/v1/messages answers for every gateway model, not just Claude.