Integrations
OpenAI Codex
OpenAI's Codex CLI uses the Responses API, which Pendra
implements at /v1/responses. Add a custom provider and Codex
will route every request through Pendra.
1. Configure the provider
Add or edit ~/.codex/config.toml with a new
model_providers.pendra entry:
# ~/.codex/config.toml
model = "qwen3.6:27b"
model_provider = "pendra"
[model_providers.pendra]
name = "Pendra"
base_url = "https://api.pendra.ai/api/v1"
env_key = "OPENAI_API_KEY"
wire_api = "responses"
What each key does
| Key | Purpose |
|---|---|
model | The default model Codex uses. Pin to a Pendra model (e.g. qwen3.6:27b). |
model_provider | Which provider block to use. "pendra" matches the block below. |
base_url | Pendra's OpenAI-compatible base. Codex appends /responses. |
env_key | Which env var holds the API key. Keep this as OPENAI_API_KEY — Codex sends its value as the bearer token. |
wire_api | Must be "responses". Pendra implements OpenAI's Responses API at /v1/responses. |
2. Set the key and run
# Codex sends OPENAI_API_KEY as Authorization: Bearer
export OPENAI_API_KEY=pdr_sk_...
codex --config model_provider=pendra
The --config model_provider=pendra flag overrides any
model_provider already set in your config. Drop it if Pendra
is your primary provider.
Model selection
Set model in your config to a real Pendra model — browse the
list at /models. This is required, not
optional: Codex sometimes hard-codes OpenAI model names (e.g.
gpt-5-codex), and Pendra won't quietly serve one of your models
under a name it doesn't recognise. An unrecognised id comes back as a
404 naming the setting to change.
Troubleshooting
- 401 Unauthorized: ensure
OPENAI_API_KEYis set to yourpdr_sk_key in the same shell. - "Unsupported wire api": confirm
wire_api = "responses"exactly — both quotes are required in TOML. - 404 "Model 'gpt-5-codex' not found": Codex is still sending an OpenAI name — a config override it didn't pick up, or a per-command
--modelflag. Setmodelunder your[profiles]/top-level config to a Pendra model id.