The OpenClaw Codex harness is the official @openclaw/codex plugin: it hands an OpenClaw agent turn to OpenAI's Codex app-server so that Codex owns the model loop, thread resume, tool continuation and compaction. It is not a coding-delegation product, not a billing layer, and — the part that trips up most setups — not a way to run Codex against a third-party API endpoint. Which of those you actually need is the decision this page exists to make.
Dates first, so nothing here is undated. The npm package openclaw is at 2026.9.5 and requires Node >=24.16.0 <25 || >=26.1.0; @openclaw/codex is at 2026.9.5, published September 18, 2026. Both read from the registry on September 21, 2026. Three unrelated projects share these names and none of their numbers belong here: pjasicek/OpenClaw describes itself as a reimplementation of the 1997 platformer Captain Claw, the bare npm package codex is a "static site and code documentation generator" last published in 2012, and OpenAI's CLI is @openai/codex (0.155.1 on the same date).
Five OpenClaw surfaces share the name "Codex"
OpenClaw's agent-runtimes documentation calls these "intentionally independent". Picking the wrong one is the most common reason a configuration looks correct and does nothing.
| Surface | What it is | You want it when |
|---|---|---|
| Codex harness (native runtime) | The @openclaw/codex plugin executing openai/* turns through Codex app-server | You want Codex's own model loop, threads and compaction |
| Codex OAuth auth profiles | openai OAuth credentials | You are signing in with a ChatGPT or Codex subscription |
| Codex ACP adapter | Runtime acp, agent id codex | You are using the ACP carrier, with its own commands |
/codex … chat commands | The control surface for a bound native session | You need to steer, stop, resume or rebind a live turn |
| OpenAI Platform API route | Non-agent surfaces: images, realtime and similar | The call is not an agent turn at all |
A sixth name is not OpenClaw's at all. openclaw-code-agent is a third-party plugin that runs background coding sessions with plan approval and worktree isolation; its own README states it is separate from OpenClaw's bundled acpx runtime plugin and bundled core codex plugin. If you came here wanting delegation rather than a runtime swap, that is a different product with different config keys.
Turning the harness on, and proving it is on
The documented path is two commands — the plugin, then the sign-in.
openclaw plugins install @openclaw/codex
openclaw models auth login --provider openaiThen the minimum configuration. If you use a plugins.allow list, add "codex" to it as well.
{
plugins: {
entries: {
codex: {
enabled: true,
},
},
},
agents: {
defaults: {
// The docs' own example ref. Legacy codex-cli/* refs are
// repaired to the same openai/<model> route by doctor --fix.
model: "openai/gpt-6-astra",
},
},
}Two details the harness documentation is explicit about. Plugin config changes apply automatically in hybrid reload mode, but an existing chat needs /new or /reset first so the next turn resolves the harness from current config. And the effective tool profile must allow native shell and filesystem capabilities: coding and full do, while messaging and minimal disable the native surface. An ordinary OpenClaw sandbox or restricted tool policy is a narrower cut in the same documentation — it disables native code mode unless you opt into the experimental sandbox exec-server path — and when sandboxing does disable the native surface, allowed shell commands remain reachable through sandbox_exec.
Version requirements, checked September 21, 2026 against the app-server transport reference: the plugin manages stable Codex app-server 0.154.0, while explicit custom executables, remote app-servers and macOS desktop binaries must report a parseable semantic version of 0.149.0 or newer. npm's latest @openai/codex is 0.155.1 the same day, so the managed pin sits one patch behind — which is why any tutorial saying "Codex latest" without a date goes stale within days. Migrating an older setup matters too: the agent-runtimes page says OpenClaw's bundled Codex CLI backend was removed in v2026.5.14, and that legacy codex-cli/* refs repair to the same openai/<model> Codex app-server route under openclaw doctor --fix, which owns legacy Codex route repair generally.
To verify: a Codex-backed turn reports Runtime: OpenAI Codex under /status, and /codex status, /codex models and /codex binding inspect app-server state. A lint — openclaw doctor --lint --only codex/managed-app-server --json — checks the managed binary, but the docs describe it as read-only and put a selected Codex Desktop binary, an explicit custom command and a remote app-server outside that package check.
One tension worth knowing before you build on this. OpenAI's own app-server documentation states that "the app-server command and WebSocket transport are experimental and aren't supported for production workloads" — note that the warning names the command as well as the transport. OpenClaw builds a shipped feature on top of that command, and its transport field defaults to stdio, with websocket used only when you configure a url. Both statements are true at once; decide with both in view.
Delegation artifacts, permissions, cancel and resume
The harness documentation is honest about the limits of what a native subagent's status proves: execution, task result and result delivery are separate facts, an idle, interrupted or unloaded native thread does not prove the task succeeded, and when close confirmation is unavailable the task asks you to retry the close. Native Codex subagents are Codex's own mechanism — explicit OpenClaw or ACP delegation still goes through sessions_spawn.
Per the plugin's config-field table, execution permissions for the app-server OpenClaw spawns default to mode yolo, approval policy never and sandbox danger-full-access, unless local Codex requirements disallow that posture, in which case guardian defaults prefer on-request approvals and workspace-write, otherwise read-only; requestTimeoutMs, the timeout for app-server control-plane calls, defaults to 60000. These are OpenClaw's defaults for the process it launches, not Codex CLI's own, and on an unfamiliar repository that first default is the setting to review before the first run.
Control during a turn is native: /codex stop, /codex steer, /codex resume, /codex detach, /codex bind, /codex compact, /codex threads, /codex goal, /codex model, /codex fast and /codex permissions. A restricted turn is per-turn rather than a session mode, and it disables native Code Mode, environment selections, configured MCP servers and native hook relays for that turn only. OpenClaw's runtime v1 support contract also lists as unsupported: native tool-argument mutation (pre-tool hooks can block, but OpenClaw does not rewrite the arguments), an editable Codex-native transcript history, compaction intervention, and byte-for-byte model API request capture — so if your audit requirement is the exact outbound request, this runtime cannot supply it.
Authorization, plan entitlement and token spend are three different things
| Question | What the Codex harness actually does |
|---|---|
| Which credential is used? | An explicit or ordered OpenClaw auth profile for the agent first; for an API-key route only, a prepared key or local stdio fallback from CODEX_API_KEY, then OPENAI_API_KEY |
| Can an API key leak into a subscription turn? | No — on a ChatGPT subscription-style profile, OpenClaw removes CODEX_API_KEY and OPENAI_API_KEY from the spawned Codex child process |
| Does a remote app-server inherit Gateway keys? | No — WebSocket app-server connections do not receive the Gateway environment API-key fallback; use an explicit auth profile or the remote server's own account |
| Whose Codex login is used? | By default OpenClaw sets CODEX_HOME to a per-agent directory; appServer.homeScope: "user" is the explicit opt-in to share native state with Codex Desktop and the CLI |
| Is a diagnostic a billing record? | No — the documentation states that /status and /codex binding do not establish the service tier or charge actually applied to a completed request |
| Then where is the spend? | The provider's own usage and spending controls, plus codex.accountUsage, which reads live quotas for a selected saved subscription login and requires operator.admin |
Read from OpenClaw's Codex app-server policy page on September 21, 2026. One naming trap sits on top of this: OpenAI's API pricing page says Priority processing was renamed Fast mode on July 30, 2026 and that you can send service_tier of either "priority" or "fast", while OpenClaw's appServer.serviceTier documents "priority" and "flex" and normalizes a legacy "fast" to "priority" — the opposite direction. "Turn on fast mode" means different things in the two systems.
Why a third-party endpoint leaves the harness
This is the single fact most third-party write-ups get backwards. OpenClaw's implicit agent runtime table, for a provider or model runtime that is unset or auto:
| Effective route facts | Implicit runtime |
|---|---|
Exact official Platform HTTPS endpoint with openai-responses, or exact official ChatGPT HTTPS endpoint with openai-chatgpt-responses, no authored provider request override | Codex may be selected |
Authored openai-completions adapter | OpenClaw |
| Custom endpoint | OpenClaw |
| Explicit exact official endpoint using plain HTTP | Rejected |
| Route with an authored provider or model request override | OpenClaw |
So pointing OpenClaw at any third-party base URL — Kunavo included — puts the turn on OpenClaw's built-in runtime, by design. The openai/* prefix alone never selects the harness, and forcing agentRuntime.id: "codex" does not rescue it. The runtimes page says that setting "requires a registered Codex harness; unsupported routes/auth fail closed, except that authored request overrides may use Codex's declared exact-request OpenClaw fallback before execution" — so the two outcomes are a failed turn or an OpenClaw turn, and neither is Codex on a custom endpoint. The plugin's documented config fields carry no model base-URL setting either; the one url field there is the app-server's own WebSocket or unix:// address. Whether appServer.args could smuggle a provider override into the managed app-server is undocumented and untested; this page does not present it as a workaround.
A built-in-runtime route also reshapes the request, and OpenClaw's custom-provider page is specific about the scope of each rule. For api: "openai-completions" on a non-native endpoint — which it defines as any non-empty baseUrl whose host is not api.openai.com — OpenClaw forces compat.supportsDeveloperRole to false, and overrides an explicit true. Separately, proxy-style OpenAI-compatible routes "skip native OpenAI-only request shaping": no service_tier, no Responses store, no Completions store, no prompt-cache hints, no OpenAI reasoning-compat payload shaping and no hidden attribution headers. With no service_tier on the wire, Fast mode and Flex are not selectable on such a route. What that same page offers instead is params.extra_body pass-through for OpenAI-compatible Completions proxies, per-provider headers, and models.providers.<id>.timeoutSeconds for slow or remote hosts.
Codex itself is the other half of the story, and it is more permissive: Codex's advanced-config page shows ~/.codex/config.toml supporting [model_providers.<id>] with base_url and env_key. But there is a hard gate — the config reference states that for model_providers.<id>.wire_api, "responses is the only supported value, and it is the default when omitted". An endpoint that serves only Chat Completions therefore cannot drive Codex. The same advanced-config page reserves the built-in ids openai, ollama and lmstudio, and lists model_provider and model_providers among the keys Codex ignores in a project-level .codex/config.toml, so provider keys belong in user-level config. Kunavo implements a native Responses surface at /v1/responses, which is what makes the Codex CLI setup possible — but that is standalone Codex CLI, not the OpenClaw harness, and Kunavo has not runtime-tested either client.
What the software costs, and what the tokens cost
OpenClaw itself is $0. Its documentation index describes the project as MIT-licensed, community-driven, developed by an independent 501(c)(3) foundation, with "No paid tier"; @openclaw/codex is published on the public npm registry at no charge. Every real cost is the machine you run the Gateway on plus model usage, and model usage arrives by one of three contracts.
| Route | Published price | What it gets you |
|---|---|---|
| ChatGPT Free | $0 / month | Codex on quick coding tasks |
| ChatGPT Go | $8 / month | Codex for lightweight coding tasks |
| ChatGPT Plus | $20 / month | Codex on web, CLI, IDE extension and iOS |
| ChatGPT Pro | From $100 / month | 5x or 20x more Codex usage than Plus |
| ChatGPT Business | $20 / user / month, 2+ users billed annually ($25 billed monthly) | ChatGPT and Codex across desktop and mobile |
| Enterprise & Edu | Contact sales | No published figure |
| OpenAI API key | No subscription fee; standard API rates | Codex in CLI, SDK and IDE extension — no cloud features such as GitHub code review or Slack |
From OpenAI's Codex pricing page, checked September 21, 2026. Three caveats belong with that table. The pricing card publishes only "From $100" for Pro; OpenAI's separate About ChatGPT Pro tiers article names a higher $200 tier whose new sign-ups and upgrades are paused as of September 10, 2026, so confirm at checkout rather than budgeting a number this page did not see on a pricing card. Included usage is published only as estimated ranges of local messages per five-hour period, not as a fixed message count. And credit rates after included limits are published in credits per million tokens, with no dollar value for a credit on that pricing page — so it supplies no dollar conversion for that row. Separately, GPT-5.5 retires from ChatGPT, ChatGPT Work and Codex on all plans on October 14, 2026, while the OpenAI API is not affected.
The third contract is a gateway on OpenClaw's built-in runtime. Assume one delegated turn that sends 180,000 uncached input tokens and receives 9,000 output tokens; rates are live Kunavo catalog prices per million tokens.
| Model | Input / output per 1M | Estimate for one turn | Estimate, 40 turns |
|---|---|---|---|
| GPT-6 Astra | $4.00 / $20.00 | $0.900 | $36.00 |
| GPT-5.6 Sol | $2.00 / $12.00 | $0.468 | $18.72 |
| GPT-5.6 Terra | $0.70 / $4.20 | $0.164 | $6.55 |
| GPT-5.6 Luna | $0.07 / $0.42 | $0.016 | $0.66 |
These are illustrative token arithmetic, not measured task costs and not a bill ceiling — the turn shape is an assumption, and a real agent turn re-sends context on every tool round trip. Kunavo's catalog amount is a billing floor rather than a cap: when the upstream reports its charge, the bill is the greater of catalog cost and upstream cost times the applicable markup. Cache charges and external tools sit outside the example. The minimum top-up is $10 in prepaid credit, which funds a balance rather than buying a plan — see billing details.
Kunavo serves no embedding model, no text-to-speech model and no speech-to-text model. Those steps are not served by Kunavo on any route, so take them to a provider that offers them.
That boundary matters here because the surfaces table above keeps a non-agent OpenAI Platform route separate from the harness, and a Gateway key covers only the chat models in the Kunavo catalog.
Which route wins when
| You want | Choose | What you give up |
|---|---|---|
| Codex's own loop, threads and compaction inside OpenClaw | The harness on an official endpoint with a subscription or OpenAI API-key profile | No third-party endpoint, and no byte-for-byte request capture in runtime v1 |
| Flat-rate heavy daily coding | A ChatGPT or Codex subscription | Included usage is published as estimates, not guarantees |
| One key and one balance across model families | A gateway on OpenClaw's built-in runtime | The Codex harness, service_tier, prompt-cache hints and the developer role |
| Codex CLI itself on a cheaper endpoint | A [model_providers.<id>] block in user-level ~/.codex/config.toml | Cloud features, and any endpoint that cannot serve wire_api = responses |
| No per-request charge on small or private work | A local model on OpenClaw's built-in runtime | Frontier capability, plus the hardware to run it |
If the answer is the gateway row, start at the Codex CLI integration for the Responses-API shape, compare options in the best API for OpenClaw and the best API for Codex, and create a Kunavo account when you are ready to fund a key. For the budget side of a self-hosted assistant, OpenClaw pricing separates software, hosting and model spend.
FAQ
What is the OpenClaw Codex harness?
It is the official @openclaw/codex plugin, described on npm as the OpenClaw Codex app-server harness and native session supervision plugin. When it is enabled and the route qualifies, an OpenClaw agent turn on an openai/* model ref is executed by OpenAI's Codex app-server instead of by OpenClaw's own runtime. Codex then owns the model loop, thread resume, tool continuation and compaction, while OpenClaw keeps channels, session files, model selection, dynamic tools, approvals, media and the transcript mirror. It is a runtime swap, not a coding-delegation product and not a billing layer. Checked against OpenClaw's Codex harness documentation on September 21, 2026.
Is @openclaw/codex bundled with OpenClaw, or do I install it?
Install it. OpenClaw's own documentation uses both phrasings — one page calls it the bundled codex plugin, while the Codex harness requirements say the official @openclaw/codex plugin installed and the quickstart runs `openclaw plugins install @openclaw/codex`. The npm registry settles it for the npm route: version 2026.9.5 of the openclaw package lists no dependency whose name contains codex (checked September 21, 2026), so nothing in that tree pulls the plugin in. Other distribution channels, such as installer scripts or container images, were not checked here. Run the install command and treat a preinstalled copy as a bonus.
Can the OpenClaw Codex harness run against a custom API base URL?
No, not on any documented path. OpenClaw's implicit-runtime table sends a custom endpoint to OpenClaw's own runtime, and so does an authored openai-completions adapter or any authored provider request override; only an exact official Platform or ChatGPT HTTPS endpoint with no authored override is a route where Codex may be selected. Forcing it does not help either — with agentRuntime.id set to codex, unsupported routes and auth fail closed, and the one documented exception is that an authored request override may use Codex's declared exact-request OpenClaw fallback, which is still an OpenClaw turn. The plugin's documented config fields also carry no model base-URL setting; its url field is the app-server's own WebSocket or unix:// address, not an API endpoint. So a third-party endpoint in OpenClaw is a built-in-runtime route by design: you still get the model, you do not get the Codex harness. Read from OpenClaw's runtime and Codex harness documentation on September 21, 2026.
Does an OpenAI API key replace a ChatGPT or Codex subscription in OpenClaw?
Not for everything, and the two routes are separate contracts. OpenAI's Codex pricing card says an API key gives you Codex in the CLI, SDK or IDE extension with usage charged at standard API rates, but no cloud-based features such as GitHub code review or Slack, and model availability follows the API models on that key. Inside OpenClaw the separation is enforced in code: when it sees a ChatGPT subscription-style Codex auth profile, it removes CODEX_API_KEY and OPENAI_API_KEY from the spawned Codex child process, so a native turn cannot silently bill through the API instead. Environment-variable fallback is also an API-key-route-only path, and WebSocket app-server connections never receive the Gateway environment fallback at all. Checked September 21, 2026.
How do I tell whether a turn actually ran on Codex, and what it cost?
For the runtime question, /status on a Codex-backed turn reports Runtime: OpenAI Codex, and /codex status, /codex models and /codex binding inspect app-server state; `openclaw doctor --lint --only codex/managed-app-server --json` checks the managed binary, though that check is read-only and a selected Codex Desktop binary, an explicit custom command and a remote app-server are outside it. For the money question those commands are explicitly the wrong tool: OpenClaw's documentation states that /status and /codex binding do not establish the service tier or charge actually applied to a completed request. Use the provider's own usage and spending controls, plus the plugin's codex.accountUsage Gateway method, which reads live quotas for a selected saved subscription login and requires operator.admin. Checked September 21, 2026.
What is the difference between @openclaw/codex and openclaw-code-agent?
They solve different problems and share no config keys. @openclaw/codex is the official plugin that makes Codex execute an OpenClaw agent turn — a runtime. openclaw-code-agent is a third-party MIT-licensed plugin by a different author that runs coding sessions in the background with plan approval, worktree isolation and merge or pull-request follow-through, and its own README says it is separate from OpenClaw's bundled acpx runtime plugin and bundled core codex plugin. That README also describes its own per-session USD cost estimate — for Codex sessions on an OpenAI API key, estimated from the app-server's per-response usage, while subscription sessions stay at $0 — so the accounting is the plugin's own and not the official harness's. Search results for openclaw codex surface both, which is why the names are worth keeping apart before you copy any configuration.
The runtime table, auth order, app-server warning, wire_api gate, version pins and plan prices above were fetched on September 21, 2026 from OpenClaw's and OpenAI's own documentation, OpenAI's help centre, and the npm registry entries for openclaw, @openclaw/codex, @openai/codex, codex and openclaw-code-agent. Each claim is linked to the page it came from; where a document did not settle a question, the text says so rather than filling the gap. Kunavo has run no runtime test of OpenClaw or of the Codex harness, so every configuration here is checked against source documentation rather than demonstrated against Kunavo's endpoint. Kunavo token rates come from the live catalog, and each dollar figure is illustrative arithmetic.