API429 / Codex CLI

Codex CLI with API429: custom provider profile and Responses API setup

Codex CLI supports custom model providers defined in user configuration tables and selected with an explicit profile flag. For API429, this guide configures the OpenAI Responses API path with gpt-6.1-sol, environment-based key reading and disabled automatic retries before you run a bounded terminal check.

Configuration is based on the application’s public documentation and the API429 contract. Native client execution, installation imports and agent workflows have not been verified here. Start with a short non-sensitive request and inspect the response in your installed version.

Connection settings

Protocol
OpenAI Responses
Connection mode
Dedicated Codex provider profile
Base URL
https://gateway.api429.com/v1
Exact model ID to check
gpt-6.1-sol

Check access for your key with GET /v1/models. A public model card does not guarantee availability in your application. Store the key in the application’s secure credential store or the current session environment. Keep secret values out of command arguments and shared project files.

Pin the CLI version and add an isolated provider profile

Review the system requirements in the official Codex CLI documentation before installing, then verify the binary with codex --version. On the review date, version 0.164.0 of @openai/codex was observed in npm; that version number records the inspected package rather than a live execution test across every operating system. The installation snippet pins 0.164.0 so future package updates do not silently alter configuration keys or provider behavior while you set up the connection.

Back up your existing ~/.codex/config.toml before editing and merge the two TOML tables into the file manually. Do not overwrite the entire file or erase saved authentication for other profiles. The profiles.api429 table selects the model and model_provider name, while model_providers.api429 defines the endpoint and transport rules. If those table names already exist in your configuration, inspect them first and launch the client explicitly with codex --profile api429.

Configure the Responses API contract and transport flags

Set base_url to https://gateway.api429.com/v1 and set wire_api to responses. With these settings, Codex CLI sends requests to POST /v1/responses rather than the Chat Completions route. Do not change wire_api to chat as a troubleshooting workaround: Chat Completions uses a different payload schema and does not satisfy the Responses contract expected by this profile. The canonical API429 public OpenAPI checked on October 25 documents POST /v1/responses with model and string input. Its minimal schema does not establish array input or client-executed tool support. Codex may require richer payloads and streaming events; confirm a current contract for those exact features before launching this candidate profile.

Keep this protocol distinct from other terminal coding clients. Whereas Codex CLI uses POST /v1/responses under a /v1 base URL and Bearer authentication, Claude Code CLI uses the Anthropic Messages contract at POST /v1/messages with an origin base URL that omits /v1 and sends x-api-key. Copying environment variables or base URLs between Claude Code and Codex CLI without matching each client's wire protocol will cause routing or authentication failures.

Supply the API key through env_key and disable retries

In model_providers.api429, set env_key to API429_API_KEY and set requires_openai_auth to false. The false setting is mandatory when reading a custom provider key from an environment variable: leaving requires_openai_auth set to true switches the client back to OpenAI account authentication and ignores env_key. In the Bash example, read -r -s collects the secret into the current shell session without echoing it into your terminal history or process arguments, and unset removes it after exit.

Set supports_websockets to false so the client stays on the documented HTTP request path instead of attempting an unverified WebSocket transport. Set both request_max_retries and stream_max_retries to 0. Disabling automatic client retries prevents a single rejected request or stream interruption from triggering repeated paid attempts in the background, though you remain responsible for controlling manual reruns and subsequent interactive turns.

Run a bounded first check and diagnose protocol errors

Start in an empty disposable directory that contains no credentials or proprietary source files. Before launching the CLI, check GET /v1/models with your API429 key to confirm that gpt-6.1-sol is available to that specific credential; a public catalog card shows what is published on the platform, whereas the authenticated model list confirms key-level access. Send one short nonconfidential text prompt first without asking the agent to edit files or run shell commands.

If you receive a 401 error, verify that API429_API_KEY is exported in the same shell and that codex was started with --profile api429, without printing the secret value. For a 404 error, verify that base_url ends with a single /v1 so the final path resolves to /v1/responses. If a plain text turn succeeds but an agent step fails, inspect the redacted SSE event or client-executed tool payload before retrying, and do not enable hosted tools, Fast, Flex or WebSockets.

Control token spend and understand max_output_tokens limits

Interactive coding sessions can issue multiple requests as the client reads files, emits intermediate reasoning or processes tool outputs, so total token volume is not fixed in advance. In addition, the public API429 reference notes that max_output_tokens is not applied on the current GPT route. Do not treat a token output setting in Codex CLI as a hard spend cap or budget enforcement mechanism for your session.

After your initial single-turn check, inspect the recorded token usage and model ID in your API429 account before starting a multi-file task. Set clear manual stopping rules for long sessions. Application subscriptions, vendor account tiers and API429 request billing remain separate commercial arrangements; configuring a custom provider profile connects the terminal client to the documented Responses endpoint without promising every native subscription feature.

Settings and examples

Pin the reviewed CLI version in an isolated install

npm install -g @openai/codex@0.164.0
codex --version

Merge these tables into your user config.toml while keeping existing profiles

[profiles.api429]
model = "gpt-6.1-sol"
model_provider = "api429"

[model_providers.api429]
name = "API429"
base_url = "https://gateway.api429.com/v1"
env_key = "API429_API_KEY"
wire_api = "responses"
requires_openai_auth = false
supports_websockets = false
request_max_retries = 0
stream_max_retries = 0

Bash: hidden API key input and explicit profile launch

read -r -s -p "API429 key: " API429_API_KEY
printf "\n"
export API429_API_KEY
codex --profile api429
unset API429_API_KEY

Usage and next steps

Hypothetical hourly workload: 30 requests to gpt-6.1-sol, each with 5,000 ordinary input and 512 output tokens, costs approximately $0.14 at current API429 rates. Cache, tools, retries, application subscriptions and other fees are excluded. Catalog date: .

Actual usage depends on request count, context length and response size. Check your API429 account for actual charges.

API reference · API429 documentation · Help and diagnostics

Payment and a $10 test

  • Russian bank card. Top up your balance in the account.
  • Invoice for companies. Bank transfer with closing documents.
  • USDT and TON. Top up in crypto.

$10 test credit. Subscribe to our Telegram channel through the bot and get $10 on your balance for the first requests. Get $10 in the bot

Frequently asked questions

Why should I launch Codex CLI with the --profile api429 flag?

Passing --profile api429 explicitly selects the profiles.api429 table that points to model_providers.api429, preserving your default configuration and any saved login for other providers.

Can I set wire_api to chat or reuse Claude Code settings?

No. This Codex CLI profile requires wire_api = "responses" over https://gateway.api429.com/v1, which targets POST /v1/responses, whereas Claude Code targets Anthropic POST /v1/messages without /v1.

Does max_output_tokens cap my Codex CLI spending on this route?

No. The API429 reference notes that max_output_tokens is not enforced on the current GPT route, and multi-turn agent actions can send multiple requests. Monitor actual usage in your account.

Are full Codex agent tool loops and hosted tools verified here?

This guide verifies the public custom-provider configuration and the documented POST /v1/responses contract with client-executed tools. Live CLI end-to-end runs, hosted tools and WebSockets were not executed.

Sources

The application documentation defines its interface and limitations; API429 documentation defines addresses, authentication and client methods. Connection configuration checked: .

Telegram