Skip to main content
Codex CLI can connect to 4096bytes through an OpenAI compatible Provider. You need to write the dashboard-generated config.toml and auth.json into the Codex config directory. Prefer copying the config from the dashboard Use key dialog. It shows the correct path for your system and inserts the current API Key automatically.

Prerequisites

  • You have completed Create an account.
  • You have completed Get an API Key.
  • Codex CLI is installed and codex --version works.
  • The Use key dialog is open for the API Key you want to use.
The API Key in auth.json is stored as a local plaintext credential. Do not commit ~/.codex/auth.json, screenshots, or terminal output to a repository or chat.

Install

If Codex CLI is not installed, check the latest instructions in the OpenAI Codex GitHub repository. macOS or Linux:
Windows PowerShell:
If you use npm for global CLI tools:
After installation, reopen the terminal and verify:

Copy config from the dashboard

1

Open API Keys

Open the dashboard and go to API Keys.
2

Choose Codex CLI

Find the key you want to use for Codex, click Use key, then choose Codex CLI.
3

Choose your system

Select macOS / Linux or Windows. The dashboard shows the target config file paths.
4

Copy config

Copy the config.toml and auth.json snippets. Put config.toml at the beginning of the file so old config does not override it.
Copy config

macOS or Linux

Write config.toml

Open or create ~/.codex/config.toml, then put this block at the beginning.
Use the model and review_model values shown in the dashboard. If your dashboard shows a different model name, use that value.

Write auth.json

Open or create ~/.codex/auth.json:
Replace YOUR_4096BYTES_API_KEY with the API Key you created in the dashboard.

Start Codex

Save both files, reopen the terminal, and run:
You can also start with a low-risk prompt:

Windows

Write config.toml

Open or create:
Put this block at the beginning.
If you run Codex inside WSL, configure ~/.codex/config.toml inside WSL instead of the Windows user directory.

Write auth.json

Open or create:
Write:
If you run Codex inside WSL, write ~/.codex/auth.json inside WSL.

Start Codex

Save both files, reopen PowerShell or Windows Terminal, and run:
You can also test with:

Field reference

Common issues

Put the new config at the beginning of config.toml. Save, close the terminal, and run codex again.
Check that auth.json is valid JSON. Confirm the API Key has no missing characters, newlines, or extra spaces.
model and review_model must match the dashboard model name exactly. Do not copy names from someone else’s screenshot.
Confirm where Codex is running. If it runs in WSL, configure WSL’s ~/.codex/, not %USERPROFILE%\.codex\.
You can keep them, but make sure model_provider = "OpenAI" points to the 4096bytes [model_providers.OpenAI] block.