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

# Send an agent a turn.

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

## Request

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

Starts a new turn with the given input. Requires the `machine:exec` scope.

## Path parameters

- `name` string, required

## Headers

- `Idempotency-Key` string, nullable

## Request body

- SendAgentTurnRequest: Send a prompt to a managed agent session.
  - `env` object: Environment for this turn only — typically the model API key. Never stored.
  - `prompt` string, required
  - `timeoutSeconds` integer, nullable: Longest the turn may run (default 1800 s).

## Response `202`

Turn started; it runs whether or not a client stays connected

- AgentTurnAccepted: A turn that was accepted and is running.
  - `turn` integer, required

## Other responses

- `401`: Missing or invalid API key
- `403`: Key lacks the required scope
- `404`: Not found
- `409`: A turn is already running, or the session is not ready
- `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/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)
