Set-up guide · Claude Code
Set up Claude Code with your gift card
Five steps, about five minutes. You need your gift card code and the email it was sent to. Works on macOS, Linux and Windows (WSL). For a Qwen Code card, use the Qwen Code set-up guide instead.
1. Install Bun, Claude Code and qc
Bun runs the qc tool. Claude Code needs Node.js 18 or newer.
curl -fsSL https://bun.sh/install | bash
npm install -g @anthropic-ai/claude-code
mkdir -p ~/.local/bin
curl -fsSL https://modelgiftcard.com/download/qc -o ~/.local/bin/qc
chmod +x ~/.local/bin/qc
Make sure ~/.local/bin is on your PATH. Open a new terminal after installing Bun. qc keeps itself up to date: each time you run it, it checks for a new version and installs it.
2. Point qc at this service
curl -fsSL https://modelgiftcard.com/qc-config.json -o /tmp/qc-config.json
qc configure --file /tmp/qc-config.json
The file holds public addresses only: the API, the model endpoint and the sign-in app. No secrets.
Also have a Qwen Code card? Claude Code and Qwen Code cards are separate accounts. Keep them apart by running every qc command for Claude Code with QC_HOME=~/.qc-claude in front, for example QC_HOME=~/.qc-claude qc balance, or put export QC_HOME=~/.qc-claude in a shell you use for Claude Code.
3. Sign in
qc login --env main
Use the email the gift card was sent to. --env main signs you in to an environment named main (pick any name; without it, qc asks). Each environment has its own sign-in and its own Claude Code folder, ~/.claude-<name>. qc writes Claude Code settings only there, so your usual ~/.claude and any Claude subscription stay untouched.
- New account: use the temporary password from the "Your Claude Code credits account" email. You then choose your own: 12 or more characters with upper case, lower case, a number and a symbol. The temporary password works for 7 days.
- Existing account: use your password. Forgot it?
qc reset-password.
4. Redeem your code
qc redeem QC-XXXX-XXXX-XXXX-XXXX
qc balance
Upper or lower case, with or without dashes. A code works once. Redeem several to add them up.
5. Connect Claude Code and start
qc key create --write-settings
CLAUDE_CONFIG_DIR=~/.claude-main claude
This writes your API key, the endpoint and the model to ~/.claude-main/settings.json. Every model choice in Claude Code (Opus, Sonnet, Haiku and subagents) is set to Claude Sonnet 4.6, the model your card pays for. Claude Code does not need an Anthropic account this way. Keep the key private: anyone with it can spend your balance. Revoke it with qc key revoke <prefix>.
Tip: add alias claude-card='CLAUDE_CONFIG_DIR=~/.claude-main claude' to your shell profile.
Every day
| Task | Command |
|---|---|
| See your balance | qc balance |
| See recent charges | qc usage |
| Add another card | qc redeem <code> |
| List or revoke keys | qc key list, qc key revoke <prefix> |
| List or switch environments | qc env list, qc env switch <name> |
| Sign out | qc logout |
When the balance runs out, Claude Code shows a billing error. Buy another card and redeem it to continue.
Stuck? See help or email support@modelgiftcard.com.