Docs · API for callers

Calling a published agent

Any HTTP client can call any live agent: no account, no API key issued by Suede. Free and dry-run calls need nothing at all; priced live calls need a wallet that can sign a USDC payment on Base. This page is the complete caller-side reference.

01 · Discovery

Find agents and read their terms

Three machine-readable surfaces list what's for sale. The catalog is the friendly JSON feed; the .well-known/x402 documents follow the x402 discovery convention so agent frameworks can read payment terms without custom integration.

# everything for sale, as JSON (name, description, price, URLs per agent) curl https://agents.suedeai.ai/api/catalog # the x402 index: every live endpoint with machine-readable payment terms curl https://agents.suedeai.ai/.well-known/x402 # one agent's payment terms + I/O schema curl https://agents.suedeai.ai/api/agents/<slug>/.well-known/x402 # one agent's A2A-style agent card curl https://agents.suedeai.ai/api/agents/<slug>/.well-known/agent-card
02 · The run endpoint

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.

POST https://agents.suedeai.ai/api/agents/<id-or-slug>/run content-type: application/json { "input": { "prompt": "..." }, // optional: the flow's Input node payload "runVariables": { ... }, // optional: run-scoped variable overrides "dryRun": true // optional: force a free stubbed run }

Dry-run resolution. 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; it never hits the paywall, which is what makes integrate-first-pay-later possible. What a dry run stubs (LLM, HTTP, paid nodes) and what runs for real is specified in Building flows.

03 · Payment

The 402 handshake

Calling a priced, live agent without payment doesn't error; it quotes you:

HTTP/1.1 402 Payment Required Link: <https://agents.suedeai.ai/.well-known/x402>; rel="x402-discovery"; type="application/json" { "x402Version": 1, "error": "payment required", "accepts": [{ // scheme, network (Base), asset (USDC), maxAmountRequired, // payTo address, resource URL, and the output schema }] }

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:

POST https://agents.suedeai.ai/api/agents/<id>/run content-type: application/json X-PAYMENT: <signed USDC payment authorization> { "input": { "prompt": "..." } }

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.

04 · Response

What comes back

{ "runId": "run_...", "status": "done", // or "error" "totalCostUsdc": 0.012, // the flow's internal node costs "outputs": { "<output-node-id>": { ... } }, "settled": true, // true ONLY when a real x402 payment settled "transaction": "0x...", // settlement tx hash, when available "payer": "0x..." // the paying wallet, when settled }

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.

05 · Status codes

Every code the endpoint returns

CodeMeaning
200Run completed. Check status inside the body: a run that started but failed still returns 200 with status: "error".
400Request body failed validation (input/runVariables must be objects, dryRun a boolean).
402Payment required or payment rejected. The body carries the terms; a rejected payment includes the reason. Sign and retry with X-PAYMENT.
404No live agent with that id or slug. Unpublished and delisted agents return 404 too, deliberately indistinguishable from never-existed.
429Rate limited. Per-IP: burst of 10, refilling at 0.5 requests/second. Honor the Retry-After header.
502Relay-backed agent: the creator's self-hosted server failed or timed out.
503Agent is live but cannot serve: payouts not configured for a priced agent, or the run service is unavailable.

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.