Skip to main content
startCodexCloudTask submits a coding task directly to a configured Codex cloud environment. Automate.ax dispatches the request; the Codex agent runs in OpenAI’s cloud container.
automations/start-codex-task.automation.ts
Connect a Codex access token from a ChatGPT Business or Enterprise workspace. Create the token in your workspace’s access-token settings, and configure the target repository and setup scripts as a Codex cloud environment before running the action. environmentId is the stable environment identifier returned by listCodexCloudEnvironments. branch is required so the headless dispatcher never guesses a ref from its own checkout. Set attempts from 1 to 4; it defaults to 1. mode defaults to code; use ask when you only want an answer and no repository changes. Optional second argument { account } defaults to the project binding. The result contains the new task ID and its ChatGPT URL. Submission is asynchronous. Use runCodexCloudTask when downstream work should wait for completion, waitForCodexCloudTask when you already have a task ID or signal, or getCodexCloudTask for one immediate status check.
Codex Cloud does not currently provide an official public REST API. This action calls undocumented ChatGPT backend endpoints that may change without notice.