Execute message (SSE)

POST/v1/threads/{threadId}/messages

Execute a message in the thread context. Returns Server-Sent Events (SSE) stream.

Requires positive budget balance.

Event Types:

  • response.started - Execution started
  • response.item.completed - Partial result (reasoning, tool call, etc.)
  • response.completed - Execution complete
  • stream.completed - Stream ended
  • stream.error - Error occurred

How to call this endpoint

Every ACP API request uses bearer authentication. The examples here show the actual request path, auth header, and body shape that the platform expects.

Path, query, and header parameters

These parameters control which ACP object the endpoint acts on and how the request is processed.

Path parameters
NameLocationTypeRequiredDescription
threadIdpathstringYesThread ID
Query parameters
None.
Header parameters
NameLocationTypeRequiredDescription
Idempotency-KeyheaderstringNoA client-generated identity for this turn. Retrying with the same key returns the existing execution or Batch handoff instead of scheduling duplicate work.

Body schema

Content type: application/json · Required

FieldTypeRequiredDescription
contentstringYesMessage content to execute.
taskstringNoLegacy alias for content.
executionContentstringNoOptional execution-only content while `content` remains the visible user message.
attachmentsobject[]NoAttachments to include in the execution context.
attachments[].idstringNoUnique identifier.
attachments[].filenamestringNo—
attachments[].mimeTypestringNo—
attachments[].sizeintegerNo—
attachments[].typeimage | documentNo—
attachments[].urlstringNo—
attachments[].workspacePathstringNo—
attachments[].integrationSourcestringNo—
attachments[].githubRepoFullNamestringNo—
attachments[].githubRefstringNo—
attachments[].githubItemPathstringNo—
attachments[].githubSelectionTypestringNo—
githubRepoobjectNo—
githubRepo.repoFullNamestringNo—
githubRepo.repoNamestringNo—
githubRepo.branchstringNo—
messageMetadataobjectNoMetadata persisted with the visible user message.
quotedSelectionobjectNo—
quotedSelection.textstringNo—
quotedSelection.sourceTypeworking_log | run_summaryNo—
researchModeEnabledbooleanNoEnable deep research mode for this execution.
truncateAtMessageIndexintegerNoRewind the thread to a specific message index before executing.
enabledSkillsstring[]NoBuilt-in and custom Skill IDs enabled for this execution.
editMessageIdstringNoEdit and re-run a previous user message.
persistFileChangesbooleanNoPersist file changes from the execution back into the attached computer state.
reasoningEffortminimal | low | medium | highNoReasoning intensity used by the execution runtime.
mcpServersobject[]NoMCP server overrides for this execution.
mcpServers[].namestringNoHuman-readable name.
mcpServers[].typestdio | httpNo—
mcpServers[].commandstringNoFor stdio servers
mcpServers[].argsstring[]No—
mcpServers[].urlstringNoFor HTTP servers
mcpServers[].bearerTokenstringNo—
mcpServers[].enabledbooleanNo—
envVarsobjectNoEnvironment-variable overrides for this execution.
knowledgeContextobjectNo—
knowledgeContext.enabledbooleanNoDisable automatic Knowledge retrieval for this execution when false.
knowledgeContext.libraryIdsstring[]NoRestrict retrieval to these accessible libraries. Empty means all eligible libraries.
knowledgeContext.limitintegerNo—
knowledgeContext.moderead | propose | writeNoMaximum Knowledge capability requested for the thread. Explicit attachments default to propose; every read or mutation is still checked against the caller and resource permissions.
knowledgeContext.sourcestringNoStable client provenance such as composer or project.
knowledgeContext.bindingsobject[]NoExplicit library version snapshots to use for this execution.
knowledgeContext.bindings[].libraryIdstringYes—
knowledgeContext.bindings[].versionIdstringNo—
knowledgeContext.bindings[].versionNumberintegerNo—
knowledgeContext.bindings[].fingerprintstringNo—
knowledgeobjectNo—
knowledge.enabledbooleanNoDisable automatic Knowledge retrieval for this execution when false.
knowledge.libraryIdsstring[]NoRestrict retrieval to these accessible libraries. Empty means all eligible libraries.
knowledge.limitintegerNo—
knowledge.moderead | propose | writeNoMaximum Knowledge capability requested for the thread. Explicit attachments default to propose; every read or mutation is still checked against the caller and resource permissions.
knowledge.sourcestringNoStable client provenance such as composer or project.
knowledge.bindingsobject[]NoExplicit library version snapshots to use for this execution.
knowledge.bindings[].libraryIdstringYes—
knowledge.bindings[].versionIdstringNo—
knowledge.bindings[].versionNumberintegerNo—
knowledge.bindings[].fingerprintstringNo—
queueWhenCapacityUnavailablebooleanNoPersist the turn in Batches instead of failing when runtime capacity is unavailable. Defaults to true on local appliances and false on cloud deployments.

What the API returns

Each response code below includes the documented payload shape for the ACP API.

200SSE event streamtext/event-stream
None.
202Message persisted and accepted by Batches because runtime capacity was unavailabletext/event-stream
None.
402Insufficient budgetapplication/json
FieldTypeRequiredDescription
errorstringNo—
messagestringNoMessage text.
currentBudgetnumberNo—
409Thread is busy (execution in progress)
None.
Execute message (SSE)
Loading...
Response 200
Loading...
See the ACP quickstart and SDK flow