Skip to main content
POST
Respond to an API turn input

Authorizations

Authorization
string
header
required

MCPJam API key (sk_…). Create one at Settings → API keys. Guest sessions cannot use the API, and API keys cannot manage other API keys.

Path Parameters

turnId
string
required

Body

application/json
round
integer
required
Required range: x >= 0
responseKey
string
required

Stable key for retries of an accepted answer in this round.

Required string length: 1 - 200
responses
object
required

An answer object for each key in the pending forms. Each object must match its requested schema.

Response

The completed turn or the current form state, including expiry and indeterminate outcomes.

sessionId
string | null
required

The one public session id. Pass it back to continue, and to the trace/detail reads. NULL only when the turn ran but its transcript did not persist, which persisted.outcome reports, and which must not be read as "nothing happened": the turn already spent.

turnId
string
required

Minted by the turn lease and used by the ingest dedupe, so it names the same turn in both.

projectId
string
required

The project this turn ran in. On a continuation the caller never sent it (it comes off the session row), so this is the only place the response names the session's project.

persisted
object
required
origin
enum<string>
required
Available options:
api
reply
string
finishReason
string | null
toolCalls
object[]
trace
object

This turn's spans, inline.

usage
object
model
object
toolMode
enum<string>
Available options:
read_only,
auto
engine
string

WHICH ENGINE RAN: emulated, or harness:<id> such as harness:claude-code. Present on every turn. Read it rather than infer it from model. hostId is per-turn: a continuation of a host-only session is refused without it, and one that pinned its own serverIds runs the emulated engine: this is the field that says which.

hostId
string

The saved host this turn executed as: the pointer the caller sent, or the host the targeted environment pins. Absent when the turn named no host.

skippedServers
object[]

Servers omitted from this turn because they could not connect. The reply still runs when every selected server is skipped.

advertisedToolCount
integer

Tools the model could see this turn.

excludedToolCount
integer

Tools the tool policy withheld.

replay
boolean

Set when this idempotencyKey replayed an already-completed turn. Nothing was spent.

message
string
chatSessionId
string
browser
object