Browse the docs

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 pathAMC calls it whenReturns
GET /healthYou register the agent, or change its endpoint or auth.Any 2xx body
POST /runsA run starts (manual, schedule, webhook).A run: orchestratorRunId, status, startedAt
GET /runs/{id}/statusEvery status-sync poll, and whenever someone opens the run.Run status with every step
GET /runs/{id}/tokensEvery status-sync poll.Token totals and costUsd
GET /runs/{id}/steps/{stepId}/contentSomeone opens a step.The step's output and activity log
POST /runs/{id}/cancelSomeone cancels the run.The run, normally with status cancelled
POST /runs/{id}/messagesSomeone answers your agent's question.Run status after the answer
GET /runs/{id}/eventsSomeone 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-2xx response is a failure. AMC retries each JSON call once (not /health or /events), on a transport fault or a non-2xx status, before giving up. Make POST /runs safe to receive twice.
  • Run ids are yours. Make them unique and URL-safe; AMC escapes them into paths.

Build it

  1. 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.
  2. Decide how AMC authenticates: an API key, or managed identity on an approved https host. See Endpoint and authentication.
  3. Report progress the way AMC reads it: run status and steps, tokens and cost, and questions for people.
  4. Handle the failure cases in Errors and timeouts.
  5. 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.

Last updated 2026-10-21