> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.videogen.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.videogen.io/_mcp/server.

# Cancel tool execution

POST https://api.videogen.io/v1/tools/executions/{toolExecutionId}/cancel

Request cancellation of a running tool execution. The execution transitions to `cancelled` if it has not already completed.

Reference: https://docs.videogen.io/rest-api-reference/tools/cancel-tool-execution

## Authentication

- `Authorization` header (bearer token, required) — API key from [app.videogen.io/api](https://app.videogen.io/api). The full key is only shown once when you create it.

## Request

### Path parameters

- `toolExecutionId` (string, required) — The tool execution id returned when the tool was started.

## Response

### 202

Cancellation request accepted

- `toolExecutionId` (string, required) — Execution id (e.g. `vg_tool_...`).

## Examples

**Response**

```json
{
  "toolExecutionId": "vg_tool_ccm3abc123defcm3xyz789ghi"
}
```

**SDK Code**

```typescript
import { VideoGen } from "@videogen/sdk";

const client = new VideoGen({ apiKey: "sk_videogen_live_..." });

await client.tools.cancelToolExecution({
  toolExecutionId: "vg_tool_ccm3abc123defcm3xyz789ghi",
});
```

```python
from videogen import VideoGen

client = VideoGen(api_key="sk_videogen_live_...")

client.tools.cancel_tool_execution(
    tool_execution_id="vg_tool_ccm3abc123defcm3xyz789ghi",
)
```