Skip to content

Codex Desktop ​

Codex Desktop does not need a separate provider setup. It reads the same config.toml and auth.json as Codex CLI for the current system user. This guide edits those two local files directly and does not require CC Switch or another provider manager.

One key for every platform model

The CLI and desktop app can reuse the same LAYSO AI provider and API key. Every successful request has an itemized charge; failed tasks are not charged.

File locations shared with Codex CLI ​

SystemProvider configurationAPI key authentication file
macOS/Users/<username>/.codex/config.toml/Users/<username>/.codex/auth.json
WindowsC:\Users\<username>\.codex\config.tomlC:\Users\<username>\.codex\auth.json
Linux / WSL/home/<username>/.codex/config.toml/home/<username>/.codex/auth.json

Both clients use provider ID layso_ai, display name LAYSO AI, Base URL https://api.layso.ai/v1, and the responses Wire API. Get the key from the LAYSO AI API Keys page ↗.

Verify the desktop configuration ​

Step 1: Check the local config.toml ​

Open the current user's config.toml from the table above and confirm that it exactly matches the Codex CLI guide. Choose other model IDs on LAYSO AI models and pricing.

toml
model_provider = "layso_ai"
model = "gpt-5.5"
model_reasoning_effort = "high"
disable_response_storage = true
cli_auth_credentials_store = "file"

[model_providers.layso_ai]
name = "LAYSO AI"
base_url = "https://api.layso.ai/v1"
wire_api = "responses"
requires_openai_auth = true

Follow the configuration shown in this guide

The screenshot illustrates where the fields appear. If its provider ID or model ID differs from the code above, use the code above and the complete model ID provided in the LAYSO AI model catalog.

Step 2: Open the file from Codex Desktop ​

Open Codex Desktop settings and choose Open config.toml. The system editor must open the current-user file shown above. Do not create another config.toml inside a project directory.

Step 3: Save the configuration and add the API key ​

Paste the Step 1 configuration into the opened config.toml and save it. You can keep other existing Codex settings, but do not declare the same top-level fields or [model_providers.layso_ai] more than once.

Create a key on the LAYSO AI API Keys page ↗, then write it to the current user's auth.json shown in the table above:

json
{
  "OPENAI_API_KEY": "sk-..."
}

macOS:

bash
mkdir -p ~/.codex
nano ~/.codex/auth.json
chmod 600 ~/.codex/auth.json

Windows PowerShell:

powershell
New-Item -ItemType Directory -Force "$HOME\.codex"
notepad "$HOME\.codex\auth.json"

Linux / WSL:

bash
mkdir -p ~/.codex
nano ~/.codex/auth.json
chmod 600 ~/.codex/auth.json

The CLI and desktop app read the same authentication file. WSL uses the Linux home directory, while Windows uses the Windows user directory. Never put a real key in config.toml, and never share or commit auth.json.

Step 4: Send a verification message ​

After saving both files, fully quit and reopen Codex Desktop. Confirm that the provider is displayed as LAYSO AI and the model matches the CLI configuration, then send a small test task. After it succeeds, verify the model, token use, and itemized charge in LAYSO AI task details.

Troubleshooting ​

LAYSO AI does not appear in the desktop app ​

Confirm that the file belongs to the current system user and includes model_provider = "layso_ai". Save it, fully quit the app, and reopen it.

The CLI works but the desktop app cannot authenticate ​

Confirm that the CLI and desktop app run as the same system user, that .codex/auth.json contains a valid OPENAI_API_KEY, and that config.toml includes cli_auth_credentials_store = "file". Then restart the desktop app.

Configuration changes are not applied ​

Check the TOML syntax, model ID, and Base URL. The Base URL must be https://api.layso.ai/v1; do not append /v1 twice.

Security ​

  • Never write the real API key directly into config.toml.
  • Never expose a full key in screenshots, logs, or Git repositories.
  • Use a small, read-only task for the first verification.

LAYSO AI API 文档