Codex "Phone number is required" at sign-in: what to do
Codex sign-in asks for a phone number, says invalid_phone_number or the number is at its account limit: what each means, and running Codex on an API key.
“Phone number is required” is OpenAI’s account asking for a verified phone number before it lets Codex sign in. It happens on OpenAI’s sign-in pages, in whatever browser you opened the link in, so a server meets it exactly as a laptop does, and nothing on the server or in Codex changes it. Verify a mobile number you own and the sign-in continues. If the number is refused or already used up, that is for OpenAI support to resolve. Codex can also run on an OpenAI API key, with codex login --with-api-key, which uses no ChatGPT sign-in and is billed per use instead of from your plan.
Where it appears
You run codex login, or codex login --device-auth on a server, open the link, sign in to ChatGPT, and instead of the approval screen you get a page asking for a phone number. Accounts that sign in to ChatGPT on the web with no phone prompt meet it too. A report on Codex’s tracker describes exactly that: the device-code sign-in “always requires phone number verification”, while ChatGPT on the web with the same Google account “works normally”, and turning on device code sign-in in ChatGPT’s security settings “does not change the behavior.” The same thread has reports from macOS, an Ubuntu 26.04 machine, a Linux VPS and Windows 11 on ChatGPT Plus, through November 2026, with no answer from a maintainer.
The step belongs to the account. The device-code link opens auth.openai.com in your own browser, on your phone or laptop, and the server only waits for the result. Nothing done on the server takes part in it, whether reinstalling Codex, updating it or moving to another machine: the question is put to the account, wherever Codex runs.
What each message means
- “Phone number is required.” OpenAI wants a verified number on the account before Codex can sign in. Enter a mobile number you control, then the code sent to it; reporters describe the code arriving by SMS or WhatsApp.
invalid_phone_numberOpenAI would not send a code to the number entered. Reporters meet it when they ask for the code. If a number you own is refused, OpenAI support is who can say why.- “This phone number is already linked to the maximum number of accounts.” OpenAI has a limit on how many accounts one number can verify, and this number has reached it. People have met this sentence since 2023, at sign-up and at sign-in, and a Codex user on OpenAI’s forum reports reaching it from the Codex sign-in, with no way to see which accounts hold the number. Only OpenAI can see that.
One more case has no message of its own: the account already has a number, from years ago, and Codex asks to verify that one. An open issue describes a number “no longer under my control” and a screen that “offers SMS and WhatsApp delivery only”, with no option to change the number. That too is OpenAI support’s, since the account is theirs to change.
Copying ~/.codex/auth.json from a laptop that is already signed in does not skip anything: that sign-in passed the same step, and a copied sign-in has its own trouble once two machines use it. A different block, “contact your workspace admin to enable device code authentication”, is a workspace setting rather than a phone check, and its fix is the admin’s.
Codex on an API key
Codex has two ways to authenticate, and only the ChatGPT one goes through that sign-in. The other is an API key from an OpenAI Platform account, which Codex reads from standard input and saves as the machine’s login:
printenv OPENAI_API_KEY | codex login --with-api-key
codex login statusCopiedFor a job run with codex exec, the key can be given for one run instead, and it takes precedence over any saved login:
CODEX_API_KEY=<api-key> codex exec --json "triage open bug reports"CopiedIt is a different product with a different bill, not a way into your ChatGPT plan. Key usage is billed through your OpenAI Platform account “at standard API rates”, per token, and none of it comes out of the Codex usage your plan includes. Codex cloud “requires signing in with ChatGPT”, and other features tied to a ChatGPT workspace are limited or missing. What a plan would have covered instead is in which ChatGPT plans include Codex. For a scheduled job on a server, a key is what OpenAI recommends anyway, and the guide to Codex on a Linux server covers the rest of the setup.