rpk ai run codex
Launch the OpenAI Codex CLI with its model traffic routed
through the Redpanda AI gateway for the current rpk ai environment.
rpk ai generates a throwaway Codex config in a temporary CODEX_HOME, points it at
the gateway’s OpenAI-compatible Responses endpoint for the chosen provider, and
authenticates Codex with an Agentic Data Plane API key. A stored key is read through
rpk ai auth api-key; an explicitly provided key stays in the child process
environment. Your own ~/.codex config is never read or modified, and no key is
written to config.toml. Account sign-in credentials serve only provider reads
and API-key management, never model invocation. If key acquisition fails,
rpk ai refuses to launch. --api-key=no requires an already provided Agentic Data Plane API key.
The launch directory is auto-trusted under a workspace-write sandbox
(approval_policy=on-request) so the fresh CODEX_HOME doesn’t prompt for trust on
every run; pass --no-auto-trust to keep Codex’s normal first-run trust prompt.
Only openai / openai_compatible providers are supported (Codex speaks the OpenAI Responses API). Pass Codex’s own flags after a literal --:
rpk ai run codex -L openai -m gpt-5.3-codex -e high -- --ask-for-approval never
Flags
| Value | Type | Description |
|---|---|---|
|
string |
authenticate the session with an Agentic Data Plane API key: ask (ask before creating one), yes (create one without asking, also without a terminal), no (do not create a key; require an already provided Agentic Data Plane API key). |
|
string |
persistent CODEX_HOME dir (default: a throwaway temp dir); its config.toml is regenerated each run and the dir is tightened to 0700; your real |
|
string |
model reasoning effort: minimal|low|medium|high (omit to let Codex use its default). |
|
string |
aigw LLM provider name to route through (must be openai/openai_compatible). |
|
string |
model id to use (must be in the provider’s allowlist); omit to let Codex pick its default. |
|
bool |
do not pre-trust the launch directory; let Codex show its normal first-run trust prompt instead (default: the launch dir is auto-trusted under a workspace-write sandbox). |
|
bool |
print the generated Codex config.toml and exit (no gateway call, no codex needed). |
Global flags
| Value | Type | Description |
|---|---|---|
|
string |
Redpanda or |
|
stringArray |
Override |
|
bool |
Ignore |
|
string |
|
|
bool |
Enable verbose logging. |