Browse the docs

The integration contract

The checklist every agent meets, whatever the build path, so AMC can start, watch, govern and price it.

Before you startRead [How agents connect](/developers/how-agents-connect/) first.View as Markdown

These are the obligations AMC places on any agent. On the custom adapter you meet each one with an HTTP endpoint. On Foundry you meet the same obligations through the Responses stream and its markers; each Foundry section shows how.

#ObligationWhat AMC needsDetail
1EndpointOne absolute http(s) base URL. AMC calls fixed paths under it (/health, /runs, /runs/{id}/...).Endpoint and authentication
2AuthenticationAccept the credential AMC presents: an api-key header (key mode) or an Entra bearer token for your app's api:// audience (managed identity).Endpoint and authentication
3Health checkGET /health answers 2xx when ready, 401/403 when the credential is wrong. AMC calls it when you register or change the endpoint or auth.Register your agent
4InvocationPOST /runs accepts { orchestratorWorkflowId, versionId, inputs, idempotencyKey }, starts the work in the background, and returns a run id at once.Start and cancel a run
5Input contractDeclare the run parameters at registration. Read them from the flat inputs string map.Declare run parameters
6Run statusGET /runs/{id}/status returns the run status (running, human_intervention, completed, failed, cancelled) and every step. A completed run can add outcome: "partial" to report that part of the work wasn't done.Run status and steps
7StepsEach step has a stable stepId, a status, timestamps, and content readable at GET /runs/{id}/steps/{stepId}/content.Run status and steps
8Token and cost reportingPer-step inputTokens, outputTokens, cachedInputTokens and model; run totals at GET /runs/{id}/tokens, with costUsd if you price it yourself.Report tokens and cost
9Human in the loopTo ask a person, report run status human_intervention with the question on the waiting step, and accept the answer at POST /runs/{id}/messages.Ask a person mid-run
10FailureA failed run ends with status failed and a failureReason people can act on. Spend accrued before the failure is still reported.Errors and timeouts
11CancelPOST /runs/{id}/cancel stops the run and reports cancelled.Start and cancel a run
12Live events (recommended)GET /runs/{id}/events streams typed events as SSE for people watching the run.Run status and steps

Rules that cause silent errors

  • Use camelCase JSON keys exactly as documented. AMC reads them case-insensitively, but a misspelled key reads as empty, with no error.
  • Report the input/output split and the model. With only tokenCount and no costUsd, ROI falls back to a flat per-token estimate. A step with no model, or a model AMC has no rate for, prices at AMC's default rate.
  • Don't report a status AMC doesn't know. An unknown run status is treated as waiting, which the run page shows as Intervention.
  • Keep run state after the run ends. AMC reads step lists and step content from your agent whenever someone opens the run.

Last updated 2026-10-21