# Codex with Multiple ChatGPT Accounts: Strategies That Work

The Codex CLI signs in one ChatGPT account at a time. The workarounds that exist: separate CODEX_HOME directories, re-login juggling, and gateway fallback lanes.

*Published 2026-06-12 · https://proxyllm.ai/blog/codex-multiple-accounts*

The Codex CLI holds one ChatGPT sign-in at a time, and there is no built-in account switcher. Two strategies work around that today: keep a separate `CODEX_HOME` directory per account so each stays signed in, or put a gateway in front that treats your accounts as ordered fallback lanes. Both are only worth doing with accounts you own and pay for yourself, because account sharing is the thing OpenAI's terms actually prohibit.

## Why one login at a time hurts

Codex usage is limited per account, over an hours-scale window plus a weekly cap on paid plans. Heavy users burn through the weekly cap days before it resets, buy a second Plus or Pro subscription, and then discover the CLI gives them no way to use it without logging the first account out. The second subscription idles at exactly the moment it was supposed to help.

This is the loudest recurring complaint in Codex community threads, and it is structural: credentials live in a single `auth.json`, and the CLI reads exactly one. We cover [how limits behave when they hit](/blog/what-happens-when-you-hit-codex-usage-limit) and [the weekly cap mechanics](/blog/codex-weekly-limit-explained) separately. This article is about getting a second account into the rotation.

The prize is simple: limits are enforced per account, so two accounts mean two independent usage windows.

## Workaround 1: one CODEX_HOME per account

The CLI stores credentials and config under `CODEX_HOME`, which defaults to `~/.codex`. Point it somewhere else and you get a fully independent login:

```bash
# Account A lives in the default location
codex login

# Account B gets its own home
mkdir -p ~/.codex-b
CODEX_HOME=~/.codex-b codex login

# Aliases make switching a habit
alias codex-a='CODEX_HOME=~/.codex codex'
alias codex-b='CODEX_HOME=~/.codex-b codex'
```

Multi-account Codex at the CLI level is really multi-directory Codex: one `CODEX_HOME` per login. Both accounts stay signed in, and the pattern carries into scripts, so `CODEX_HOME=~/.codex-b codex exec "run the nightly review"` works in cron the same way it works in your terminal.

What it does not do is fail over. When account A's window exhausts halfway through a job, you read the error, kill the run, and rerun on `codex-b`. A person at a keyboard can do that. A scheduled job at 3 a.m. cannot.

One clarification, because the word "profiles" causes confusion here: profiles in `config.toml` (selected with `--profile`) switch models and provider settings, not your ChatGPT identity. Identity lives in `auth.json`, and there is one per `CODEX_HOME`.

## Workaround 2: re-login juggling

The cruder version: `codex logout`, `codex login`, pick the other account in the browser, several times a week. Some people script it further by swapping `auth.json` files in and out of `~/.codex`.

It works, with two honest caveats. Token refreshes can invalidate a copy you swapped out, so the stashed file goes stale at random. And `auth.json` is a live credential: keep it at `600` permissions, never commit it, never sync it to a shared drive. If shuffling a file that sensitive between directories sounds fragile, that instinct is correct, and the `CODEX_HOME` approach above is strictly better.

## The gateway approach: lanes instead of switching

[Codex Hosted](/) was built around this exact gap. Each ChatGPT account you connect is signed in by you on your own machine and lands in its own isolated container, never shared, never pooled. We hold no password; the sign-in happens between you and OpenAI, and one CLI command uploads the session. The gateway then orders your accounts as lanes: when account A's window is exhausted, the next request runs on account B, and your own API key can sit last as metered overflow. The request log names the lane that served every call, so failovers are visible the moment they happen.

Sizing, using our planning estimates (estimates, never guarantees):

| Setup           | Subscriptions | API-equivalent capacity (estimate) |
| --------------- | ------------- | ---------------------------------- |
| Plus + Plus     | $40/mo        | ~$1,400 across two windows         |
| Pro 5x + Plus   | $120/mo       | ~$4,200                            |
| Pro 5x + Pro 5x | $200/mo       | ~$7,000                            |

ProxyLLM adds a flat $129/month on top, with no per-token markup. The sizing rule that falls out of the math: when your overflow regularly costs more than a subscription would at API rates, the next account pays for itself. [The fallback-lane deep dive](/blog/codex-hosted-fallback-lanes-explained) covers lane ordering and per-lane logs in detail.

## The account rules, stated plainly

Every account in the rotation must be yours: your name, your payment method, your workloads. What OpenAI's Terms of Use prohibit is sharing credentials or making your account available to someone else. Two subscriptions you own are two subscriptions used as intended; one subscription split between two people is the violation. OpenAI retains discretion over its services regardless, which is why [our reading of the terms](/blog/is-codex-hosted-against-openai-terms) promises nothing the documents do not support.

The test is ownership. Adding a coworker's idle account to your rotation fails it. Two accounts on your own card passes it.

## Which strategy fits you

Separate `CODEX_HOME` directories cost nothing and suit interactive work, where you are present to notice a limit and switch by hand. Re-login juggling is the same idea with more ways to break; skip it. The gateway earns its keep when the workload is unattended: agents, cron jobs, CI, anything where a stalled run matters more than a $129 line item.

If you are still deciding whether a second subscription pays for itself, the [calculator](/calculator) maps your current API spend to plan tiers in about thirty seconds.
