TokenFlyTokenFly
API GuideGetting StartedClient Setup

Codex Setup

Connect Codex to Tokenfly

Installation

npm install -g @openai/codex

After installation, start it with:

codex

Configure config.toml

Create the file ~/.codex/config.toml with the following content:

model_provider = "OpenAI"
model = "gpt-5.4"
review_model = "gpt-5.4"
model_reasoning_effort = "medium"
disable_response_storage = true
network_access = "enabled"
windows_wsl_setup_acknowledged = true
model_context_window = 1000000
model_auto_compact_token_limit = 900000

[model_providers.OpenAI]
name = "OpenAI"
base_url = "https://tokenfly.com/v1"
wire_api = "responses"
requires_openai_auth = true

Configure auth.json

Create the file ~/.codex/auth.json with the following content:

{
  "OPENAI_API_KEY": "sk-xxx"
}

Configuration Reference

FieldPurpose
model_providerDefault model provider
modelPrimary model
review_modelCode review model
model_reasoning_effortReasoning effort level
disable_response_storageDisables response storage
network_accessWhether network access is allowed
model_context_windowContext window size
model_auto_compact_token_limitAuto-compaction threshold

Starting

Once configured, run:

codex

How is this guide?