---
title: Set Up Claude Code with an API Key
description: "Configure Claude Code with an apiToken.sale key in two environment variables and run every Claude model on prepaid balance at up to 80% off."
url: https://apitoken.sale/docs/learn/claude-code-api-key
language: en
---

# Use Claude Code with an apiToken.sale key

Claude Code reads two environment variables. Point them at apiToken.sale and you keep every feature while billing against discounted prepaid balance.

## Two variables

```
export ANTHROPIC_BASE_URL=https://api.apitoken.sale
export ANTHROPIC_API_KEY=sk-pool-•••

# then just run
claude
```

That is the whole setup. Use claude-opus-4-8 for hard work and claude-sonnet-5 for everyday coding.

## Verify and choose a model

Run a small prompt first to confirm the key works, then set your default model. If Claude Code reports an auth error, re-check both environment variables and restart your shell so they are exported.

- Everyday coding: claude-sonnet-5.
- Hard refactors and long sessions: claude-opus-4-8.
- See per-request token usage in the dashboard to track spend.

## Frequently asked questions

### How do I point Claude Code at apiToken.sale?

Set ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY to your apiToken.sale endpoint and key, then run claude.

### Do I keep all Claude Code features?

Yes — only billing changes, from subscription to discounted prepaid usage.

---
Get a key: https://apitoken.sale/register
More guides: https://apitoken.sale/docs/learn
