Connect Codex CLI

Configure Codex CLI to use AnyInt as a custom OpenAI Responses provider.

Codex CLI supports custom model providers with a base URL and an environment-backed API key. AnyInt exposes the Responses API at the canonical OpenAI-compatible base.

Before You Start

  1. Install or update Codex using the official Codex CLI instructions.
  2. Create an AnyInt API key.
  3. Choose a Responses-compatible model ID from the model catalog.

Configure the Provider

Run our one-line automated installer to configure ~/.codex/config.toml with timestamped backup and chmod 600 permissions, sync via CC Switch from the API keys page, or store the key in your shell for manual setup:

bash
# Automated install (configures ~/.codex/config.toml with backup):
curl -fsSL https://api.anyint.ai/install/codex.sh | bash -s -- --key "your_api_key" --url "https://api.anyint.ai/v1" --model "YOUR_MODEL_ID"

# Or configure environment variable for manual setup:
export ANYINT_API_KEY="your_api_key"

For manual setup, add the AnyInt provider to ~/.codex/config.toml:

toml
model_provider = "anyint"
model = "YOUR_MODEL_ID"

[model_providers.anyint]
name = "AnyInt Gateway"
base_url = "https://api.anyint.ai/v1"
wire_api = "responses"
experimental_bearer_token = "your_api_key"

Run Codex from your repository:

bash
codex

Verify and Troubleshoot

  • Run /status in Codex and confirm the selected provider and model.
  • A 401 response means ANYINT_API_KEY is not visible to the Codex process or the key is inactive.
  • A model error means YOUR_MODEL_ID was not replaced with a current Responses-compatible catalog entry.
  • The automated installer locks permissions to 600; for manual setup you can use experimental_bearer_token or env_key = "ANYINT_API_KEY".

The configuration fields above follow the official OpenAI Docs Codex configuration reference.