# How to use Claude Code and Codex without a subscription

Authors: AutoRouter
Published: 2026-10-23T02:20:02.168Z
Reading time: 8 min
Canonical: https://autorouter.com/blog/no-subscription-coding-agents
Publisher: AutoRouter, the Mac app for Codex and Claude Code (https://autorouter.com)

> Claude Code runs on a Claude Console account and Codex runs on an OpenAI API key, and both bill per token with no ChatGPT or Claude plan. AutoRouter, the Mac app for Codex and Claude Code, is a third option: AutoRouter Pro costs $20 a month with $20 of included usage and bills paid models at the provider's price plus 10%. On the same models, a direct API key costs less, so Pro comes out ahead only when cheaper models take enough of your turns.

You can use both without a subscription. Anthropic's docs say Claude Code works with a [Claude Console account](https://code.claude.com/docs/en/setup#authenticate) billed per token, and OpenAI's docs say Codex [signs in with an API key](https://learn.chatgpt.com/docs/auth) billed at standard API rates (both as of October 22, 2026). [AutoRouter, the Mac app for Codex and Claude Code](https://autorouter.com), is a third option: AutoRouter Pro costs $20 a month with $20 of included usage, gives every model in both apps, and bills paid models at the provider's price plus 10%. On the same models, a direct API key costs less, so Pro comes out ahead only when cheaper models take enough of your turns.

## Can you use Claude Code or Codex without a subscription?

Yes, both run on pay-per-token API billing. Anthropic's [Claude Code setup docs](https://code.claude.com/docs/en/setup#authenticate) say Claude Code requires a Pro, Max, Team, Enterprise or Console account, and that the free claude.ai plan doesn't include Claude Code (as of October 22, 2026). The Console account is the one without a plan: you buy credits and pay [Anthropic's API prices](https://platform.claude.com/docs/en/about-claude/pricing) per token.

OpenAI's [Codex authentication docs](https://learn.chatgpt.com/docs/auth) say the Codex CLI, the IDE extension and the ChatGPT desktop app accept an API key, and that OpenAI bills that usage through your OpenAI Platform account at standard API rates (as of October 22, 2026).

## How do you run Claude Code on an Anthropic API key?

Sign in with a Claude Console account, and Anthropic bills each request at its API prices. These steps follow Anthropic's [Claude Code setup](https://code.claude.com/docs/en/setup) and [authentication](https://code.claude.com/docs/en/authentication) docs as of October 22, 2026.

1. Create a Claude Console account at [platform.claude.com](https://platform.claude.com) and buy credits on its [Billing page](https://platform.claude.com/settings/billing).
2. Install Claude Code with Anthropic's native installer for macOS, Linux and WSL (first command below).
3. Run `claude` in your project. At the login prompt, choose the Anthropic Console account, then **Sign in with your Console account**, which [creates no API key](https://code.claude.com/docs/en/authentication#sign-in-without-an-api-key) and needs Claude Code v2.1.242 or later.
4. Or, if you already have a Console API key, set `ANTHROPIC_API_KEY` before you run `claude` and approve the key when Claude Code asks.
5. Inside Claude Code, run `/status` to see which credential is active and `/usage` to see the session's estimated cost.

```bash
curl -fsSL https://claude.ai/install.sh | bash
claude
```

The first Console sign-in creates a workspace called "Claude Code", where you can [set a spend limit](https://code.claude.com/docs/en/costs#claude-console). The `/usage` figure is an estimate at list price, and the Console's Usage page is the authoritative bill.

## How do you run Codex on an OpenAI API key?

Pipe an OpenAI API key into `codex login`, and OpenAI bills your Platform account at standard API rates. These commands come from OpenAI's [Codex CLI](https://learn.chatgpt.com/docs/cli) and [authentication](https://learn.chatgpt.com/docs/auth) docs as of October 22, 2026.

1. Create an API key in the [OpenAI dashboard](https://platform.openai.com/api-keys) and put it in the `OPENAI_API_KEY` environment variable.
2. Install the Codex CLI with OpenAI's standalone installer for macOS and Linux (first command below) or `npm install -g @openai/codex`.
3. Pipe the key to `codex login` through stdin.
4. Run `codex login status` to confirm the active sign-in method, then run `codex` in your project.

```bash
curl -fsSL https://chatgpt.com/codex/install.sh | sh
printenv OPENAI_API_KEY | codex login --with-api-key
codex login status
codex
```

`codex logout` clears the stored key. The IDE extension and the ChatGPT desktop app take the key on their signed-out screens.

## How does AutoRouter Pro work without a ChatGPT or Claude plan?

AutoRouter Pro gives you every model in Codex and Claude Code for $20 a month with $20 of included usage, and it doesn't require a ChatGPT or Claude subscription. AutoRouter, the Mac app for Codex and Claude Code, adds 20+ models to the model picker in both apps, plus one more choice called AutoRouter, which picks a model for each turn. Paid models are billed at the provider's price plus 10%, first from the included usage and then from credits you top up.

With no plan to draw on, every turn is paid usage. AutoRouter works out how hard each turn is: hard work gets the best model, and other work goes to the cheapest model that clears the quality bar for the task, which is often a low-cost open model. Unclear work is never treated as a quick task. Every turn shows its model, what it cost and why. [How AutoRouter picks a model](/blog/how-autorouter-picks-a-model) covers the full order.

New AutoRouter accounts get their first month free, until $20 of usage is spent if that comes first. After that, Pro is $20 a month. AutoRouter runs on macOS 14 or later with Codex (the app and the CLI) and the Claude Code CLI, which needs Node 22.18 or later, and it is in beta. Requests pass through AutoRouter's servers. AutoRouter [doesn't store transcripts](https://autorouter.com/privacy), and it keeps the message that opens each turn, up to 4,000 characters, to review routing.

1. Download AutoRouter for macOS from [autorouter.com](https://autorouter.com).
2. Open AutoRouter, sign in or create an account, allow Accessibility, and click Enable for each app.
3. Start a new session and choose AutoRouter as the model: in Codex, from the model menu under the message box; in Claude Code, with `/model`.

A coding agent can do the setup by following [autorouter.com/setup.md](https://autorouter.com/setup.md).

## Which option costs less?

On the same models, a direct API key costs less. With a key you pay the provider's list price. AutoRouter Pro bills that price plus 10%, and the first $20 each month comes from the included usage. AutoRouter wrote this post, so the math below starts with the case where a key wins. Prices are as of October 22, 2026, from [Anthropic](https://platform.claude.com/docs/en/about-claude/pricing) and [OpenAI](https://developers.openai.com/api/docs/pricing).

| Option                             | Works in                                                          | How you pay                                                     | Example price per million tokens (input / output)                                          |
| ---------------------------------- | ----------------------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| Anthropic API key (Claude Console) | Claude Code                                                       | Console credits, per token                                      | Claude Opus 5.5: $4 / $20. Claude Haiku 5.5, prompts up to 100,000 tokens: $0.10 / $0.50   |
| OpenAI API key                     | Codex CLI, IDE extension and ChatGPT desktop app                  | OpenAI Platform account, per token at standard API rates        | GPT-6.1 Sol: $2 / $10. GPT-6 Luna: $0.10 / $0.50. Both for prompts up to 272K input tokens |
| AutoRouter Pro with credits        | Codex (app and CLI) and the Claude Code CLI, on macOS 14 or later | $20 a month with $20 of included usage, then credits you top up | The provider's price plus 10%                                                              |

The $20 of included usage covers the first $18.18 of list-price usage each month ($20 divided by 1.1). Past that, each $1 at list price costs $1.10. Here is the same set of turns, on the same models, billed both ways.

| Usage in a month, at list price | Direct API key | AutoRouter Pro, same models       |
| ------------------------------- | -------------- | --------------------------------- |
| $10                             | $10            | $20 ($9 of included usage unused) |
| $50                             | $50            | $55                               |
| $150                            | $150           | $165                              |

$150 is the low end of the $150 to $250 a month that Anthropic's [Claude Code cost docs](https://code.claude.com/docs/en/costs) give as the average per developer across enterprise deployments, about $13 per active day (as of October 22, 2026). On the same date, [Claude Pro](https://claude.com/pricing) cost $20 a month billed monthly and [ChatGPT Plus](https://learn.chatgpt.com/docs/pricing) cost $20 a month. If your API bill runs well past that, a plan may cost less; [Subscription or API pricing](/blog/subscription-vs-api-pricing) works through that choice.

The case for AutoRouter Pro rests on the price gap between models. At list prices on October 22, 2026, Claude Haiku 5.5 costs a fortieth of Claude Opus 5.5 per uncached token on prompts up to 100,000 tokens, and GPT-6 Luna costs a twentieth of GPT-6.1 Sol. A turn on the cheaper model costs well under a tenth as much, even with 10% added. Whether your month comes out ahead depends on how many of your turns are quick. [How to send quick coding tasks to a cheaper model](/blog/quick-tasks-on-cheaper-models) works through one turn's cost.

## Questions

### Can I use Codex without paying for ChatGPT Plus?

Yes, with an API key or a lower ChatGPT plan. OpenAI's [Codex pricing page](https://learn.chatgpt.com/docs/pricing) lists Codex in the ChatGPT Free and Go ($8 a month) plans for quick and lightweight coding tasks in the desktop app, subject to rollout, as of October 22, 2026. Plus, at $20 a month, includes Codex on the web, in the CLI, in the IDE extension and on iOS.

### Which credential does Claude Code use if I have a plan and an API key?

Claude Code uses `ANTHROPIC_API_KEY` over your subscription login once you approve the key, according to Anthropic's [authentication docs](https://code.claude.com/docs/en/authentication#authentication-precedence). Run `unset ANTHROPIC_API_KEY` to fall back to the subscription, and `/status` to check which one is active.

### What do I lose by signing in to Codex with an API key?

You lose Codex cloud and its cloud-based features. OpenAI's [authentication docs](https://learn.chatgpt.com/docs/auth) say Codex cloud requires signing in with ChatGPT, and its [pricing page](https://learn.chatgpt.com/docs/pricing) says the API-key option has no cloud-based features, such as GitHub code review or Slack (October 22, 2026). Local work in the CLI and IDE extension runs on the key.

### What happens when AutoRouter Pro's included usage runs out?

AutoRouter asks you to top up, and you can top up any time. Paid models then bill from credits at the provider's price plus 10%, and credits you buy never expire. Included usage resets each month and doesn't roll over.

## Sources

- [Advanced setup](https://code.claude.com/docs/en/setup), Claude Code docs, Anthropic. Install command and accounts that include Claude Code. Checked October 22, 2026.
- [Authentication](https://code.claude.com/docs/en/authentication), Claude Code docs, Anthropic. Console sign-in, `ANTHROPIC_API_KEY` and credential precedence. Checked October 22, 2026.
- [Manage costs effectively](https://code.claude.com/docs/en/costs), Claude Code docs, Anthropic. Average cost per developer, `/usage` and workspace spend limits. Checked October 22, 2026.
- [Pricing](https://platform.claude.com/docs/en/about-claude/pricing), Claude API docs, Anthropic. Per-token prices and buying credits. Checked October 22, 2026.
- [Plans and pricing](https://claude.com/pricing), Anthropic. Claude Pro price. Checked October 22, 2026.
- [Codex CLI](https://learn.chatgpt.com/docs/cli), OpenAI. Install commands. Checked October 22, 2026.
- [OpenAI authentication](https://learn.chatgpt.com/docs/auth), Codex docs, OpenAI. API-key sign-in, billing and Codex cloud. Checked October 22, 2026.
- [Codex pricing](https://learn.chatgpt.com/docs/pricing), OpenAI. Plans that include Codex and the API-key option. Checked October 22, 2026.
- [API pricing](https://developers.openai.com/api/docs/pricing), OpenAI. Per-token prices. Checked October 22, 2026.

## Read next

- [Subscription or API: which is cheaper for coding agents?](https://autorouter.com/blog/subscription-vs-api-pricing.md): A Claude or ChatGPT plan costs less than paying per token once a month of your coding would cost more than the plan at API list prices, and the plan's limits still hold that work. As of October 22, 2026, Anthropic reports Claude Code averaging $150 to $250 per developer per month at API prices across enterprise deployments, against $20 for Claude Pro and $100 or $200 for Max. AutoRouter, the Mac app for Codex and Claude Code, uses the ChatGPT and Claude plans you already pay for first and bills other models at the provider's price plus 10%.
- [How do Codex and Claude Code compare, and can you use both?](https://autorouter.com/blog/codex-vs-claude-code.md): As of October 2026, Codex is OpenAI's coding agent, included with every ChatGPT plan, and Claude Code is Anthropic's, included with every paid Claude plan; ChatGPT Plus and Claude Pro both cost $20 a month. They overlap on most features, so the choice comes down to the models you prefer (GPT-6.1 Sol and GPT-6 Luna, or Claude Opus 5.5, Sonnet 5.5 and Haiku 5.5) and the plan you already pay for, and both can share one AGENTS.md in the same repository. AutoRouter, the Mac app for Codex and Claude Code, works in both and picks a model for each turn by how hard it is.
- [Codex usage limits explained, and what to do when you run out](https://autorouter.com/blog/codex-usage-limits.md): As of October 2026, OpenAI estimates that ChatGPT Plus and standard Business seats get 15 to 160 local Codex messages on GPT-6.1 Sol per five-hour window, with weekly limits that may also apply, while ChatGPT Pro has no five-hour limit and no published message counts. At the limit, Codex finishes the turn it is on, and then you can wait for the reset, buy ChatGPT credits, upgrade, or sign in with an API key at API rates. AutoRouter, the Mac app for Codex and Claude Code, picks the model for each Codex turn so the ChatGPT plan goes to the work that needs it.

Tags: [Claude Code](https://autorouter.com/blog/tags/claude-code.md), [Codex](https://autorouter.com/blog/tags/codex.md), [Costs](https://autorouter.com/blog/tags/costs.md)

Drafted with AI from the sources linked above, then checked and edited by the AutoRouter team.
