← omniport

Claude Code without a subscription: pay for tokens, not for a month

updated July 18, 2026 · версия на русском

A common assumption is that Claude Code needs a Pro or Max subscription to run. It doesn't. It has shipped with a second mode from day one — API mode, billed per token actually used. A subscription is great if you can buy one and your usage fits its limits. There are two situations where API mode is plainly better, or the only option at all.

First: your card gets declined — Anthropic's billing doesn't cover every country, so the subscription simply can't be bought (there's a separate guide on that). Second: your coding comes in bursts. Paying $20–200 a month to use it three evenings stings, and even on Max you hit the rolling 5-hour usage windows right when the work gets interesting.

How it works

Claude Code reads two environment variables: ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN. When they're set, it skips subscription billing and talks to whatever server you point it at, with your key. That server can be Anthropic's official API (same card problem) — or a compatible gateway funded in USDT. We run one: omniport.

# Linux / macOS $ export ANTHROPIC_BASE_URL=https://api.omniport.cc $ export ANTHROPIC_AUTH_TOKEN=sk-… $ claude
# Windows (PowerShell) > $env:ANTHROPIC_BASE_URL = "https://api.omniport.cc" > $env:ANTHROPIC_AUTH_TOKEN = "sk-…" > claude

The key comes from the console after a top-up (USDT on BSC or Base, $5 minimum, credited within a couple of minutes). Everything works — streaming, tool use, prompt caching, /compact. Claude Code can't tell the gateway from the native API.

What an evening of coding actually costs

The big fear with pay-as-you-go is the surprise bill. Look at the numbers instead. Most of Claude Code's traffic is cache reads — it re-reads your project context on every step — and cached tokens cost a fraction of regular input:

ModelInput / 1MOutput / 1MCache read / 1M
claude-sonnet-5$0.64$3.20$0.064
claude-opus-4-8$1.60$8.00$0.16

In practice a solid evening on sonnet-5 lands around a dollar or a dollar fifty; on opus, three to five. A $20 top-up covers a couple of weeks of daily work, and the balance doesn't expire if you take a week off. Per-request spend is visible in the console — no end-of-month surprises.

For scale: at official API list prices the same opus evening would cost roughly three times more — $25 per million output tokens versus $8 here. Where the difference comes from is covered in the FAQ.

Subscription or tokens — picking honestly

If you code six hours a day, every day, at Max-tier volume and your card works — the subscription probably stays cheaper, no magic here. Tokens win when usage is uneven: one intense week, two quiet ones. And they're the only route when the subscription can't be purchased at all.

One underrated perk of API mode: a single balance covers every model. The same console serves GPT (for Codex CLI), GLM and Grok — you switch tools without juggling four billing accounts. Codex CLI and OpenCode configs are in the docs.

Questions — Telegram. Full model pricing is here.