How to use Claude Haiku 4.5 in Claude Code
Claude Haiku 4.5 is Anthropic's fast, low-cost model — a strong fit for the high-frequency, lower-stakes work that fills a coding session: scaffolding, quick edits, test stubs, commit messages, and routine refactors. This guide shows how to run it inside Claude Code through AnyModel, so you keep the same CLI while paying Haiku-tier prices.
Why Haiku 4.5 in Claude Code
Claude Code is built for an agentic loop: read files, edit, run, repeat. Haiku 4.5 keeps that loop snappy because it responds quickly and costs far less than the Opus and Sonnet tiers. The tradeoff is intelligence — for deep architectural reasoning or tricky debugging you'll want a heavier model. The good news with AnyModel is that switching between them is a one-token change, so you can use Haiku for the routine 80% and escalate only when needed.
Quick facts for Claude Haiku 4.5:
| Property | Value |
|---|---|
| Model ID | claude-haiku-4-5 |
| Context window | 200K tokens |
| Max output | 64K tokens |
| Price (input / output) | $1.00 / $5.00 per 1M tokens |
One unified endpoint
AnyModel exposes a single OpenAI-compatible endpoint at https://anymodel.org/v1. One API key reaches every model on the platform — GPT, Claude, Gemini, DeepSeek, GLM, Kimi, Qwen, and Grok. Switching model means changing the model id and nothing else: no new keys, no new base URLs, no per-provider SDKs.
You start free: 1,000,000 tokens on signup, rising to a total of 6,000,000 if you link Telegram — no credit card required. After that it's pay-per-token with no subscription and no minimums, which suits the bursty, unpredictable usage pattern of a coding agent.
Install in one line
Claude Code is one of the tools AnyModel supports with a one-line installer. Run this with your AnyModel key in place of <YOUR_API_KEY>:
bash <(curl -fsSL "https://anymodel.org/i?tool=claude") <YOUR_API_KEY>
The script points Claude Code at the AnyModel endpoint and stores your key, so the CLI behaves exactly as it normally would — only now every request flows through the unified gateway.
Select Haiku 4.5
Once installed, set Claude Code to use Haiku 4.5. Inside the CLI you can switch models with the /model command and enter the id directly:
/model claude-haiku-4-5
That's the entire change. The next request runs on Haiku. To move a heavier task onto a stronger model, run /model again with a different id — for example a Claude Sonnet or Opus id, or even a non-Claude model — without touching your key or config. If you'd like to see how Haiku stacks up against other options on speed and price before you commit, the compare view lays them side by side.
A practical workflow
A pattern that works well in day-to-day development:
- Default to Haiku 4.5 for file navigation, small edits, boilerplate, and test scaffolding. Its speed keeps the agent loop tight and the cost negligible.
- Escalate to a larger model when you hit a genuinely hard problem — a subtle concurrency bug, a cross-cutting refactor, or a design decision that needs careful reasoning.
- Drop back to Haiku once the hard part is solved and you're back to mechanical follow-up work.
Because every model shares one key and one endpoint, this back-and-forth costs you nothing in setup overhead. The 200K context window is comfortable for most single-repo tasks, though very large codebases may need you to scope what you load into context.
A note on privacy
If you work with sensitive code, AnyModel offers Ghost Mode: opt-in, zero-retention API keys where your prompts and responses are not stored on our side — only a token counter is kept for billing. Be clear-eyed about the boundary, though: the underlying model provider still receives your prompt to generate a response. Ghost Mode controls what AnyModel retains, not what the provider sees, so it is not "100% privacy" — it's a meaningful reduction in where your data lingers.
Other editors
Claude Code, Codex, OpenCode, and Hermes have the one-line installer. For other clients — Cursor, Windsurf, Zed, Cline, Aider, Continue, or the Gemini CLI — use a manual OpenAI-compatible setup instead: point the tool at base URL https://anymodel.org/v1 and paste your AnyModel key. The same claude-haiku-4-5 id works everywhere.
For more setup guides and model breakdowns, browse the blog.
Ready to try Haiku 4.5 in Claude Code? Create a free account and get your first million tokens — no card required.
AnyModel