Connect Claude Code to Anoman AI
Route Claude Code and any Anthropic SDK client through Anoman using the Anthropic-compatible proxy endpoint. All guardrails apply to every request — including streaming completions and tool calls.
Prerequisites
- An Anoman AI account with an active API key
- Claude Code CLI installed (
npm install -g @anthropic-ai/claude-code) - Or: Python 3.9+ with
anthropicSDK installed
Anthropic-compatible endpoint
Claude Code uses the Anthropic Messages API format, not the OpenAI format. Anoman exposes a separate Anthropic-compatible endpoint at /anthropic. Use this endpoint — not the /v1 OpenAI endpoint — for Claude Code and the Anthropic Python SDK.
Step 1: Configure Claude Code CLI
Set two environment variables before launching Claude Code. The CLI reads these automatically.
Step 2: Python SDK configuration
Pass base_url when constructing the Anthropic client. The SDK sends all requests to the Anoman proxy, which applies guardrails before forwarding to Anthropic.
Streaming responses
Streaming works identically through the Anoman proxy. Guardrails run on the prompt before the stream opens.
When a guardrail triggers
If a request is blocked by the guardrail pipeline, Anoman returns a 403 before any content reaches Anthropic. The SDK surfaces this as an anthropic.APIStatusError.
Check docs/openapi/ for the current error schema.
Guardrail transparency headers
Every response from the Anoman proxy includes guardrail result headers. Inspect these in your logs to verify the pipeline is active.
Need help with your integration?
Join the Founding 50 for early access and direct support from the Anoman team.