Skip to content

Prompt an agent

POST
/api/panes/{pane_id}/prompt
Code sample: Shell / cURL
curl --request POST \
--url http://127.0.0.1:8004/api/panes/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/prompt \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "prompt": "example", "wait": true, "timeout_ms": 1, "agent_id": 1 }'

Pastes prompt into the pane’s agent and submits it. With wait (the default), replies once the agent has started and settled (idle, done, blocked, or waiting on background work).

pane_id
required
string format: uuid

Pane ID

Media typeapplication/json
object
prompt
required
string
wait
boolean
default: true
timeout_ms

How long to wait, in milliseconds: 10 minutes by default, at most an hour.

integer | null format: int64
agent_id

The agent instance meant (a pane’s agent_id); refused with 409 if another has replaced it.

integer | null format: int64

With wait, the turn’s outcome; without, {"submitted": true}

Media typeapplication/json

With wait, the turn’s outcome; without, {"submitted": true}.

One of:
object
status
One of:

None once the agent has exited.

object
state
required

Lifecycle states for an agent occupying a pane.

This intentionally follows Herdr’s small semantic vocabulary. Failure and permission details belong in the accompanying message/notification instead of multiplying lifecycle states.

string
Allowed values: unknown idle working waiting blocked done
agent
string | null
source
string | null
message
string | null
background

Background work the agent’s screen shows, such as “2 shells, 1 monitor”.

string | null
started
required

Whether the agent was seen working on the prompt.

boolean
timed_out
required
boolean
screen

The rendered screen once output went quiet; None once the pane has closed.

string | null

Example

{
"status": {
"state": "unknown"
}
}

The prompt is more than 64 KiB; or a malformed ID or JSON body

Media typetext/plain
string

Missing or wrong access token

Media typetext/plain
string

The request’s Host or Origin isn’t allowed, or the caller can’t use this route (a guest token, or btmux connect)

No such pane

Media typetext/plain
string

No agent, the agent isn’t agent_id, a dialog is waiting for an answer, the agent is busy (with wait), or the agent can’t take a multi-line prompt

Media typetext/plain
string

A body over the size limit

Media typetext/plain
string

No Content-Type: application/json

Media typetext/plain
string

A body that doesn’t match its schema

Media typetext/plain
string

Writing to the pane failed

Media typetext/plain
string