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
# ~/.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

KeyPurpose
modelThe default model Codex uses. Pin to a Pendra model (e.g. qwen3.6:27b).
model_providerWhich provider block to use. "pendra" matches the block below.
base_urlPendra's OpenAI-compatible base. Codex appends /responses.
env_keyWhich env var holds the API key. Keep this as OPENAI_API_KEY — Codex sends its value as the bearer token.
wire_apiMust be "responses". Pendra implements OpenAI's Responses API at /v1/responses.

2. Set the key and run

bash
# 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

Codex sometimes hard-codes OpenAI model names (e.g. gpt-5-codex). Pendra falls back to an available chat model when it sees an unknown OpenAI name, but the cleanest path is to set model in your config to a real Pendra model — browse the list at /models.

Troubleshooting

  • 401 Unauthorized: ensure OPENAI_API_KEY is set to your pdr_sk_ key in the same shell.
  • "Unsupported wire api": confirm wire_api = "responses" exactly — both quotes are required in TOML.
  • Unexpected model name in usage: Codex sometimes sends the OpenAI name even with a config override. The Pendra console shows the model that actually served the request alongside the originally-requested name.

Related