---
title: "Cancel an agent turn."
method: POST
path: "/v1/agents/{name}/turns/{turn}/cancel"
tags: ["agents"]
---

# Cancel an agent turn.

`POST /v1/agents/{name}/turns/{turn}/cancel`

## Request

- Base URL: `https://api.smolmachines.com`
- URL: `https://api.smolmachines.com/v1/agents/{name}/turns/{turn}/cancel`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/smolmachines/apis/smolfleet-api/docs/v1/agents/:name/turns/:turn/cancel/post.ts> (a function with typed inputs; its response is checked against the schema)

Stops a turn that is still running. Requires the `machine:create` or `machine:exec` scope.

## Path parameters

- `name` string, required
- `turn` integer, required

## Response `204`

Turn cancelled and its machine stopped; the next turn restarts it

## Other responses

- `401`: Missing or invalid API key
- `403`: Key lacks the required scope
- `404`: Not found
- `409`: Turn is not running
- `429`: Rate limited; retry after the Retry-After header
- `500`: Internal error

## Changes

- **2026-10-16** `bc31fc04a568`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/smolmachines/apis/smolfleet-api/changes/v1/agents/:name/turns/:turn/cancel/post.md)

---

[API](https://skmtc.dev/smolmachines/apis/smolfleet-api.md) - [All operations](https://skmtc.dev/smolmachines/apis/smolfleet-api/llms.txt) - [OpenAPI document](https://skmtc.dev/smolmachines/apis/smolfleet-api/revisions/bc31fc04a568?raw)
