# Codex CLI > Run OpenAI's Codex CLI and the Codex extension against the gateway. _Source: https://aiprimetech.io/docs/guides/codex-cli/ · Home > Docs > Integration guides_ Codex CLI reads the standard OpenAI environment variables, so redirecting it needs no patch. ```bash export OPENAI_BASE_URL="https://aiprimetech.io/v1" export OPENAI_API_KEY="sk-your-key" codex ``` ## Config file ```bash # ~/.codex/config.toml model = "gpt-5.5" model_provider = "claudeapikey" [model_providers.claudeapikey] name = "ClaudeAPIKey.dev" base_url = "https://aiprimetech.io/v1" env_key = "OPENAI_API_KEY" ``` Both GPT and Claude ids work here — the gateway translates, so you can run Codex CLI against `claude-sonnet-4-6` if you prefer it. > Codex is an agent and streams heavily. If output arrives in one lump rather than progressively, a proxy between you and the gateway is buffering — see [Streaming](/docs/api-reference/streaming/). - [Chat Completions](https://aiprimetech.io/docs/api-reference/chat-completions/) — Endpoint reference - [Models](https://aiprimetech.io/docs/getting-started/models/) — GPT and Claude ids --- _ClaudeAPIKey.dev is an independently operated, Anthropic-compatible API gateway. Not affiliated with Anthropic._