APIChecked
Codex CLI: Install, API Key and Pricing
Looking for the Codex CLI, an API key or the price? Here is the short answer as of December 2026: the Codex CLI is OpenAI's coding agent for the terminal, it installs with one npm command, and you can sign in with your ChatGPT account or with an API key. Which one you pick decides how you are billed.
SolaFix AI is an independent guide and is not affiliated with OpenAI.
At a glance
The Codex CLI is a program you run by typing commands. The install command is npm install -g @openai/codex.
Sign in with ChatGPT and Codex follows your ChatGPT plan. Sign in with an API key and you pay API usage fees instead.
Codex Cloud needs a ChatGPT sign-in. An API key alone does not unlock it.
ChatGPT Plus is $19.99 a month in the US App Store (the website lists $20). Free also includes Codex, with limits.
01What is the Codex CLI?
A CLI (command line interface) is a program you control by typing instead of clicking. Think of a vending machine versus a kitchen counter: the desktop app is the vending machine with big buttons, and the CLI is the counter where you tell the cook exactly what you want.
Codex is OpenAI's coding agent. You describe a programming job in plain words, and it works on the code for you. The CLI is the terminal version of it. The same tool also exists as a desktop app, a web page and an editor extension.
For example
Leo, a student who builds small websites at night, is already comfortable in a terminal. He likes typing one line and watching Codex work right next to his files, so the CLI suits him better than the desktop app.
Nina, a designer who has never opened a terminal, would be happier in the ChatGPT desktop app. It runs Codex with normal buttons, and she never has to type an install command.
02Codex CLI install: the command
The install command for the CLI is below. It uses npm (a tool that downloads programs for developers, and that you need to have installed first). Type it into your terminal exactly as written.
Open a terminal on your computer. On Windows this can be PowerShell, on Mac it is the Terminal app.
Run this command: npm install -g @openai/codex
Type codex to start it. It then asks you to sign in.
Copy the command from OpenAI's official Codex CLI page, not from a random website. A command from a stranger is like a stranger's key: it may open your door, and it may not be yours to use.
The official Codex CLI page has the current steps.
Open the Codex CLI pageThis opens OpenAI's developer documentation.
03Codex CLI Net? Check you are on the official page
Some people search for "Codex CLI Net" or similar and land on sites with names that look right. The official home of Codex is on OpenAI's developer site. If a page asks you to pay for a "Codex CLI" download or to hand over your ChatGPT password, close it.
Start from the official Codex home page instead.
Open Codex on developers.openai.comCodex login itself happens through ChatGPT, covered in our Codex login guide.
04Codex CLI API key or ChatGPT sign-in?
The CLI gives you two ways in. An API key is like a building access card: the program shows it at the door, and the fees go to the account that owns the card. A ChatGPT sign-in is more like a membership: you log in once in the browser and your plan covers the use.
Sign in with ChatGPTUses your ChatGPT plan; needed for Codex Cloud
Sign in with an API keyUsage-based API billing; local workflows
Here is the catch. API key sign-in works for local Codex work, but features that rely on ChatGPT workspace access or cloud services are limited or unavailable. If you see "Codex cloud requires signing in with ChatGPT.", that is the reason.
How to sign in with an API key
Create an API key on the OpenAI Platform.
Start Codex and choose the API key sign-in option.
Paste your key when it asks, and keep that key private.
For example
Carlos, a freelancer who already pays for ChatGPT Plus, signs in with ChatGPT so the CLI uses his plan. He does not need an API key at all.
Leo wants to run Codex in his own scripts. He signs in with an API key, and he knows those requests are billed as API usage, not through any ChatGPT plan.
Never paste an API key into a public place. Anyone who holds it can run requests on your account, and the fees land on you.
05Codex CLI pricing: what does it cost?
The CLI program itself is not sold on its own. You pay through your ChatGPT plan, or through API usage if you sign in with a key. Plans that include Codex are Free, Go, Plus, Pro, Business and Enterprise or Edu. Usage limits apply and depend on the plan and the task.
ChatGPT Plus is $19.99 a month if you buy it through the iOS app in the US, with tax included. On the ChatGPT website the plan is listed at $20 a month. Free costs $0 and includes Codex with usage limits, but not Codex Cloud. For Go and Pro, a US price could not be confirmed, so none is shown here.
Free$0, Codex with limits, no Codex Cloud
Plus (website)$20 a month
Plus (US iOS app)$19.99 a month
API usage fees are listed on OpenAI's API pricing page.
See OpenAI API pricingFor app plans, see our Codex app guide.
06Codex CLI won't sign in or start? Fixes
Sign in with ChatGPT
This is not an error. It is the prompt asking you to finish the ChatGPT login. Complete the login, approve it in your browser, then go back to the CLI.
Codex cloud requires signing in with ChatGPT.
You signed in with an API key, but Codex Cloud needs a ChatGPT account. Sign in with ChatGPT, then check that your account or workspace has Codex Cloud access.
Codex Cloud task failed to start
This means a cloud task could not begin. A short run of on-and-off errors was posted on the status page on December 4, 2026. Check the Codex line on the status page and retry once it recovers.
Codex Cloud task failed to resume
Same idea: a cloud task could not pick up where it stopped. Wait for the status page to look normal, then try resuming again.
Checking the live status…
Live status comes from the official status page. If it does not load, use the button below.
Phone number requests: some users are asked to add or confirm a phone number to reach Codex in the desktop app. If that happens, it is a known requirement, not a scam by itself.
Q&AFAQ
What is the install command for the Codex CLI?
It is npm install -g @openai/codex. Run it in your terminal, then type codex and sign in.
Do I need an API key to use the Codex CLI?
No. You can sign in with your ChatGPT account instead. An API key is the other option, and it is billed as API usage.
Is the Codex CLI free?
Free plan users get Codex with usage limits. Codex Cloud is not included in Free. API key use is billed separately.
Why does it say Codex cloud requires signing in with ChatGPT?
You signed in with an API key. Codex Cloud needs a ChatGPT sign-in, so log in with your ChatGPT account.
Where do I get help if the CLI breaks?
Check the status page first. For support, use the chat bubble at the bottom right of OpenAI's help center.
Related guides
Codex: everything in one place
Prices, limits and links were checked on December 6, 2026. SolaFix AI is not affiliated with OpenAI.