
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 selects the highest-ranked eligible offer under the shared Price + Trust preferences. Stable session metadata gives the conversation soft affinity to the seller that actually served it, with failover when needed. Every model on the network (listed by GET /v1/models) is a valid --model value; prefix it with a peer id (<peerId>@<service-id>) only when you want to force a specific seller.
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 <model-id> passes the value to Claude Code unchanged. Use a model id returned by curl http://localhost:8377/v1/models. You can also route to a specific peer per session with --model <peerId>@<service-id>.
The full list is every model on the network. Run curl -s localhost:8377/v1/models, antseed network browse, or open the live network page to see what's available right now.
Verify
Test it
- List every model on the networkcurl -s http://localhost:8377/v1/models | jq '.data[].id'Example response"deepseek-v4-flash" "gpt-oss-120b" "kimi-k2.6" "minimax-m2.7"
Any id here works with
--model- the proxy applies the shared Price + Trust ranking and keeps soft conversation affinity after the first successful route. To force a specific seller, use--model <peerId>@<service-id>orantseed buyer connection set --peer <peerId>. - 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 messageWith a model set, no pin is needed. Check the proxy is running and has discovered peers:
antseed buyer statusandcurl -s localhost:8377/_antseed/status. If a stale session pin points at an offline peer, clear it withantseed buyer connection clear. model_not_foundfor a model name you expected to workNo policy-allowed peer on the network currently advertises that model. Check what is available withcurl http://localhost:8377/v1/models, then pick another model or adjust your buyer policy.- 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