Skip to content

ACP API ​

The ACP (Agent Communication Protocol) API is an ACP-compatible surface on port 8000 that provides agent discovery and self-service run execution. It lets callers discover which agents are available to their tenant, inspect each agent's input/output schema and tools, and launch runs — all without writing YAML or touching kubectl.

Authentication ​

The ACP API uses the same bearer token as the External Task API. Obtain a JWT via the OAuth2 client_credentials grant:

bash
TOKEN=$(curl -s -X POST http://localhost:8084/oauth/token \
  -d "grant_type=client_credentials&client_id=acme-client&client_secret=secret123" \
  | jq -r .access_token)

All ACP endpoints except /openapi.json, /healthz, /readyz, /version, /metrics, and /ping require a valid Authorization: Bearer <token> header.

Endpoints ​

MethodPathDescription
GET/agentsList agents available to the authenticated tenant
GET/agents/{name}Get an agent's full manifest
POST/agents/{name}/runLaunch a run for an agent (schema-validated)
POST/runsCreate a run directly (lower-level ACP endpoint)
GET/runs/{run_id}Get run status
POST/runs/{run_id}Resume a run (send additional input)
POST/runs/{run_id}/cancelCancel a run
GET/runs/{run_id}/eventsList run events
GET/session/{session_id}Get session state

GET /agents ​

List all agents available to the authenticated tenant.

Response:

json
{
  "agents": [
    {
      "name": "support-bot",
      "description": "Customer support agent",
      "input_content_types": ["text/plain"],
      "output_content_types": ["text/plain"],
      "input_schema": { ... },
      "output_schema": { ... },
      "allowed_tools": [ ... ],
      "knowledge_bases": ["docs"],
      "guardrail_policy": "phi-redact",
      "clarify_available": true
    }
  ]
}

GET /agents/ ​

Get the full manifest for a specific agent. The manifest includes:

FieldTypeDescription
namestringAgent name
descriptionstringHuman-readable description
input_content_types[]stringAccepted input content types (e.g. text/plain)
output_content_types[]stringProduced output content types
input_schemaobjectJSON Schema for input — includes tool_names list for dynamic tool selection
output_schemaobjectJSON Schema for output
allowed_tools[]objectTools available to this agent (built-in + configured), each with name, description, input_schema
knowledge_bases[]stringKnowledgeBase names available to this agent
guardrail_policystringGuardrailPolicy name applied to this agent
clarify_availableboolWhether _clarify is available (false if disableClarify: true)

Built-in tools always available (unless disabled):

ToolDescription
_clarifyAsk the human a clarifying question
_rag_searchSearch the agent's KnowledgeBases
_rag_ingestIngest documents into a KnowledgeBase

Response example:

json
{
  "name": "support-bot",
  "description": "Customer support agent",
  "input_schema": {
    "type": "object",
    "properties": {
      "input": { "type": "array", "items": { "$ref": "#/components/schemas/ACPMessage" } },
      "tool_names": { "type": "array", "items": { "type": "string" } }
    },
    "required": ["input"]
  },
  "output_schema": {
    "type": "object",
    "properties": {
      "output": { "type": "array", "items": { "$ref": "#/components/schemas/ACPMessage" } }
    }
  },
  "allowed_tools": [
    {"name": "_clarify", "description": "Ask the human a clarifying question"},
    {"name": "_rag_search", "description": "Search knowledge bases"},
    {"name": "web-search", "description": "Search the web", "input_schema": {"type": "object", "properties": {"query": {"type": "string"}}}},
    {"name": "get-customer-info", "description": "Look up customer data", "input_schema": {"type": "object", "properties": {"customer_id": {"type": "string"}}}}
  ],
  "knowledge_bases": ["support-docs"],
  "guardrail_policy": "phi-redact",
  "clarify_available": true
}

POST /agents/{name}/run ​

Launch a new run for an agent. This is a schema-validated, UX-friendly wrapper around POST /runs that accepts ACP-format messages.

Request body:

FieldTypeRequiredDescription
input[]ACPMessageyesArray of input messages
session_idstringnoSession ID for conversation continuity

ACPMessage format:

json
{
  "role": "user",
  "parts": [
    {
      "content_type": "text/plain",
      "content": "How do I reset my password?"
    }
  ]
}
FieldDescription
roleMessage role: user, assistant, tool
partsArray of message parts
parts[].content_typeMIME type: text/plain, text/html, application/json, etc.
parts[].contentThe message content (string)
parts[].content_urlURL to external content (alternative to inline content)

