# Run Claude Code on free models

> Point Claude Code at anyrouter/free and it codes on whichever free model is answering, with no credit deduction.

Code on any free model that answers

**Slug**: `claude-code-free-models`  
**URL**: https://anyrouter.dev/use-cases/claude-code-free-models  
**Markdown**: https://anyrouter.dev/use-cases/claude-code-free-models.md  
**Short link**: https://anyrouter.dev/u/claude-code-free-models  

## Why use this

Trying a coding agent on a hobby repo should not need a big bill. Go costs $2/mo, or nothing with one donated key, and gives you a free model that fails over with no daily cap.

## Set it up

1. Install the anyr CLI and sign in. Free models unlock with a $5 top-up, Go or higher, or one donated working provider key.
2. Run anyr claude --model anyrouter/free. Requests do not deduct credits.
3. Switch to anyrouter/auto or a pinned model when a task needs more. Paid models use credits.

## Code

### anyr CLI

```bash
curl -fsSL https://anyrouter.dev/cli.sh | bash
anyr claude --model anyrouter/free
```

### Env wrapper

```bash
export ANTHROPIC_BASE_URL="https://anyrouter.dev/api"
export ANTHROPIC_API_KEY="$ANYROUTER_API_KEY"
claude --model anyrouter/free
```

## Related

- [claude-code](https://anyrouter.dev/use-cases/claude-code)
- [go-plan](https://anyrouter.dev/use-cases/go-plan)
- [virtual-presets](https://anyrouter.dev/use-cases/virtual-presets)
