Skip to main content
Codex CLI can connect to derestricted.ai through a custom model provider using the Responses API.

Before you start

Install Codex CLI, then create a key in the console. New verified accounts receive $5 in starting credit. Set your key in the terminal that will launch Codex:

Add the provider

Merge this configuration into your user ~/.codex/config.toml. Keep the first four settings above any TOML table headers. Provider settings in a project’s .codex/config.toml are ignored by current Codex versions. See the official configuration reference.
This uses your derestricted key instead of OpenAI authentication. The endpoint speaks HTTP with streamed responses; hosted web search is unavailable. The provider fields follow OpenAI’s custom provider documentation.

Start Codex

Open a project directory and run:
Start with a small request, such as “Explain this repository’s entry point.” Keep Codex’s normal approval settings for commands and file edits.
This is a compatibility endpoint, not the OpenAI service. Responses are stateless, and hosted tools, image input, reasoning controls, and server-side conversation storage are unavailable. Custom tool formats depend on the Codex version. See Responses compatibility before relying on a specific agent feature.

If something fails

  • Missing key: launch Codex from the terminal where DERESTRICTED_API_KEY is set.
  • Wrong provider: check your user configuration and any selected configuration profile. Use the custom derestricted provider ID.
  • Invalid wire_api: current Codex supports responses; do not change it to chat.
  • Unsupported tools or oversized requests: use a smaller task and review API compatibility and the error guide.