Using Claude and Codex API credit packs in Claude Code, Cline and Codex CLI (and making the tokens last)
Disclosure: I run Zelyx, a shop that sells Claude and Codex API credit packs. They're third-party credits, not keys bought from Anthropic's or OpenAI's own consoles. The setup below is the same for any provider that give
Disclosure: I run Zelyx, a shop that sells Claude and Codex API credit packs. They're third-party credits, not keys bought from Anthropic's or OpenAI's own consoles. The setup below is the same for any provider that gives you a key and an endpoint.
Paying per token instead of a monthly plan is handy when you code in bursts. Credit packs (a fixed number of tokens, or a dollar balance, for a fixed number of days) are one way to do it. Here's how to plug one into common tools, and how to stretch it.
What a credit pack gives you
Usually two things:
- an API key (sometimes you redeem a code first to get it), and
- an endpoint: the base URL your tool sends requests to.
Two details to check before you start:
- When the clock starts. On many packs the validity starts when you activate the code, not when you buy it.
- What counts. Input and output tokens both count. In coding tools the input side is usually the bigger one, because the tool sends your files and the conversation so far with every request.
Claude Code
Claude Code reads its connection from environment variables. Set them, then start claude:
# macOS / Linux
export ANTHROPIC_BASE_URL="https://your-provider-endpoint"
export ANTHROPIC_AUTH_TOKEN="your-key"
claude
# Windows PowerShell
$env:ANTHROPIC_BASE_URL = "https://your-provider-endpoint"
$env:ANTHROPIC_AUTH_TOKEN = "your-key"
claude
Some providers ask for ANTHROPIC_API_KEY instead of ANTHROPIC_AUTH_TOKEN; use the name their setup page gives. To keep the settings between sessions, put them in the env block of ~/.claude/settings.json (and keep that file private):
{
"env": {
"ANTHROPIC_BASE_URL": "https://your-provider-endpoint",
"ANTHROPIC_AUTH_TOKEN": "your-key"
}
}
Cline (VS Code)
In Cline's settings, choose the provider that matches your key: Anthropic, or OpenAI Compatible if your provider gives you an OpenAI-style endpoint. Paste the key. For Anthropic, tick Use custom base URL and enter the endpoint.
Codex CLI
Codex CLI can use any OpenAI-compatible endpoint through a custom provider in ~/.codex/config.toml:
model_provider = "mypack"
[model_providers.mypack]
name = "My credit pack"
base_url = "https://your-provider-endpoint/v1"
env_key = "MYPACK_API_KEY"
Then export MYPACK_API_KEY="your-key" and run codex. Set model to one your provider supports; its guide may add a line or two.
Cursor
Cursor takes your own keys in its model settings (the API Keys section). Custom keys only cover some features; others, such as Tab completion, keep using Cursor's own models.
Make the tokens last
- Start a new chat for each task, so old context isn't sent again with every message.
- Point the assistant at the files that matter instead of the whole repository.
- Use a smaller, faster model for simple edits when your tool lets you choose.
- Watch the usage your tool shows, and stop an agent that's going in circles.
Before you buy any third-party credits
- Is it a key or a redeem code, and when does the validity start?
- Which tools does the seller say it works with, and is there a setup guide?
- What happens if it stops working early: a replacement, a refund, or nothing?
- Your requests go through the provider's endpoint, so don't send secrets or client code you aren't allowed to share with a third party.
- Keep the key private. Anyone who has it can spend your tokens.
Where I sell them
On Zelyx the Claude packs run from 10M tokens for 1 day (0.99 USDT at the time of writing) up to 500M tokens for 6 days, or a $100 or $500 balance for 30 days ($100 is 2.11 USDT today). Codex packs start at 1.05 USDT. You can pay with USDT, Binance Pay or a card through PayPal, and the key appears on your order page right after payment, with the setup steps. Today's prices and stock: zelyxshop.com/guides/claude-api
Questions about the setup? Ask in the comments, or message us on Telegram: t.me/Zelyx224.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.