# ChatGPT and Codex

For errors related to the 2api setup (401, stream disconnected, repeated Reconnecting and so on), see the [Codex FAQ](https://docs.2api.dev/en/faq/codex/).

## Plans and accounts

### Still on Free after the top-up

1. Make sure you're signed in to the account you submitted for the top-up, with the same sign-in method. If you used Apple's **Hide My Email** or switched sign-in methods, you may be in a different account.
2. Sign out and sign in again. If you're signed in on several devices, sign in again on each one.
3. Wait a few minutes, then refresh.
4. If it still doesn't work, [contact support](https://docs.2api.dev/en/support/) with your account email and the time of the top-up.

### Your usage has run out

Once your Work and Codex usage runs out, you have to wait for the reset. The reset time is shown on the [usage page](https://chatgpt.com/codex/settings/usage). On Plus and Pro, you can also buy extra credits to keep going. See [Plus and Pro](https://docs.2api.dev/en/guides/plans/#usage-limits) for details. If you have 2api balance, you can also [switch to 2api with magpie](https://docs.2api.dev/en/magpie/#use-it-with-a-chatgpt-subscription).

### A suspicious activity alert, or a request to verify again

Signing in from many places at the same time, switching networks often, or several people sharing one account can all trigger security checks. We recommend that you:

- Change your password once. Your devices are signed out one after another. Then sign in again.
- Turn on two-step verification under **Security** in settings.
- Don't share your account with others. It breaks OpenAI's terms of use, and it's the most likely way to run into problems.

### The email verification code doesn't arrive

- Request a new one, and only use the most recent code you received.
- Check your spam folder.
- Add sender addresses ending in openai.com to your email allowlist.

### No email after clicking Forgot password

Accounts registered with Google, Microsoft or Apple may not have a password. Keep signing in the way you did originally.

## Download and install

### Can't find Codex in the desktop app

Since July 2026, Codex has been part of the new ChatGPT desktop app. Open the new ChatGPT and choose **Codex** from the dropdown menu in the top-left corner. If what you opened is ChatGPT Classic, that's the old version and doesn't have Codex. Install the new version as described in [Download and install](https://docs.2api.dev/en/guides/install/#desktop-app).

### The Microsoft Store download fails

1. Press `Win+R` and run `wsreset` to clear the Store cache, then download again.
2. If that doesn't help, install it with a command in PowerShell:

   ```powershell
   winget install --id 9PLM9XGG6VKS -s msstore
   ```

Don't download installers from cloud drives or third-party sites.

### ChatGPT doesn't show up in the App Store

The ChatGPT iOS app isn't available in the App Store in mainland China, Hong Kong or Macau. You can use the web version for now: open chatgpt.com in Safari, then tap **Share** → **Add to Home Screen**. Only download the app from the official App Store page. The developer is OpenAI OpCo, LLC. Many apps with similar names are fakes.

### Can't install or open the app on Android

The ChatGPT Android app is only available on Google Play. It needs Android 7.1 or later and Google Play services. If it says Google Play needs an update, first update Google Play services to the latest version. Don't download APKs from third-party sites.

### Can't find the Codex icon in the IDE

- Make sure you installed the extension whose publisher is OpenAI and whose ID is `openai.chatgpt`.
- Press `Ctrl+Shift+P` (`Cmd+Shift+P` on macOS) and run **Codex: Open Codex Sidebar**.
- In Cursor, the icon may be hidden under **More** in the activity bar. Drag it out and pin it.

### The IDE extension is stuck signing in or keeps spinning

- Fully quit the editor, open it again and click **Sign in with ChatGPT** again.
- If that doesn't help, back up and delete `~/.codex/auth.json`, then sign in again.
- If nothing happens at all on Windows, you may be missing C++ components. See [Download and install](https://docs.2api.dev/en/guides/install/#ide-extension-vs-code-cursor).

## Sign-in and network

### Sent back to the sign-in page after signing in

- Allow cookies and JavaScript for chatgpt.com and openai.com. Clear the cache and cookies for both sites, then try again.
- Ad blockers and cookie managers can stop the sign-in button from working. Turn them off and try again.
- Use a private window, or switch to another browser.
- Make sure you're using the sign-in method you registered with.
- If you've failed many times in a short period, wait a while (up to about an hour) and try again.

### Unsupported country, region, or territory

It may also read `Country, region, or territory not supported`. This is OpenAI's regional restriction: OpenAI has determined that your current network location is outside the regions it supports. There's nothing wrong with your account or subscription. OpenAI only provides its service in the countries and territories it supports ([list](https://help.openai.com/en/articles/7947663-chatgpt-supported-countries)). According to OpenAI, using it in other regions may get your account restricted or deactivated.

If you really are in a supported region but still see this message, OpenAI recommends clearing your cache and cookies, then trying again in another browser or a private window. If that doesn't help, contact [OpenAI support](https://help.openai.com).

### Something went wrong / A network error occurred

1. Refresh the page, or start a new conversation.
2. Check [status.openai.com](https://status.openai.com) to see whether OpenAI is having an outage.
3. Clear the cache and cookies, or use a private window.
4. Turn off browser extensions. Proxies, VPNs and secure DNS settings can also cause this error.
5. Try another network, browser or device.

### Human verification keeps appearing

Refresh the page, clear cookies and turn off browser extensions, then try again. If your network's outgoing IP address changes often, you're more likely to get verification checks again and again.

### Signed out right after signing in, or refresh token was already used

Sign out and sign in again (in the CLI, run `codex logout`, then `codex login`). If it keeps happening, first update the app or Codex to the latest version. If that doesn't help, back up and delete `~/.codex/auth.json`, then sign in again. Don't delete `~/.codex/sessions`. That's where your session history is.

## While using it

### Chat history is missing in the desktop app

- Click the filter icon next to **Chats** in the sidebar and choose **Chronological** to show all conversations in time order.
- If you still can't find it, check **Archived chats** in settings.
- To see conversations you started on the web or on your phone, look in ChatGPT in the desktop app. When you switch to Codex, only Codex conversations are shown.

### is not supported when using Codex with a ChatGPT account

This model isn't available on your plan, or it has been retired. In Codex signed in with ChatGPT, GPT-5.4 and GPT-5.4 mini were retired on August 31, 2026, and GPT-5.5 on October 14. In the model menu (in the CLI, type `/model`), switch to a model that's in the list.

Free and Go can only use GPT-6 Luna in the desktop app. To use Codex in the IDE extension or the CLI, you need Plus or a higher plan.

## CLI

If you only use the desktop app, the web or your phone, you can skip this section. When something goes wrong, run `codex doctor` first. It checks the install, config, sign-in, Git and terminal, and produces a diagnostic report. For many problems, the report tells you what's wrong.

### command not found: codex

On Windows it reads `'codex' is not recognized as an internal or external command`, or `The term 'codex' is not recognized as the name of a cmdlet, function, script file, or operable program`. On a Chinese-language system, these read `'codex' 不是内部或外部命令` and `无法将“codex”项识别为 cmdlet、函数、脚本文件或可运行程序的名称`.

- After installing, open a new terminal. Terminals that were open before the install don't pick up the newly installed program.
- Make sure it really got installed: run the [install command](https://docs.2api.dev/en/guides/install/#cli) again and check for errors.

### The term 'irm' is not recognized

The full error is `irm : The term 'irm' is not recognized`, or `'irm' is not recognized as an internal or external command`. On a Chinese-language system it reads `无法将“irm”项识别为 cmdlet`.

You ran the PowerShell install command in CMD (Command Prompt). Press the `Win` key, type `PowerShell` to open it, then run the command again.

### running scripts is disabled on this system

The full error is `codex.ps1 cannot be loaded because running scripts is disabled on this system`. It may name `npm.ps1` instead. On a Chinese-language system it reads `因为在此系统上禁止运行脚本`.

By default, PowerShell doesn't allow scripts to run. Run the command below, or use `codex.cmd` instead of `codex`. For details, see [Using Codex on Windows](https://docs.2api.dev/en/faq/codex-windows/#powershell-blocks-scripts).

```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```

### npm install errors

`npm ERR! code EACCES` means you don't have permission to write to system directories. `Missing optional dependency @openai/codex-win32-x64` means npm didn't install the Windows program files. In both cases, use the [official install command](https://docs.2api.dev/en/guides/install/#cli) instead, and don't add `sudo`.

### The browser says you're signed in, but the terminal keeps waiting

The browser may also show `localhost refused to connect` (on a Chinese-language system, `localhost 拒绝了我们的连接请求`).

The browser has to hand the sign-in result back to `localhost:1455` on your computer, and a proxy or port problem is blocking that step. Go through the steps in [Sign in](https://docs.2api.dev/en/guides/login/#the-browser-sign-in-worked-but-the-terminal-is-still-waiting) in order. If nothing works, sign in with a device code: `codex login --device-auth`.

### Token exchange failed

It may also show `token_exchange_failed`. The sign-in in the browser worked, but when Codex tried to exchange the result for credentials, it couldn't reach OpenAI's authentication service.

- If your computer reaches the internet through proxy software, set the proxy in the same terminal where you run `codex login`, then sign in. Replace 7890 with the port shown in your proxy software:

  ```bash title="macOS / Linux"
  export HTTPS_PROXY=http://127.0.0.1:7890 NO_PROXY=localhost,127.0.0.1
  codex login
  ```

  ```powershell title="Windows PowerShell"
  $env:HTTPS_PROXY = "http://127.0.0.1:7890"; $env:NO_PROXY = "localhost,127.0.0.1"
  codex login
  ```

- If your company network has a TLS proxy, set `CODEX_CA_CERTIFICATE`. See [Corporate networks and sign-in logs](https://docs.2api.dev/en/guides/login/#corporate-networks-and-sign-in-logs).
- Check `codex-login.log` in `~/.codex/log`. It shows the specific cause.

### Sign-in could not be completed

- Make sure you're using the right account and sign-in method.
- Clear the cookies for chatgpt.com and openai.com in your browser, or try again in another browser or a private window.
- Sign in with a device code instead: `codex login --device-auth`.
- If it still fails, send `codex-login.log` to support.

### Device code sign-in is unavailable

First turn on device code sign-in in the security settings of ChatGPT on the web, then run `codex login --device-auth`. For a workspace account, ask your admin to turn it on in the workspace permissions.

### Startup error after upgrading, with `approval_policy = "untrusted"` in the config

The value `untrusted` is deprecated and may stop Codex from starting. In `~/.codex/config.toml`, change this line to `approval_policy = "on-request"`, or just delete it.

### `codex exec` doesn't accept `--full-auto`

`--full-auto` has been removed. To let `codex exec` change files, use `--sandbox workspace-write` instead.

### Error 1385 on Windows

Windows policy doesn't allow Codex's sandbox user to start commands. See [Using Codex on Windows](https://docs.2api.dev/en/faq/codex-windows/#native-the-sandbox).