HomeDocsagents/codex
Gateway Protocol v1 · Production Reference

Documentation

One key, two compatible wire protocols, 15 frontier models. Read the quickstart or explore the API reference.

Coding agents · Codex

Codex (by ChatGPT)

Codex is OpenAI's agentic coding CLI. Point it at the Selora gateway from a single config.toml provider block — set a base URL and your key, then launch.

Create an API key on the API Keys page and export it as $SELORA_API_KEY before continuing.

1

Install Codex

Install the Codex CLI, then verify it is on your PATH.

Install
npm install -g @openai/codex

You can also install via homebrew (brew install codex) or the official installer. Codex needs an OpenAI-compatible gateway.

2

Add the gateway as a provider

Open ~/.codex/config.toml and add a provider block that points at the gateway. Point the base URL at the OpenAI-compatible endpoint and set the env var that carries your Selora key.

~/.codex/config.toml
[model_providers.selora]
name = "Selora"
base_url = "https://api.selora.lol/v1"
env_key = "SELORA_API_KEY"
wire_api = "responses"
requires_openai_auth = false

[profiles.selora]
model = "gpt-6-astra"
model_provider = "selora"

Set SELORA_API_KEY in your shell. wire_api = "responses" is what current Codex builds require for custom providers — the official config reference lists responses as the only supported value, and it targets /v1/responses. "chat" (/v1/chat/completions) still works but only on older pinned builds, so treat it as legacy. Both wires carry full tool-calling (tools, tool_choice, role:"tool" results, streaming tool_calls deltas), so Codex works as a real agent, not just plain chat. If you use CCSwitch to manage this config, see the CCSwitch guide — it has known bugs that break the generated config, and the selora-setup.mjs script fixes them in one command. Reserved provider names like openai, ollama and lmstudio take precedence and cannot be overridden.

3

Run it

Launch Codex against the Selora profile. It will call models over the gateway.

Launch
export SELORA_API_KEY="sk-gw-..."
cd /path/to/project
codex --profile selora