OpenAI / Codex Provider
OpenAI/Codex model provider configuration.
Rensei integrates with OpenAI's reasoning models via the Codex CLI. The Codex provider is optimized for code generation, reasoning, and complex problem-solving tasks.
Provider Summary
| Attribute | Value |
|---|---|
| Provider ID | codex |
| Display name | OpenAI Codex |
| Config namespace | openai |
| Supported auth modes | byok, metered, shared, host-session |
| Requires endpoint | No |
| Category | Cloud |
A model profile may include any subset of these modes in its auth_modes array. The resolver prefers byok > metered > shared > host-session. The effective allowed set is filtered by the org and project access policy. See Auth Modes for the resolution algorithm.
Available Models
Rensei's catalog includes:
- GPT-5 (
gpt-5) - Latest OpenAI reasoning model. Up to 128K context window. - GPT-4 (
gpt-4o) - High-capacity reasoning model. 128K context window.
The Codex provider routes these models through the OpenAI Codex CLI, which adds reasoning and extended thinking capabilities.
Check rensei catalog list --provider codex to see the current list.
Auth Modes
BYOK
Bring your own OpenAI API key:
- Get an API key from platform.openai.com/api-keys.
- In Settings → Integrations, click Add Provider and select OpenAI / Codex.
- Paste your API key and click Test Connection.
- In Settings → Model Profiles, create a profile with auth mode
byokand select an OpenAI model.
Your org is billed directly by OpenAI.
Metered
Platform supplies a managed API key. Your org is billed through Rensei's cost ledger. Metered mode must be enabled for your organization by the platform operator - see Auth Modes for details.
Setup (user):
- In Settings → Model Profiles, create a profile with auth mode
meteredand an OpenAI model. - Dispatch runs if your org is entitled; contact Rensei support to enable metered mode.
Shared
Free-tier platform key for trials. No setup required; quota is soft-limited per org per day.
- In Settings → Model Profiles, create a profile with auth mode
sharedand an OpenAI model. - Dispatch runs if quota allows; returns
SHARED_QUOTA_EXCEEDEDotherwise.
Host-Session
Use OAuth credentials already logged in on your developer machine.
- Run
rensei setupand authenticate with OpenAI. - In Settings → Model Profiles, create a profile with auth mode
host-session. - Dispatch from the same machine where you ran
rensei setup.
Note: Only works with local capacity pools (providerId='local'). Dispatching to cloud sandboxes (e2b, Vercel, Modal) will fail.
Configuration
Context Window Override
By default, Rensei uses the model's native context window. Override at dispatch time:
{
"providerConfig": {
"openai": {
"contextWindow": 64000
}
}
}This is useful if you want to limit tokens for cost or latency reasons.
Service Tier
Control request routing priority:
{
"providerConfig": {
"openai": {
"serviceTier": "auto"
}
}
}Options:
auto- Default; OpenAI optimizes routing.fast- Prioritized; higher cost.flex- Flexible; lower cost.
Reasoning Budget
GPT-5 and GPT-4o support configurable reasoning effort via extended thinking:
- low - Quick answers with minimal reasoning overhead.
- medium - Balanced; default reasoning depth.
- high - Extended thinking for complex problems.
Set reasoning effort in the profile's Reasoning Effort dropdown or via API:
{
"effort": "high"
}Example Profile: Code Generation
rensei profile create \
--name "openai-code-generation" \
--provider codex \
--model-id "gpt-5" \
--auth-mode byok \
--scope project \
--project-id my-projectThen in a workflow LLM node:
nodeId: code_generation
nodeType: action/llm.inference
config:
profileId: prof_openai_code_generation
systemPrompt: "You are an expert software engineer. Generate clean, tested code."
tools:
- type: "code_execution"
enabled: truePricing
View pricing in the model catalog:
rensei catalog show gpt-5 --format json | jq .pricingExample:
{
"inputPerMTokenCents": 2.50,
"outputPerMTokenCents": 10.00
}GPT-5 is more expensive than GPT-4 but offers superior reasoning. Use work-type routing to keep GPT-5 only for reasoning-heavy stages (QA, acceptance).
For metered mode, cost events are automatically emitted with the org ID for billing.
Troubleshooting
"No metered key is configured for provider 'codex'"
The platform's metered key pool for OpenAI is not configured. Contact your Rensei operator - deployment-level key pool setup is covered in the operator docs.
"Organisation is not entitled to use metered auth mode"
The org's metered_enabled feature flag is not set. Contact Rensei support to enable metered mode for your organization.
"AUTH_MODE_REQUIRES_LOCAL_CAPACITY"
You're dispatching a host-session profile to a cloud sandbox. Use a cloud-compatible auth mode (BYOK, metered, shared) or dispatch to a local pool.
Model not found in catalog
The model ID is correct but not in your catalog yet. Add it:
rensei catalog create \
--provider codex \
--model-id "gpt-5" \
--display-name "GPT-5"Request rate-limited
If you're hitting OpenAI rate limits, reduce request frequency or upgrade your OpenAI account tier. For metered mode, contact support to increase quota.
Further Reading
- Auth Modes - Full auth mode reference
- Model Catalog & Routing - Catalog management and work-type routing
- OpenAI Documentation - Official API reference