> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Cancel cloud task

> Request cancellation of an active Codex cloud task turn.

`cancelCodexCloudTask` requests cancellation of the task's active turn.

```ts automations/cancel-codex-task.automation.ts theme={null}
import { automation, onSchedule } from "automate.ax"
import { cancelCodexCloudTask } from "automate.ax/codex"

export default automation("Cancel Codex task", () => {
  onSchedule({ schedule: "0 18 * * 1-5" })
  cancelCodexCloudTask({ taskId: "task_e_abc123" })
})
```

Cancellation is asynchronous. Call `getCodexCloudTask` to confirm that the active attempt reached `cancelled`. Optional second argument `{ account }` defaults to the project binding.

<Warning>
  Codex Cloud does not currently provide an official public REST API. This
  action calls undocumented ChatGPT backend endpoints that may change without
  notice.
</Warning>
