
Run Claude Code on any model
Anthropic's official CLI agent - launch through AntSeed with antseed claude.
Claude Code is the official CLI coding agent from Anthropic. It speaks the Anthropic Messages API natively, so it slots into AntSeed through the antseed claude wrapper or by pointing ANTHROPIC_BASE_URL at your local proxy.
antseed claude resolves the active buyer proxy, sets the placeholder Anthropic API key for the child process, and forwards the rest of your Claude Code flags unchanged. Manual environment variables still work if you want to run claude directly.
No real Anthropic API key is needed - the AntSeed proxy authenticates each request with your local identity (ANTSEED_IDENTITY_HEX) and settles payments on-chain. The ANTHROPIC_API_KEY value is required by the Anthropic SDK only as a non-empty placeholder.
When Claude Code calls the Messages API, the proxy forwards the request to the peer you pinned in step 3 of the setup above. Whichever service ids that peer advertises (visible in antseed network peer <peerId>) become the valid --model values.
Run AntSeed first
Every integration assumes a buyer proxy at http://localhost:8377. One-time setup, ~2 minutes.
Step 1
Install Claude Code
- Install Claude Code globallynpm install -g @anthropic-ai/claude-code
- Verify it runsclaude --versionExample output1.4.2 (Claude Code)
Step 2
Point Claude Code at AntSeed
Recommended: the wrapper reads the active buyer proxy from buyer.state.json or config, sets ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY for Claude Code, and forwards extra Claude args. Add --antseed-base-url http://host:port only when your proxy is somewhere else. To route to a specific peer, prefix the model with its peer id: antseed claude --model <peerId>@kimi-k2.6.
| ANTHROPIC_BASE_URL | http://localhost:8377 |
| ANTHROPIC_API_KEY | antseed |
Show as shell exports
Manual equivalent if you want to run claude directly instead of through antseed claude.
Step 3
Pick a model
antseed claude --model <service-id> passes the value to Claude Code unchanged. The valid set is whatever your pinned peer advertises - see the discovery commands below. You can also route to a specific peer per session with --model <peerId>@<service-id>.
The exact list of models depends on which peer you pin. Run antseed network browse or open the live network page to see what's available right now.
Verify
Test it
- See which models your pinned peer offerscurl -s http://localhost:8377/v1/models | jq '.data[].id'Example response"deepseek-v4-flash" "gpt-oss-120b" "kimi-k2.6" "minimax-m2.7"
These are the only ids that work with
--model. To switch peers, runantseed network browse, thenantseed buyer connection set --peer <peerId>and re-check this list. - Start a Claude Code session through the wrapperantseed claude --model kimi-k2.6
Manual equivalent after exporting the env vars above:
claude --model kimi-k2.6. To pin a specific peer for the session:antseed claude --model <peerId>@kimi-k2.6.
How Claude Code talks to AntSeed
- Wire format sent by Claude Code:
Anthropic Messages(hits/v1/messageson the buyer proxy) - Best-fit services: any service whose
protocolsarray containsanthropic-messages. That's what the peer advertises as natively-supported - zero translation overhead, no transform edge cases. - How to check a peer: run
antseed network peer <peerId> --jsonand look atproviderServiceApiProtocols[provider].services[service]. The browse command exposes the same field per peer. - What happens when protocols don't match: AntSeed's
@antseed/api-adaptertranslates between Anthropic Messages and the service's native protocol on the fly. So a request from Claude Code can still reach a service that only advertisesopenai-chat-completions- just with a small transform step. - One known caveat: services whose only advertised protocol is
openai-responsesrequire streaming. If Claude Code sends a non-streaming request and the proxy routes it to one of those services, the call fails withHTTP 400: Stream must be set to true. Pick a service whoseprotocolsincludesanthropic-messages(or another non-responses protocol) to avoid this.
If it goes wrong
Troubleshooting
- "invalid x-api-key" or 401 from Anthropic SDK
antseed claudesetsANTHROPIC_API_KEY=antseedfor you. If you runclaudedirectly, set the variable to any non-empty string; the proxy ignores the value. - Hangs forever on first messageNo peer is pinned. Run
antseed network browseto see peers, thenantseed buyer connection set --peer <peerId>. model_not_foundfor a model name you expected to workThe pinned peer doesn't advertise that service id. Check what it does offer withantseed network peer <peerId>(orcurl http://localhost:8377/v1/models). Pin a different peer if needed.- Want to confirm a request actually went through AntSeed (not Anthropic direct)After the request completes, run
antseed buyer metering- you'll see the channel for the peer Claude Code routed to, with token counts and the USDC settled.antseed buyer statusshows the snapshot (pinned peer, active-channel count, deposits).
Reference
Links
Same category