Request example:

bash
curl -X POST http://localhost:8000/agents/support-bot/run \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "input": [
      {
        "role": "user",
        "parts": [
          {"content_type": "text/plain", "content": "How do I reset my password?"}
        ]
      }
    ]
  }'

Response (201):

json
{
  "agent_name": "support-bot",
  "run_id": "acp-support-bot-9flnj",
  "status": "created",
  "created_at": "2024-01-01T12:00:00Z"
}

Run statuses ​

StatusDescription
createdRun has been created, not yet started
in-progressRun is actively executing
awaitingRun is waiting for human input (e.g. _clarify)
cancellingRun is being cancelled
cancelledRun was cancelled
completedRun finished successfully
failedRun failed

POST /runs ​

The lower-level ACP endpoint for creating runs. Accepts agent_name, input, session_id, session, and mode fields. The POST /agents/{name}/run endpoint is the recommended UX-friendly alternative.

GET /runs/ ​

Get the status and output of a run.

Response:

json
{
  "agent_name": "support-bot",
  "run_id": "acp-support-bot-9flnj",
  "status": "completed",
  "output": [
    {
      "role": "assistant",
      "parts": [
        {"content_type": "text/plain", "content": "Go to Settings > Security > Reset Password."}
      ]
    }
  ],
  "created_at": "2024-01-01T12:00:00Z",
  "finished_at": "2024-01-01T12:00:05Z"
}

Live streaming (Server-Sent Events): while the run is in progress, requesting Accept: text/event-stream streams live updates instead of the JSON body. Beyond message parts, the stream forwards the model-router's trace events — tool calls/results, guardrails, provider fallbacks, MCP discovery, and the router/operator's own infrastructure decisions — as event: trace frames whose data payload is the raw trace event JSON:

event: trace
data: {"type":"toolCall","name":"issue_read","backendType":"mcp","backendRef":"github-mcp"}

Infrastructure events (routing, hindsight) surface the model-router's background decisions — which model was selected, memory-system recall/retain — so clients can show why a run is silent before the first token arrives:

event: trace
data: {"type":"routing","model":"z-ai/glm-5.3-flash","provider":"openrouter-free","strategy":"rule-based","reason":"weighted random","confidence":0.5}
event: trace
data: {"type":"hindsight","op":"recall","bankID":"agent-orca-system--senior-programmer"}
event: trace
data: {"type":"truncation","provider":"openrouter-free","before":1021745,"after":313516,"budget":314366}

A terminal trace event (fail / finalOutput) marks the true end of the turn: the stream stops and run.completed follows. Editors driving the ACP bridge render these as live activity instead of a spinner.

GET /runs/{run_id}/events ​

List events for a run (ACP event stream).

POST /runs/{run_id}/cancel ​

Cancel a running task.

GET /runs/{run_id}/fs/pending ​

List the ACP fs/* requests the run has queued for the workstation bridge (filesystem relay; see filesystem-access.md). Used by aoctl acp serve while watching a run. Accepts ?wait=<seconds> (max 25) to long-poll. Returns {"requests": [...]}; 501 when the deployment has no filesystem relay.

POST /runs/{run_id}/fs/pending/{request_id}/response ​

Post the bridge's answer for one relayed fs request. Body is {"result": {...}} on success or {"error": {"code": N, "message": "..."}} when the bridge/editor refused the call. Returns 204; 404 when the request expired. The calling bridge must own the run (tenant-scoped like every other /runs/{id} endpoint).

GET /session/ ​

Retrieve session state for conversation continuity.

Using aoctl ​

All ACP endpoints are available via aoctl agents:

bash
aoctl agents list
aoctl agents describe support-bot
aoctl agents run support-bot --input "How do I reset my password?"

See aoctl-reference.md for the full CLI reference.

Rate limiting & budget ​

ACP endpoints are subject to the same per-tenant rate limits and budget enforcement as the External Task API. Exceeding requestsPerMinute or concurrentRuns returns 429 Too Many Requests with a Retry-After header. Exceeding budgetPerDayUSD returns 402 Payment Required. See Rate Limiting & Budget Enforcement for details.

Released under the Apache 2.0 License.