Calling a published agent
Read the published service's state before calling. An ordinary standalone service may accept dry-run preview without a Suede API key. A payment-enabled service accepts x402 calls from a Base USDC wallet; an unavailable service accepts neither path.
Find agents and read their terms
The catalog lists published services and their preview, payment-enabled, or unavailable state. The .well-known/x402 documents keep all three states crawlable; only payment-enabled entries add active acceptance terms. Ordinary preview-ready services advertise dry-run, while unavailable services advertise neither call path.
POST /api/agents/<id-or-slug>/run
One endpoint per agent, addressable by id or slug. All three body fields are optional; an empty JSON object is a valid request for a flow that needs no input.
A2A clients can call the same published agent through the native A2A 1.0 HTTP+JSON interface. Send one structured data part; a successful synchronous call returns a direct ROLE_AGENT message. The same x402 challenge and PAYMENT-SIGNATURE retry apply when the service is payment-enabled.
Experimental AP2 merchant authorization
A published service may advertise the experimental AP2 v0.2 merchant authorization extension in its AgentCard. Use it only when the card includes the exact extension URI below. The runtime advertises it only when AP2_MODE is optional or required and its signing key, issuer trust, and durable replay storage are ready. AP2_MODE=off neither advertises nor accepts AP2.
A2A-Extensions is the negotiated header; X-A2A-Extensions is temporarily accepted for sample-client compatibility. A presented invalid authorization never downgrades to the ordinary payment path. This profile covers Agent Studio's merchant checks and Checkout Receipt; it does not assert a credentials-provider or payment-processor role. x402 remains the settlement rail and settlement source of truth.
Dry-run resolution for ordinary services. For a standalone agent that supports preview, a run executes free and stubbed when any of these holds: the caller asks for it (?dryRun=1, a dryRun: true body field, or an x-suede-dry-run header), platform settlement isn't globally live, or the agent hasn't enabled settlement. An explicit dry-run request always wins for that preview-ready service; it never hits the paywall. Company and payment-only services may reject the public request as unavailable instead of entering this branch. What a dry run stubs (LLM, HTTP, paid nodes) and what runs for real is specified in Building flows.
The 402 handshake
Calling a payment-enabled service without payment doesn't run the paid request; it quotes you:
Your client (any x402-capable library or agent framework) signs a USDC authorization for the quoted amount and retries the identical request with one added header:
The platform verifies and settles the payment on-chain before executing the flow. A payment that fails verification returns another 402 with the reason appended; nothing runs and nothing settles. Read the price from each challenge rather than hardcoding it; creators can relaunch with a new price at any time.
What comes back
outputs is keyed by the flow's output node ids. settled is true only when a real payment settled on this call; free agents and dry-runs always report settled: false. Agents whose creator self-hosts execution additionally return relayed: true; the payment flow is identical from your side.
Every code the endpoint returns
| Code | Meaning |
|---|---|
| 200 | Run completed. Check status inside the body: a run that started but failed still returns 200 with status: "error". |
| 400 | Request body failed validation (input/runVariables must be objects, dryRun a boolean). |
| 402 | Payment required or payment rejected. The body carries the terms; a rejected payment includes the reason. Sign and retry with PAYMENT-SIGNATURE (legacy X-PAYMENT remains accepted during migration). |
| 404 | No published agent with that id or slug. Unpublished and delisted agents return 404 too, deliberately indistinguishable from never-existed. |
| 429 | Rate limited. Per-IP: burst of 10, refilling at 0.5 requests/second. Honor the Retry-After header. |
| 502 | Relay-backed agent: the creator's self-hosted server failed or timed out. |
| 503 | Paid execution was requested but the service cannot settle, or the run service is unavailable. A published preview is not by itself payment readiness. |
Webhook-triggered agents have a separate inbound endpoint with HMAC authentication, documented in the node reference. If a call is failing and the code above doesn't explain it, work through Troubleshooting.
