type: "claude", the default) executes on one of three agent runtimes. All are fully managed by the Agent API: they run inside the same sandbox, expose the same task lifecycle and event stream, and are interchangeable from your perspective. You normally pick a model, and the runtime follows.
The three runtimes
Both runtimes drive the same managed sandbox, the same GitHub clone/branch/commit flow, and emit the same event contract. Switching runtime requires no client changes — only a different
model (or an explicit agent override).
Selection rule
When you omitagent, the runtime is inferred from the model id. A model runs on the Codex runtime when its id:
- contains
codex, or - contains
openai/, or - contains
/gpt-or starts withgpt-, or - starts with
o1,o3, oro4
grok-build.
Every other id runs on the Claude runtime.
Explicit override — the agent field
Pass agent on the request body to force a runtime regardless of the model id:
string
"claude", "codex", or "grok". When set, overrides the runtime inferred from model. Omit to auto-select (default: claude). An invalid value returns 400 listing the supported agents.agent: "codex"— run a non-OpenAI model on the Codex (Responses) runtime.agent: "claude"— run an OpenAI-shaped id on the Claude (Messages) runtime.agent: "grok"— run a model on the Grok Build (Chat Completions) runtime.
agent field is accepted by POST /api/v1/tasks and POST /api/v1/benchmarks/runs.
Continuation —
POST /api/v1/tasks/:id/continue follows an inheritance rule: omit both model and agent to inherit the original run’s model and runtime; if you change model (or the runtime), you must pass agent explicitly. This lets a follow-up keep a codex+opus override intact, while making any runtime change explicit.Event stream contract
Both runtimes emit the same event types overGET /api/v1/tasks/:id/logs/stream and GET /api/v1/agent/stream. Your stream-consuming code does not need to know which runtime produced the events.
Codex specifics
- Wire protocol — the Codex runtime talks to the router’s OpenAI Responses API (
/v1/responses). Codex models are configuredmode: responsesend-to-end. - Reasoning — pass
reasoning.effort(minimal|low|medium|high) the same way you would on the Responses API; it is honored by the Codex runtime. - Tool use — Codex executes shell/file work via
command_execution; these surface through the sametool-call-start/tool-output-availableevents as Claude’s tools.
Managed sandbox & SDKs
Both runtimes run inside the same managed Vercel sandbox. The SDKs are provisioned for you — you never install anything:Examples
taskId, runId, chatId, …) and every downstream endpoint — status, logs, files, continue, cancel — are identical across runtimes.
Create a Task
Start a task; pass
model and optional agent.Models
Full model list with per-model runtime mapping.
Stream Task Logs
The shared SSE event stream for both runtimes.
Benchmarks
Run benchmarks on either runtime via the same
agent field.