Open app

AI agents

Markdown

Build with an AI agent

These docs are written to be read by people and by AI tools alike. Point your agent at the Markdown and the contracts, not at screenshots.

#What to give the agent

Resource Use
/llms.txt Index of every page, linking the Markdown copies. Start here.
/llms-full.txt Every guide and reference page in one file.
Any page + .md The page as plain Markdown, for example /getting-started.md. The Copy page button at the top of each page does the same.
/openapi.json The HTTP contract (OpenAPI 3.1), identical to https://api.wagyu.xyz/v2/docs.
/asyncapi.json The WebSocket contract (AsyncAPI 3.0).
https://mcp.wagyu.xyz The MCP server, if the agent should place swaps itself rather than write code.

#Reading order

  1. Quickstart: the four calls.
  2. Amounts and fees: atomic integer strings, conversion, fees.
  3. Order lifecycle: status, customerState, actions.
  4. Deposits and refunds: short, late and over-deposits, refund addresses.
  5. Errors, limits and retries: error codes and the retry policy.
  6. API keys and fees, if the integration earns a fee.
  7. Live updates, if the UI needs real-time progress.
  8. The API reference and openapi.json for exact fields.

#A prompt you can paste

Prompt
Build a Wagyu swap integration. Read https://docs.wagyu.xyz/llms.txt first, then the pages it links in this order:
getting-started, money-and-settlement, order-lifecycle, deposits, actions-and-retries. The HTTP contract is
https://docs.wagyu.xyz/openapi.json. Follow the rules on https://docs.wagyu.xyz/agent-handoff.md exactly.
Call the API from the server, keep the base URL in one config value, and never create a real order in tests.

#Rules the code must follow

  • Call the API from a server or a native app. Web pages on other sites are blocked by CORS.
  • Keep https://api.wagyu.xyz in one configuration value.
  • Send amounts as atomic integer strings. Convert with the token's decimals, never with floats.
  • Take token values from the catalog. Do not invent addresses or rely on "native".
  • Treat the quote as an estimate. Show the created order's depositAddress, depositAmount and expiresAt exactly.
  • Never retry POST /v2/swaps or POST /v2/bridges automatically. There is no idempotency key.
  • Store sessionId privately and send it only in the X-Session-ID header.
  • Render progress and actions from customerState. Offer an action only for kind: "action_required".
  • Branch on error code, never on the message. Honour Retry-After on 429.
  • Never commit an integrator key. Use wg_YOUR_KEY in examples and read the real key from the environment.

#Testing without moving money

There is no sandbox, and every created order is real. What can be tested freely:

  • Every GET route and POST /v2/swaps/quote are read-only.
  • GET /v2/orders with a fresh random session returns { "orders": [] }.
  • Reading a made-up order id returns 404, and a made-up order on a WebSocket closes with 4404.

An order that is created but never funded simply expires at expiresAt. Nothing moves until a deposit is sent, so tests should stop before sending funds.

Tip: every page is also plain Markdown, and /llms.txt indexes them for AI tools.