Setting Up Your API Key in Claude Code, Codex, OpenCode and Cline
From a redeem code to a coding tool that answers: activating your key, the settings file each app reads, and the mistakes that make a good key fail. You bought API credits and have a redeem code. This guide takes you from that code to a coding tool that answers, and lists the mistakes that make a good key fail. The exact settings, with your own key filled in, are on the Quick setup tab that opens from your order; here is what to do with them.
Before you start
An API key is not a sign-in. It does not open the Claude or ChatGPT websites or their apps. You paste it into a tool's API settings, together with a base URL. Ready settings exist for four tools: Claude Code, Codex, OpenCode and Cline (Roo Code takes the same). Any other app that lets you set an API key and a base URL works too, through the Guide tab. A dollar plan works in the tools of its own format. A Claude dollar plan: Claude Code, OpenCode and Cline. A GPT dollar plan: Codex, OpenCode and Cline. A token pack works in all four. Not sure which credits you need? Start with the guide to AI API credits.
Activate the code
Open your order, under My orders, and press Redeem code under your code. It opens Your key. Press Activate my key. The key's time starts at that moment, so do it when you are ready to work. Copy the key and keep it private. If you lose it, enter the same code again: it shows the same key. The redeem code itself is not the key. A tool given the code instead of the key answers that the key is invalid.
Open Quick setup
Quick setup is one of the tabs beside Your key. Choose your app and the model, and it writes the settings with the base URL and your key filled in. If you have bought both kinds, a token pack and a dollar plan, look at the first choice on that tab: it must name the credits of the key you are setting up. The two kinds have different addresses and model names.
Put the settings in your tool
Claude Code: Put the settings in the file ~/.claude/settings.json (on Windows, %USERPROFILE%\.claude\settings.json). If the file already has settings, add these to them. Then run claude in your project: it starts without asking you to sign in. Codex: Put the settings in ~/.codex/config.toml, then run codex. The Codex app and its editor extension read the same file. OpenCode: Put the settings in ~/.config/opencode/opencode.json, then run opencode. Cline and Roo Code: In VS Code, open the extension's settings and fill in four fields from Quick setup: the API provider, the base URL, the API key and the model. With a token pack or a GPT dollar plan the provider is OpenAI Compatible; with a Claude dollar plan it is Anthropic, with the custom base URL switched on.
Check that it works
Send one short request from your tool. Then enter your code in Your key again: the request shows in the list of the last 24 hours, with what it used.
When a good key fails
Settings left from the other kind. A file written for a token pack does not work with a dollar plan, and the other way round. Take the whole file again from Quick setup. The wrong model name. A Claude dollar plan writes claude-opus-5-5, with dashes; a token pack writes claude-opus-5.5. Copy the name from the Models & prices tab rather than typing it. Claude Code with a dollar plan refuses every request. Look for a MAX_THINKING_TOKENS line left in settings.json from other settings, and remove it: the plan's models refuse it. A model the key does not have. A key calls only the models of the credits it came from. The time is up. A token pack lasts a few days from activation, and the key stops even with tokens left. Your key shows the expiry. Tokens go faster than expected. A token pack counts each model by its ratio, and output counts five times. A lighter model for routine steps makes a pack last much longer.
Keep your key safe
Your key works like a password: anyone who has it can spend its tokens or its credit. Never share it or show it in a screenshot, and do not put it in code you publish.
Still stuck?
Write in your order's chat with the tool you use, the model name and the error it shows. Our team can see whether the key is active and what it has left, and tells you which setting to change.