AI agents
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
- Quickstart: the four calls.
- Amounts and fees: atomic integer strings, conversion, fees.
- Order lifecycle:
status,customerState, actions. - Deposits and refunds: short, late and over-deposits, refund addresses.
- Errors, limits and retries: error codes and the retry policy.
- API keys and fees, if the integration earns a fee.
- Live updates, if the UI needs real-time progress.
- The API reference and
openapi.jsonfor 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.xyzin 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,depositAmountandexpiresAtexactly. - Never retry
POST /v2/swapsorPOST /v2/bridgesautomatically. There is no idempotency key. - Store
sessionIdprivately and send it only in theX-Session-IDheader. - Render progress and actions from
customerState. Offer an action only forkind: "action_required". - Branch on error
code, never on the message. HonourRetry-Afteron429. - Never commit an integrator key. Use
wg_YOUR_KEYin 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
GETroute andPOST /v2/swaps/quoteare read-only. GET /v2/orderswith a fresh random session returns{ "orders": [] }.- Reading a made-up order id returns
404, and a made-up order on a WebSocket closes with4404.
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.