Register a new agent
const url = 'https://example.com/v1/agents';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","description":"example","tags":["example"],"metadata":{},"upstream_url":"https://example.com","credential_ref":"example","emit_receipts":false,"capture_body":false,"protocol":"http","mcp_transport":"streamable_http","mcp_protocol_version":"example","pricing":{"amount":"example","asset":"USDC","network":"base","pay_to":"example","tools":{"additionalProperty":"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/agents \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "description": "example", "tags": [ "example" ], "metadata": {}, "upstream_url": "https://example.com", "credential_ref": "example", "emit_receipts": false, "capture_body": false, "protocol": "http", "mcp_transport": "streamable_http", "mcp_protocol_version": "example", "pricing": { "amount": "example", "asset": "USDC", "network": "base", "pay_to": "example", "tools": { "additionalProperty": "example" } } }'Creates an agent scoped to the caller’s tenant. Status is derived: pending when upstream_url is absent, active once one is set (spec 0002). protocol defaults to http; protocol=mcp requires mcp_transport to be streamable_http (spec 0004 Decision 2/3). pricing, when present, enables the x402 payment gate on this agent (spec 0005) and requires pricing.network=base, pricing.asset=USDC; per-tool overrides in pricing.tools require protocol=mcp.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Must be http(s) with a host; loopback/private/link-local hosts and localhost are rejected (SSRF hygiene).
Required when protocol=mcp; rejected when protocol=http.
object
Flat per-call price, smallest-unit decimal string.
V1 accepts only “USDC”.
V1 accepts only “base”.
Operator payout address (the gateway holds no key).
Optional per-MCP-tool price overrides, keyed by tool name. Requires the agent’s protocol to be mcp.
object
Responses
Section titled “Responses”Agent created.
object
The agt_<uuidv7> resource ID.
object
Derived from upstream_url — pending when absent, active once set; inactive after a delete.
A suspended agent stays in the catalog but rejects invocations.
The subject claim of the user who created the agent.
The credential ID injected into upstream calls.
Per-agent requests/second override (spec 0002).
Token-bucket burst depth; defaults to 20 when only the rate is set.
Whether a Treeship trust receipt is emitted after each completed invocation.
Whether request/response bodies are captured on invocations (spec 0003).
Required and validated only when protocol=mcp (spec 0004).
object
Flat per-call price, smallest-unit decimal string.
V1 accepts only “USDC”.
V1 accepts only “base”.
Operator payout address (the gateway holds no key).
Optional per-MCP-tool price overrides, keyed by tool name. Requires the agent’s protocol to be mcp.
object
Example
{ "status": "pending", "protocol": "http", "mcp_transport": "streamable_http", "pricing": { "asset": "USDC", "network": "base" }}Invalid body, missing name, invalid upstream_url/protocol/pricing combination.
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.
An active or pending agent with this name already exists in the 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"}An unexpected server-side error. No body (internal detail is never returned to callers, invariant