> For the complete documentation index, see [llms.txt](https://docs.warp.dev/llms.txt).
> Markdown versions of each page are available by appending .md to any URL.

# Running Codex in the cloud

Run Codex as a factory agent or standalone cloud harness using an OpenAI API key, with separate guidance for local CLI sessions.

Codex is OpenAI’s coding agent. Use it as a factory agent’s harness for tasks such as codebase migrations or batch test generation. Select its harness, model, and team-owned auth secret in [Configuring factory agents](https://docs.warp.dev/factories/factory-agents/configuration/#configuring-a-third-party-harness).

Codex also runs as a standalone cloud agent without a factory. To run the CLI locally in Warp, follow [Codex CLI in Warp](https://docs.warp.dev/agents/cli-agents/codex/); local authentication is separate from the cloud setup below.

## Key features

-   **Cloud orchestration** - Launch Codex from any Automation Platform trigger: the Warp app, the Oz web app, the Oz CLI, the REST API, [schedules](https://docs.warp.dev/platform/triggers/scheduled-agents/), [Slack](https://docs.warp.dev/platform/integrations/slack/) mentions, [Linear](https://docs.warp.dev/platform/integrations/linear/) issues, or [GitHub Actions](https://docs.warp.dev/platform/integrations/github-actions/).
-   **Codex model picker** - Choose an available model and reasoning level for the task.
-   **Parent and child roles** - A Warp Agent parent can dispatch Codex children in [ad hoc orchestration](https://docs.warp.dev/platform/orchestration/). A factory foreman using Codex can dispatch named factory agents; those agents keep their configured harnesses and resources.

## Available models

Choose a model and reasoning level from the factory agent’s model picker. For standalone runs, use the model picker in the Warp app’s Cloud Mode or the “Model” field on the Oz web app‘s new-run pane. Use the current picker rather than a copied list of model versions. See [Agent model choice](https://docs.warp.dev/agents/inference/model-choice/) and [OpenAI’s Codex model docs](https://developers.openai.com/codex/models) for selection guidance.

## Credentials and billing

For cloud authentication with a managed secret, Codex accepts an OpenAI API key:

-   **OpenAI API key** - Authenticates the cloud harness for OpenAI API usage. A local Codex subscription sign-in is not this managed-secret credential.

OpenAI bills the API account for inference with this credential. Warp charges for [hosted compute](https://docs.warp.dev/support-and-community/plans-and-billing/credits/#compute-usage) and [platform usage](https://docs.warp.dev/support-and-community/plans-and-billing/platform-credits/) according to your plan or contract. See [harness billing](https://docs.warp.dev/factories/harnesses/#billing) for cost-reporting limitations.

Factory agents select team-scoped secrets. Standalone ad hoc runs can use personal or team-scoped secrets. See [Connecting Codex credentials](https://docs.warp.dev/factories/harnesses/authentication/#connecting-codex-credentials).

## Starting a Codex run

For a factory agent, follow [Configuring factory agents](https://docs.warp.dev/factories/factory-agents/configuration/). For a standalone cloud run:

-   **Warp app** - In the Warp app’s Cloud Mode, open the “Agent harness” dropdown above the input and choose **Codex**.
-   **Oz web app** - On the new run or new schedule pane, in the “Harness” dropdown, choose **Codex**. In the “Codex auth secret” field, select a stored OpenAI secret.
-   **Oz CLI** - Use `oz agent run-cloud --harness codex --codex-auth-secret KEY_NAME` with your prompt and environment options. Replace `KEY_NAME` with the stored secret’s name.
-   **API and SDK** - Set the agent config’s `harness.type` to `codex` and select the OpenAI secret in the matching auth-secret field. See the [API reference](https://docs.warp.dev/factories/api-and-sdk/) for the object schema.

## Related pages

-   [Choosing agent harnesses](https://docs.warp.dev/factories/harnesses/)
-   [Configuring harness authentication](https://docs.warp.dev/factories/harnesses/authentication/) - Store OpenAI credentials as Warp-managed secrets
-   [Warp Agent](https://docs.warp.dev/factories/harnesses/warp-agent/)
-   [Multi-agent orchestration](https://docs.warp.dev/platform/orchestration/) - Coordinate a Warp Agent parent with Codex children across local and cloud runs
-   [Managing cloud agents](https://docs.warp.dev/platform/managing-cloud-agents/) - Inspect Codex cloud runs in the Agent Management Panel and the Runs page
-   [Running Claude Code in the cloud](https://docs.warp.dev/factories/harnesses/claude-code/)
-   [Codex CLI in Warp](https://docs.warp.dev/agents/cli-agents/codex/) - Codex in your local Warp terminal
