Bring your own agent
Connect any agent or workflow to AMC by serving a small HTTP contract that AMC calls to start, watch, answer and cancel runs.
Before you startAn agent or workflow you can put behind an HTTP endpoint. Read [How agents connect](/developers/how-agents-connect/) first.View as Markdown
Bring your own agent means AMC drives an HTTP service you own. The service can wrap anything: a LangGraph graph, a .NET worker, a script, or another vendor's agent. You register it with the Flight Director / custom adapter (flight-director), and AMC calls a fixed set of paths under its endpoint URL.
The endpoints AMC calls
| Method and path | AMC calls it when | Returns |
|---|---|---|
GET /health | You register the agent, or change its endpoint or auth. | Any 2xx body |
POST /runs | A run starts (manual, schedule, webhook). | A run: orchestratorRunId, status, startedAt |
GET /runs/{id}/status | Every status-sync poll, and whenever someone opens the run. | Run status with every step |
GET /runs/{id}/tokens | Every status-sync poll. | Token totals and costUsd |
GET /runs/{id}/steps/{stepId}/content | Someone opens a step. | The step's output and activity log |
POST /runs/{id}/cancel | Someone cancels the run. | The run, normally with status cancelled |
POST /runs/{id}/messages | Someone answers your agent's question. | Run status after the answer |
GET /runs/{id}/events | Someone is watching the run live. | A Server-Sent Events stream |
All eight are needed for the full experience. /messages matters only if your agent asks people questions, and /events only powers the live view: AMC records every run from its poll whether or not the stream works.
Wire conventions
- JSON request and response bodies, with the camelCase keys shown in these docs. Extra keys are ignored. A misspelled key reads as empty, with no error.
- Timestamps are ISO 8601 with an offset, for example
2026-10-17T09:30:00+00:00. - Any non-
2xxresponse is a failure. AMC retries each JSON call once (not/healthor/events), on a transport fault or a non-2xxstatus, before giving up. MakePOST /runssafe to receive twice. - Run ids are yours. Make them unique and URL-safe; AMC escapes them into paths.
Build it
- Implement the endpoints. In Python, the amc_sdk package serves all of them around one run function. In any other language, start from the minimal endpoint.
- Decide how AMC authenticates: an API key, or managed identity on an approved https host. See Endpoint and authentication.
- Report progress the way AMC reads it: run status and steps, tokens and cost, and questions for people.
- Handle the failure cases in Errors and timeouts.
- Test it locally, deploy it, then register it: choose the Flight Director / custom adapter, enter the Endpoint URL, declare the input contract and steps. See Register your agent.
Related
Last updated 2026-10-21