Codex App

Prerequisites

ItemValue
Codex AppLatest version
Config file~/.codex/config.toml
Provider idjoytoken
Model nameauto
JoyToken Base URLhttps://api.joytokens.ai/openai/v1
Wire APIOpenAI Responses
API key envJOY_TOKEN_API_KEY

Step 1: Set the API key

Replace sk-xxx with your JoyToken API key:

export JOY_TOKEN_API_KEY="sk-xxx"

Codex reads the variable named by env_key. Keep the key out of config.toml and start the app from a shell where this variable is available.

Step 2: Configure the provider

In Codex App, open Settings > Configuration > Open config.toml. Add the following top-level settings and provider definition to ~/.codex/config.toml:

model = "auto"
model_provider = "joytoken"
[model_providers.joytoken]
name = "JoyToken"
base_url = "https://api.joytokens.ai/openai/v1"
env_key = "JOY_TOKEN_API_KEY"
wire_api = "responses"

Provider and authentication settings must be in the user-level config. Codex ignores model_provider and model_providers in project-level .codex/config.toml files.

Step 3: Start Codex App

Quit any running Codex App process, then open the project from the shell where JOY_TOKEN_API_KEY is set:

codex app /path/to/your/project

Step 4: Verify

Send Reply with exactly: pong. A successful response includes pong.

JoyToken Check

PlaceExpected result
LogsRequest path is /openai/v1/responses
AuthBearer authentication uses JOY_TOKEN_API_KEY
ModelRequested model is auto
UsageTokens and credits are recorded

Common Errors

ErrorFix
JOY_TOKEN_API_KEY is missingStart Codex App from a shell where the variable is exported
Codex uses another providerCheck model_provider = "joytoken" in ~/.codex/config.toml
Provider config is ignoredMove it from project .codex/config.toml to user ~/.codex/config.toml
401 UnauthorizedCheck that JOY_TOKEN_API_KEY contains a valid JoyToken API key

Resources