# Bring your own Anthropic key

> Add your sk-ant key once. Claude models then run on your Anthropic plan and limits, billing stays on your Anthropic account, and one AnyRouter endpoint can fall back to other models.

Your Anthropic plan, one endpoint

**Slug**: `byok-anthropic`  
**URL**: https://anyrouter.dev/use-cases/byok-anthropic  
**Markdown**: https://anyrouter.dev/use-cases/byok-anthropic.md  
**Short link**: https://anyrouter.dev/u/byok-anthropic  

## Why use this

You already pay Anthropic, and your plan has its own limits and billing. Add that key to AnyRouter and keep one endpoint and one API for every tool, with other models ready if Claude is busy or you hit a limit.

## Set it up

1. Open Dashboard → BYOK → Add key.
2. Pick Anthropic and paste your sk-ant-… key.
3. Press Test key. It checks the key and the models you picked.
4. Save the key.
5. Call anthropic/claude-… models with your AnyRouter key, from curl or from Claude Code with anyr claude.

## Code

### curl · anthropic/claude-sonnet-4-6

```bash
curl https://anyrouter.dev/api/v1/chat/completions \
  -H "Authorization: Bearer $ANYROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-4-6",
    "messages": [{ "role": "user", "content": "Say hello in one sentence." }]
  }'
```

### Claude Code · anyr claude

```bash
curl -fsSL https://anyr.dev/cli.sh | bash
anyr claude --model anthropic/claude-sonnet-4-6
```

## Notes

- Your key is encrypted at rest and used only to route your own requests.
- Test key makes a tiny call to Anthropic for each model you picked. Nothing is saved until you press Add key.
- A key that has not passed a test is saved paused and does not route.
- To turn a key off, open the Anthropic key list on the BYOK page and switch the key to Off. Traffic moves to your other keys or to AnyRouter credits.
- To remove a key, open the same list and use the trash icon. The key is deleted for good.

## Related

- [byok](https://anyrouter.dev/use-cases/byok)
- [claude-code](https://anyrouter.dev/use-cases/claude-code)
- [agent-fallback](https://anyrouter.dev/use-cases/agent-fallback)
