Skip to main content
1API Club

Coding agents

Configure your coding agent.

Connect a coding agent to 1API with your existing API key, then confirm the first task appears in Usage.

Docs menu

Setup

Choose your client and platform.

Choose the client and operating system. This guide assumes the client is installed and you already have a 1API key.

Codex CLI

Add the 1API provider.

Add a 1API provider to the user-level Codex configuration. Keep the API key in the environment, not in this file.

~/.codex/config.toml
model_provider = "1api"

[model_providers.1api]
name = "1API"
base_url = "https://api.1api.club/v1"
wire_api = "responses"
env_key = "CODEX_1API_CLUB_API_KEY"
requires_openai_auth = true
Keep your existing settings
Merge this provider into the existing file. Keep top-level settings such as `model_provider` in the TOML top level; do not add a duplicate provider table.

API key

Set the API key in your environment.

Make the key available to the terminal process that starts Codex.

Current terminal
export CODEX_1API_CLUB_API_KEY="YOUR_1API_API_KEY"

This command applies to the current terminal session and its child processes. For ongoing use, supply the variable through your preferred local secret manager. Do not save the API key in a project file or commit it to Git.

CLI profile

Create a dedicated 1API profile.

A named profile keeps your normal Codex CLI defaults unchanged.

  1. 01Create ~/.codex/1api.config.tomlUse the model ID you want to run with your 1API key.
  2. 02Start Codex with the profileRun the command below when you want Codex CLI to use 1API.
~/.codex/1api.config.toml
model_provider = "1api"
model = "YOUR_MODEL_ID"
Start Codex CLI
codex --profile 1api

Replace YOUR_MODEL_ID with a model ID recognized by your Codex version and available to your 1API key. The profile applies to Codex CLI; it is not a desktop app profile.

macOS app

Keep ChatGPT account features with 1API.

ChatGPT sign-in keeps account features available while the API key routes model requests through 1API.

Configuration
The macOS app reads ~/.codex/config.toml. Restart the app after changing the provider settings.
API key
The key variable must be present in the app process environment. A variable exported in Terminal may not reach an app opened from Finder or the Dock.
ChatGPT account and plugins
Set requires_openai_auth = true to keep ChatGPT account authentication and account-enabled features, including plugins, available. The separate env_key sends model requests through 1API using CODEX_1API_CLUB_API_KEY. Plugin availability depends on your ChatGPT account and workspace.
CLI profile
The 1api.config.toml profile and codex --profile 1api command apply to Codex CLI only. The desktop app uses its selected model from config.toml.
Linux
Use the Codex CLI steps above. Phone Remote requires the ChatGPT desktop app on a supported macOS or Windows host.
Use Codex from your phone

In the ChatGPT desktop app on this Mac, open Settings > Connections > Control this Mac or PC and select Set up or Add. Scan the QR code with your phone, sign in to the same ChatGPT account and workspace, then open Codex (or Remote, if that label is still shown) in the ChatGPT mobile app to start or continue work on this Mac.

Remote uses the connected Mac's local projects, credentials, and Codex configuration, so model requests continue through the configured 1API provider. Keep the Mac awake and online. This setup was tested with ChatGPT app version 26.1027.61615; newer versions are expected to work.

Verify

Confirm the first task.

Start with a small coding task, then confirm the request and charge in your account.

  1. 01Run a short task with Codex CLIAsk Codex to read a test file and make one small, reviewable change.
  2. 02Check Usage in 1APIConfirm the request, model, token usage, and charge are recorded.
401
Confirm CODEX_1API_CLUB_API_KEY is available to the process that launched Codex.
Model unavailable
Use a model ID recognized by your Codex version and available to this API key.
CLI uses the wrong account
Confirm the command includes --profile 1api and that the 1api.config.toml file exists.

For model and price choices, see Pricing.