Set-up guide

Set up Qwen 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).

1. Install Bun, Qwen Code and qc

Bun runs the qc tool. Qwen Code needs Node.js 20 or newer.

curl -fsSL https://bun.sh/install | bash
npm install -g @qwen-code/qwen-code@latest

mkdir -p ~/.local/bin
curl -fsSL https://qwengiftcards.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.

2. Point qc at this service

curl -fsSL https://qwengiftcards.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.

3. Sign in

qc login

Use the email the gift card was sent to.

  • New account: use the temporary password from the "Your Qwen 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 Qwen Code and start

qc key create --write-settings
qwen

This writes your API key, the endpoint and the model name to ~/.qwen/.env. Keep the key private: anyone with it can spend your balance. Revoke it with qc key revoke <prefix>.

Every day

TaskCommand
See your balanceqc balance
See recent chargesqc usage
Add another cardqc redeem <code>
List or revoke keysqc key list, qc key revoke <prefix>
Sign outqc logout

When the balance runs out, Qwen Code shows an insufficient credits error. Buy another card and redeem it to continue.

Stuck? See help or email support@qwengiftcards.com.