Invoke an agent transactionally
const url = 'https://example.com/v1/proxy/example';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': '*/*'}, body: 'example'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/proxy/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: */*' \ --data exampleCreates a durable invocation record and returns 202 Accepted immediately with invocation_id; the upstream call runs server-side and the caller polls GET /v1/proxy/{id}/invocations/{inv_id} for the result (spec 0002). The request body is forwarded verbatim to the agent’s upstream_url, capped at 32 MiB.
For a priced agent (pricing set on the agent, spec 0005): a request with no X-PAYMENT header receives 402 with an x402 payment-required challenge instead of being forwarded, and no invocation is created; a request with an X-PAYMENT header has the payment authorization verified before forwarding, and — when the tenant has settlement configured (spec 0006) — settled via the facilitator before the upstream is ever called.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The agt_<uuidv7> agent ID.
Header Parameters
Section titled “Header Parameters”Base64-encoded x402 payment payload (spec 0005), required only for priced agents.
Caller-supplied model identifier recorded on the invocation (spec 0003). Max 256 bytes.
Request Body
Section titled “Request Body”Forwarded verbatim to the agent’s upstream URL. For protocol=mcp agents this is a single JSON-RPC 2.0 request.
Responses
Section titled “Responses”Invocation accepted; the upstream call is running asynchronously.
object
Examplegenerated
{ "invocation_id": "example"}Headers
Section titled “Headers”The invocation ID, also present in the body.
X-Farcaster-Model exceeds 256 bytes.
The uniform error body for all 4xx responses that carry one.
object
A coarse, caller-safe message. Never contains internal state (invariant
Examplegenerated
{ "error": "example"}Missing or invalid bearer token, or the token’s tenant/user claims are absent. No body.
No X-PAYMENT header on a priced agent (body is an x402 payment challenge), or the supplied payment failed verification/settlement (body is a coarse Error).
The 402 Payment Required challenge body for a priced route with no X-PAYMENT header (spec 0005).
object
One entry of a 402 challenge’s accepts array.
object
Decimal string (256-bit)
Token contract address (hex)
The uniform error body for all 4xx responses that carry one.
object
A coarse, caller-safe message. Never contains internal state (invariant
Examplegenerated
{ "x402Version": 1, "accepts": [ { "scheme": "example", "network": "example", "maxAmountRequired": "example", "asset": "example", "payTo": "example", "resource": "example", "maxTimeoutSeconds": 1 } ]}No resource with this ID exists in the caller’s tenant.
The uniform error body for all 4xx responses that carry one.
object
A coarse, caller-safe message. Never contains internal state (invariant
Examplegenerated
{ "error": "example"}Request body exceeds the 32 MiB cap.
The uniform error body for all 4xx responses that carry one.
object
A coarse, caller-safe message. Never contains internal state (invariant
Examplegenerated
{ "error": "example"}The agent is inactive, suspended, or has no upstream_url configured.
The uniform error body for all 4xx responses that carry one.
object
A coarse, caller-safe message. Never contains internal state (invariant
Examplegenerated
{ "error": "example"}The agent’s per-agent invocation rate limit was exceeded (spec 0002).
The uniform error body for all 4xx responses that carry one.
object
A coarse, caller-safe message. Never contains internal state (invariant
Examplegenerated
{ "error": "example"}Headers
Section titled “Headers”Seconds until the next token is available (capped at 60).
An unexpected server-side error. No body (internal detail is never returned to callers, invariant