{"openapi":"3.1.0","info":{"title":"uSwap Agent API","version":"1.0.0","description":"Discover, quote, fund and follow uSwap orders. HTTP and MCP use the same operations."},"servers":[{"url":"https://agent.uswap.net"}],"components":{"securitySchemes":{"SessionToken":{"type":"http","scheme":"bearer"}}},"paths":{"/v1/capabilities":{"post":{"operationId":"capabilities","summary":"Start here. Get the integration flow, current feature boundaries and links to live discovery.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"Operation result. Inspect state/error and next_actions; HTTP 200 alone is not proof of execution.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request"},"401":{"description":"Missing or invalid session token"},"429":{"description":"Rate limited; use Retry-After"},"503":{"description":"Upstream unavailable; reconcile mutations before retrying"}}}},"/v1/session":{"post":{"operationId":"session","summary":"Create a private session without signup. Save the returned token; it controls only orders created in this session.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"Operation result. Inspect state/error and next_actions; HTTP 200 alone is not proof of execution.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request"},"401":{"description":"Missing or invalid session token"},"429":{"description":"Rate limited; use Retry-After"},"503":{"description":"Upstream unavailable; reconcile mutations before retrying"}}}},"/v1/catalog":{"post":{"operationId":"catalog","summary":"Discover live assets, products, recipient requirements, denominations and availability. Follow page_token values until you find a selectable asset.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"side":{"type":"string","enum":["from","to"],"default":"to"},"query":{"type":"string","maxLength":120},"page_token":{"type":"string","maxLength":16384}},"additionalProperties":false}}}},"responses":{"200":{"description":"Operation result. Inspect state/error and next_actions; HTTP 200 alone is not proof of execution.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request"},"401":{"description":"Missing or invalid session token"},"429":{"description":"Rate limited; use Retry-After"},"503":{"description":"Upstream unavailable; reconcile mutations before retrying"}}}},"/v1/quote":{"post":{"operationId":"quote","summary":"Preview a swap or purchase. Amount is a decimal string in source units, or destination units when amount_side is to. No funds move.","security":[{"SessionToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","pattern":"^asset\\_v1\\:","maxLength":1024,"description":"Exact asset_id returned by catalog. Never guess IDs."},"destination":{"type":"string","pattern":"^asset\\_v1\\:","maxLength":1024,"description":"Exact asset_id returned by catalog. Never guess IDs."},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$","maxLength":80},"amount_side":{"type":"string","enum":["from","to"],"default":"from"},"recipient":{"type":"string","minLength":1,"maxLength":1024},"memo":{"type":"string","minLength":1,"maxLength":1024},"slippage_bps":{"type":"integer","minimum":0,"maximum":1000,"default":100},"confidential":{"type":"boolean","default":false}},"required":["source","destination","amount"],"additionalProperties":false}}}},"responses":{"200":{"description":"Operation result. Inspect state/error and next_actions; HTTP 200 alone is not proof of execution.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request"},"401":{"description":"Missing or invalid session token"},"429":{"description":"Rate limited; use Retry-After"},"503":{"description":"Upstream unavailable; reconcile mutations before retrying"}}}},"/v1/orders":{"post":{"operationId":"orders","summary":"Commit an unexpired quote once. Returns an order ID and funding instructions. Does not send wallet funds.","security":[{"SessionToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"quote_id":{"type":"string","minLength":1,"maxLength":256},"idempotency_key":{"type":"string","minLength":8,"maxLength":128,"description":"Stable unique key for this exact mutation. Keep it when retrying."}},"required":["quote_id","idempotency_key"],"additionalProperties":false}}}},"responses":{"200":{"description":"Operation result. Inspect state/error and next_actions; HTTP 200 alone is not proof of execution.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request"},"401":{"description":"Missing or invalid session token"},"429":{"description":"Rate limited; use Retry-After"},"503":{"description":"Upstream unavailable; reconcile mutations before retrying"}}}},"/v1/order":{"post":{"operationId":"order","summary":"Read the current order, deposits, progress, holds and next actions. Follow next_actions; never infer success from a timeout.","security":[{"SessionToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string","minLength":1,"maxLength":256}},"required":["order_id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Operation result. Inspect state/error and next_actions; HTTP 200 alone is not proof of execution.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request"},"401":{"description":"Missing or invalid session token"},"429":{"description":"Rate limited; use Retry-After"},"503":{"description":"Upstream unavailable; reconcile mutations before retrying"}}}},"/v1/list_orders":{"post":{"operationId":"list_orders","summary":"Recover up to the last 100 orders belonging to this session.","security":[{"SessionToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"Operation result. Inspect state/error and next_actions; HTTP 200 alone is not proof of execution.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request"},"401":{"description":"Missing or invalid session token"},"429":{"description":"Rate limited; use Retry-After"},"503":{"description":"Upstream unavailable; reconcile mutations before retrying"}}}},"/v1/operation":{"post":{"operationId":"operation","summary":"Check a mutation after timeout. Unknown means do not create a replacement or fund a different address.","security":[{"SessionToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"operation_id":{"type":"string","minLength":1,"maxLength":256}},"required":["operation_id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Operation result. Inspect state/error and next_actions; HTTP 200 alone is not proof of execution.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request"},"401":{"description":"Missing or invalid session token"},"429":{"description":"Rate limited; use Retry-After"},"503":{"description":"Upstream unavailable; reconcile mutations before retrying"}}}},"/v1/payment":{"post":{"operationId":"payment","summary":"Create Pay Mode for an exact output amount in destination units. Fund it with one or more funding quotes.","security":[{"SessionToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"destination":{"type":"string","pattern":"^asset\\_v1\\:","maxLength":1024,"description":"Exact asset_id returned by catalog. Never guess IDs."},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$","maxLength":80},"recipient":{"type":"string","minLength":1,"maxLength":1024},"memo":{"type":"string","minLength":1,"maxLength":1024},"confidential":{"type":"boolean","default":false},"idempotency_key":{"type":"string","minLength":8,"maxLength":128,"description":"Stable unique key for this exact mutation. Keep it when retrying."}},"required":["destination","amount","idempotency_key"],"additionalProperties":false}}}},"responses":{"200":{"description":"Operation result. Inspect state/error and next_actions; HTTP 200 alone is not proof of execution.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request"},"401":{"description":"Missing or invalid session token"},"429":{"description":"Rate limited; use Retry-After"},"503":{"description":"Upstream unavailable; reconcile mutations before retrying"}}}},"/v1/funding":{"post":{"operationId":"funding","summary":"Quote a contribution to an existing Pay Mode order. Commit the returned quote with orders. For amount_side to, amount is in collection-asset units.","security":[{"SessionToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string","minLength":1,"maxLength":256},"source":{"type":"string","pattern":"^asset\\_v1\\:","maxLength":1024,"description":"Exact asset_id returned by catalog. Never guess IDs."},"amount":{"type":"string","pattern":"^(?:0|[1-9]\\d*)(?:\\.\\d+)?$","maxLength":80},"amount_side":{"type":"string","enum":["from","to"],"default":"from"}},"required":["order_id","source","amount"],"additionalProperties":false}}}},"responses":{"200":{"description":"Operation result. Inspect state/error and next_actions; HTTP 200 alone is not proof of execution.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request"},"401":{"description":"Missing or invalid session token"},"429":{"description":"Rate limited; use Retry-After"},"503":{"description":"Upstream unavailable; reconcile mutations before retrying"}}}},"/v1/action":{"post":{"operationId":"action","summary":"Perform an action offered by the current order. Reuse the same idempotency_key on retry. Never submit a secret unless required by this order.","security":[{"SessionToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string","minLength":1,"maxLength":256},"action":{"type":"string","enum":["notify_deposit","submit_input","resolve_hold","set_refund_destination","release_payment","cancel_payment"]},"idempotency_key":{"type":"string","minLength":8,"maxLength":128,"description":"Stable unique key for this exact mutation. Keep it when retrying."},"intent_id":{"type":"string","minLength":1,"maxLength":256},"input_id":{"type":"string","minLength":1,"maxLength":256},"value":{"type":"string","minLength":1,"maxLength":16384},"deposit_id":{"type":"string","minLength":1,"maxLength":256},"resolution":{"type":"string","enum":["refund","keep_holding"]},"network":{"type":"string","minLength":1,"maxLength":256},"tx_hash":{"type":"string","minLength":1,"maxLength":1024},"refund_asset":{"type":"string","pattern":"^asset\\_v1\\:","maxLength":1024,"description":"Exact asset_id returned by catalog. Never guess IDs."},"refund_address":{"type":"string","minLength":1,"maxLength":1024}},"required":["order_id","action","idempotency_key"],"additionalProperties":false}}}},"responses":{"200":{"description":"Operation result. Inspect state/error and next_actions; HTTP 200 alone is not proof of execution.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request"},"401":{"description":"Missing or invalid session token"},"429":{"description":"Rate limited; use Retry-After"},"503":{"description":"Upstream unavailable; reconcile mutations before retrying"}}}},"/v1/delivery":{"post":{"operationId":"delivery","summary":"Read delivered codes or credentials for an intent in your own order. Treat the entire response as secret; do not put it in logs.","security":[{"SessionToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string","minLength":1,"maxLength":256},"intent_id":{"type":"string","minLength":1,"maxLength":256}},"required":["order_id","intent_id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Operation result. Inspect state/error and next_actions; HTTP 200 alone is not proof of execution.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request"},"401":{"description":"Missing or invalid session token"},"429":{"description":"Rate limited; use Retry-After"},"503":{"description":"Upstream unavailable; reconcile mutations before retrying"}}}}}}