DOC 02Clients
Codex Setup Guide
Connect Codex CLI and the desktop app to spiderai with a setup script or manual configuration, including the API key, model and Responses API.
Install and configure Codex to connect to spiderai through ~/.codex.
Choose the setup script for your system
The script detects Node.js and Codex CLI and helps install them if needed. It then asks for your API key and writes ~/.codex/config.toml. The copied command does not contain your key.
irm https://spiderai.fun/install/codex.ps1 | iexcurl -fsSL https://spiderai.fun/install/codex.sh | bashTip
The configuration in
~/.codex is used by both Codex CLI and Codex App. Restart any open CLI sessions to load it.Tip
A key from any Codex / GPT group works with Codex. Create one on API Keys.
Alternative: install Codex manuallyExpand this if the setup script is unavailable.
Note
Before installing manually, complete the Node.js installation guide.
Step 1: Install Codex
npm install -g @openai/codex@latestsudo npm install -g @openai/codex@latestnpm install -g @openai/codex@latestThis installs the latest Codex package from the npm registry. Verify it:
codex --versionStep 2: Create the configuration file
Codex only needs config.toml. Put your API key in experimental_bearer_token.
# Create the configuration directory (back up existing files; the following command overwrites them)
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.codex" | Out-Null
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
# Create config.toml
$config = @'
model_provider = "codex"
model = "gpt-6.1-sol"
model_reasoning_effort = "high"
model_context_window = 272000
sandbox_mode = "workspace-write"
[model_providers.codex]
name = "codex"
base_url = "https://api.spiderai.fun/v1"
wire_api = "responses"
requires_openai_auth = false
supports_websockets = false
experimental_bearer_token = "YOUR_API_KEY"
http_headers = { "x-openai-actor-authorization" = "spiderai.fun" }
[desktop]
conversationDetailMode = "STEPS_COMMANDS"
[sandbox_workspace_write]
network_access = true
[features]
goals = true
'@
[System.IO.File]::WriteAllText("$env:USERPROFILE\.codex\config.toml", $config, $utf8NoBom)# Create the configuration directory (back up existing files; the following commands overwrite them)
mkdir -p ~/.codex
# Create config.toml
cat > ~/.codex/config.toml << 'EOF'
model_provider = "codex"
model = "gpt-6.1-sol"
model_reasoning_effort = "high"
model_context_window = 272000
sandbox_mode = "workspace-write"
[model_providers.codex]
name = "codex"
base_url = "https://api.spiderai.fun/v1"
wire_api = "responses"
requires_openai_auth = false
supports_websockets = false
experimental_bearer_token = "YOUR_API_KEY"
http_headers = { "x-openai-actor-authorization" = "spiderai.fun" }
[desktop]
conversationDetailMode = "STEPS_COMMANDS"
[sandbox_workspace_write]
network_access = true
[features]
goals = true
EOF# Create the configuration directory (back up existing files; the following commands overwrite them)
mkdir -p ~/.codex
# Create config.toml
cat > ~/.codex/config.toml << 'EOF'
model_provider = "codex"
model = "gpt-6.1-sol"
model_reasoning_effort = "high"
model_context_window = 272000
sandbox_mode = "workspace-write"
[model_providers.codex]
name = "codex"
base_url = "https://api.spiderai.fun/v1"
wire_api = "responses"
requires_openai_auth = false
supports_websockets = false
experimental_bearer_token = "YOUR_API_KEY"
http_headers = { "x-openai-actor-authorization" = "spiderai.fun" }
[desktop]
conversationDetailMode = "STEPS_COMMANDS"
[sandbox_workspace_write]
network_access = true
[features]
goals = true
EOFTip
Replace
YOUR_API_KEY with an API key copied from API Keys.Start using Codex
Run the following from your project directory:
codexFor more information, see the OpenAI documentation.