May 12, 20264 min readSetupClaude Opus 4.6Claude Code

How to use Claude Opus 4.6 in Claude Code

Claude Code is Anthropic's terminal-native coding agent, and Claude Opus 4.6 is the frontier model many developers want driving it for hard refactors, multi-file edits, and deep debugging. This guide shows you how to wire the two together through AnyModel — a single OpenAI-compatible gateway — so you can pay per token instead of committing to a subscription.

Why route Claude Code through AnyModel

AnyModel gives you one OpenAI-compatible endpoint and one API key that reaches every major model — Claude, GPT, Gemini, DeepSeek, GLM, Kimi, Qwen, and Grok. The base URL is https://anymodel.org/v1. Switching models means changing the model id in your request; nothing else moves.

That matters for Claude Code in two practical ways:

  • No subscription lock-in. You pay per token, with no minimums and no monthly fee.
  • One config, many models. Today you run Opus 4.6; tomorrow you can A/B it against another model in the same setup. Browse what's available on the models page or weigh trade-offs on the compare page.

You start with 1,000,000 free tokens on signup — and a total of 6,000,000 if you link Telegram — with no credit card required. That's enough to put Opus 4.6 through real work before spending a cent.

Step 1: Get your API key

Create an account and grab a key from your dashboard. If you want the larger free balance, link Telegram while you're there. Keep the key handy for the install step below.

Step 2: Install and point Claude Code at AnyModel

AnyModel ships a one-line installer for a small set of supported tools: codex, claude, opencode, and hermes. Since Claude Code is the claude tool, run:

bash <(curl -fsSL "https://anymodel.org/i?tool=claude") <YOUR_API_KEY>

Replace <YOUR_API_KEY> with the key from Step 1. The installer configures Claude Code to use the AnyModel base URL and your key, so you don't have to hand-edit environment variables.

If you also use other clients — Cursor, Windsurf, Zed, Cline, Aider, Continue, or Gemini CLI — those aren't covered by the one-liner. For them, do a manual OpenAI-compatible setup: set the base URL to https://anymodel.org/v1 and paste in your key.

Step 3: Select Claude Opus 4.6 as the model

Inside Claude Code, the model is chosen by its id. Because AnyModel is OpenAI-compatible, you select Opus 4.6 the same way you'd select any other model — by setting the model field to the Opus 4.6 id shown on the models page. If you ever want to test a cheaper model for routine edits and reserve Opus 4.6 for the hard problems, you just swap that one id.

A quick sanity check

Before kicking off a big task, confirm the connection with a plain HTTP call. This hits the same endpoint Claude Code uses:

curl https://anymodel.org/v1/chat/completions \
  -H "Authorization: Bearer $ANYMODEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-6",
    "messages": [{"role": "user", "content": "Say hello from Opus 4.6"}]
  }'

If you get a completion back, Claude Code will work too. (Confirm the exact model id against the models page — ids change as new versions ship.)

Getting the most out of Opus 4.6 in Claude Code

Goal Tip
Control cost Reserve Opus 4.6 for architecture and tricky bugs; route simple edits to a smaller model.
Better edits Let Claude Code read the relevant files first; Opus 4.6 reasons better with full context.
Track spend Watch your token usage in the dashboard — you only pay for what you send and receive.

A note on privacy

If your code is sensitive, enable Ghost Mode — an opt-in setting that uses zero-retention API keys, so AnyModel doesn't store your prompts or responses, only a token counter for billing. Be clear-eyed about what that means: the model provider still receives your prompt to generate a response, so this isn't "100% privacy." It removes AnyModel from the retention picture, not the provider. Details are on the Ghost Mode page.

Start building

Connecting Claude Opus 4.6 to Claude Code takes one command and one key — and your free tokens cover real work out of the gate. For more setup guides, see the blog.

Create your free AnyModel account and start coding with Opus 4.6 today.

Read next