Codex CLI

Use Codex CLI with AutoDo

AutoDo adaptation

supported

Codex supports custom OpenAI-compatible providers. Use AutoDo as the provider name, https://autodo.work/v1 as the base URL, and AUTODO_API_KEY as the env key.

What is Codex CLI?

Codex CLI is OpenAI's open-source local coding agent that runs in your terminal. It supports multiple model providers, including AutoDo, so you can use AutoDo's unified API, provider failover, and organizational controls with Codex's agentic coding workflows.

Quick Start

Step 1: Install Codex CLI

Follow the Codex CLI installation instructions to install the CLI on your system.

Step 2: Get Your AutoDo API Key

  1. Sign up or log in at AutoDo
  2. Navigate to your API Keys page
  3. Create a new API key
  4. Copy your key (starts with sk-***)

Step 3: Configure Codex for AutoDo

Codex uses a config.toml file, typically located at ~/.codex/config.toml. Create or edit this file with the following configuration:

model_provider = "autodo"
model_reasoning_effort = "high"
model="~openai/gpt-latest"

[model_providers.autodo]
name = "AutoDo"

base_url="https://autodo.work/v1"
env_key="AUTODO_API_KEY"

Step 4: Set Your API Key

Export your AutoDo API key in your shell profile:

# Add to ~/.zshrc, ~/.bashrc, or ~/.config/fish/config.fish
export AUTODO_API_KEY="sk-***"

Note: Codex reads the API key from the environment variable specified in env_key (default: AUTODO_API_KEY). Ensure this is set before starting Codex.

Step 5: Start Codex

Navigate to your project directory and run:

cd /path/to/your/project
codex

Your requests will now be routed through AutoDo.

Configuration Reference

Core Settings

SettingDescriptionExample
model_providerProvider to use for model requests"autodo"
modelAutoDo model ID"~openai/gpt-latest"
model_reasoning_effortReasoning effort level for Codex models"low", "medium", "high", "xhigh", "max"
show_raw_agent_reasoningWhether to display reasoning tokens in the UItrue or false
personalityAgent personality preset"pragmatic", "helpful", etc.

AutoDo Provider Block

[model_providers.autodo]
name = "AutoDo"
base_url = "https://autodo.work/v1"
env_key = "AUTODO_API_KEY"
  • base_url: AutoDo API endpoint. Use https://autodo.work/v1 for production.
  • env_key: Environment variable name for your API key.

Project Trust Levels

Codex supports per-project trust levels. Add project paths to control what the agent can access:

[projects."/path/to/trusted/project"]
trust_level = "trusted"

[projects."/path/to/untrusted/project"]
trust_level = "untrusted"
  • trusted: Agent has full access (e.g., run commands, edit files).
  • untrusted: Agent has restricted access for safety.

Why Use AutoDo with Codex CLI?

Provider Failover

AutoDo routes requests across multiple providers. If one provider is unavailable or rate-limited, AutoDo can fail over to another, keeping your coding sessions uninterrupted.

Organizational Controls

For teams, AutoDo provides centralized budget management. Set spending limits, allocate credits, and prevent unexpected cost overruns across developers using Codex.

Usage Visibility

Track Codex usage in real-time via the AutoDo Activity Dashboard. Monitor costs, token usage, and request patterns.

Model Flexibility

Point model at any AutoDo slug (e.g. ~openai/gpt-latest, ~anthropic/claude-sonnet-latest) or a pinned version to switch models without changing your Codex installation—just update config.toml.

Troubleshooting

  • Auth Errors: Ensure AUTODO_API_KEY is set and valid. Check at autodo.work/keys.
  • Model Not Found: Verify the model ID on autodo.work/models. Use the exact format (e.g., ~openai/gpt-latest).
  • Privacy: AutoDo does not log your source code prompts unless you opt-in to prompt logging. See our Privacy Policy for details.

Resources