00Swap is a non-custodial swap aggregator. It asks several liquidity providers (NEAR Intents 1Click, Relay, SwapKit) for a price and returns the best routes. You pick one, get a deposit address, send the coins there, and the provider delivers the result to your recipient address. 00Swap never holds your funds or private keys.
- Base URL
https://api.00swap.com- Auth
- None for prices. Your own random
x-order-tokenowns an order. - Format
- JSON, amounts as decimal strings
Quick start: a full swap in five calls
Find the asset codes
Every asset has a unique code such as BTC, ETH, TRON_USDT or TON_USDT. The config lists all of them with network, decimals, whether a memo is needed, and the current service fee. Check
enabled: when it is false, new orders are paused.curl https://api.00swap.com/v1/orders/configPreview the price (no addresses needed)
Returns the routes every provider can offer right now, best first. Prices only: a preview cannot be turned into an order.
slippageBpsis your price tolerance in basis points (100 = 1%).curl "https://api.00swap.com/v1/orders/preview?from=BTC&to=TRON_USDT&sendAmount=0.01&slippageBps=100"Get a signed quote
Generate a random secret
x-order-token(64 lowercase hex characters) and keep it: it is the only proof that the order is yours. Send the real recipient address (destination chain) and refund address (source chain). Each route in the answer carries aquoteTokenthat is valid untilexpiresAt(about 30 seconds).TOKEN=$(openssl rand -hex 32) curl -X POST https://api.00swap.com/v1/orders/quote \ -H "Content-Type: application/json" \ -H "x-order-token: $TOKEN" \ -d '{"from":"BTC","to":"TRON_USDT","sendAmount":"0.01","slippageBps":100, "recipient":"TXYZ...your Tron address","refundTo":"bc1q...your Bitcoin address"}'Create the order and pay
Send the chosen
quoteTokenwith the samex-order-token. The answer is the order withdepositAddress(anddepositMemoon chains that need one, such as XRP). Send exactlysendAmountof the source asset to that address beforedepositDeadline.curl -X POST https://api.00swap.com/v1/orders \ -H "Content-Type: application/json" \ -H "x-order-token: $TOKEN" \ -d '{"quoteToken":"<quoteToken of the chosen route>"}'Track the status
Poll every 10–30 seconds until the status is final:
done,refunded,failedorexpired.destinationTxis the payout transaction,actualOutputthe amount received.curl https://api.00swap.com/v1/orders/<id> -H "x-order-token: $TOKEN"
Endpoints
| Method | Path | Auth | Limit per IP | What it does |
|---|---|---|---|---|
| GET | /v1/orders/config | none | — | Assets (code, symbol, network, decimals, memo), service fee in bps, enabled providers, whether new orders are open |
| GET | /v1/orders/preview | none | 180/min | Live prices of every provider for from, to, sendAmount, slippageBps; optional provider=near|relay|swapkit |
| POST | /v1/orders/quote | x-order-token | 30/min | Signed, executable routes for real addresses, each with a quoteToken and expiresAt |
| POST | /v1/orders | x-order-token | 5/min | Creates the order from one quoteToken and returns the deposit address |
| GET | /v1/orders/{id} | x-order-token | 60/min | Stored order state: status, amounts, deadlines, payout transaction |
| GET | /v1/orders/private/preview | none | 120/min | Private swap prices for from, to, sendAmount, slippageBps and route=1|2|3 |
| POST | /v1/orders/private/quote | x-order-token | 30/min | Signed private routes; needs hubRefundTo (an EVM address) besides recipient and refundTo |
| POST | /v1/orders/private | x-order-token | 5/min | Creates the private order from one quoteToken; track it with GET /v1/orders/{id} |
| GET | /v1/markets/prices | none | 60/min | USD prices of supported tokens |
| GET | /v1/markets/sparklines | none | 30/min | Recent price history of the main coins for charts |
| GET | /v1/site/status | none | — | { maintenance, maintenanceUntil } — check before starting a swap |
| GET | /health/live | none | — | Liveness check |
Private swaps
A private swap runs in two hops through an intermediate asset, so the payout transaction is not linked to your deposit on-chain. The same asset on both sides is allowed (BTC → BTC). The API never names the providers or the hub: a route is just a number (1 or 2). Check privateEnabled and privateFeeBps in the config first.
Preview a private route
Ask each route separately. The answer may carry
advice.suggestedMinimum: below that amount the fixed cost of two hops eats a noticeable share.curl "https://api.00swap.com/v1/orders/private/preview?from=BTC&to=BTC&sendAmount=0.05&slippageBps=20&route=1"Quote and create
Same as a regular swap plus
hubRefundTo: an EVM address (0x…) that gets the intermediate asset back if hop 2 fails. Then create the order with the chosenquoteToken.curl -X POST https://api.00swap.com/v1/orders/private/quote \ -H "Content-Type: application/json" -H "x-order-token: $TOKEN" \ -d '{"from":"BTC","to":"BTC","sendAmount":"0.05","slippageBps":20, "recipient":"bc1q...new address","refundTo":"bc1q...your address", "hubRefundTo":"0x...your EVM address"}' curl -X POST https://api.00swap.com/v1/orders/private \ -H "Content-Type: application/json" -H "x-order-token: $TOKEN" \ -d '{"quoteToken":"<quoteToken of the chosen route>"}'
hops- Status of each hop: [{ status }, { status }].
round- { current, total } when the swap may run several rounds; then the quote also has estimatedMaxSeconds.
hub_refunded / hub_failed- Final statuses: hop 2 failed and the intermediate asset went back to hubRefundTo. hubRefund says which asset, how much, and whether it sits in the NEAR Intents account of that address (intents: true).
custodial- When true (BTC deposits only), the deposit goes to a transit address of 00Swap's node and is forwarded after confirmationsRequired confirmations; depositConfirmations shows progress.
Popular asset codes
BTCBitcoinETHEther on EthereumUSDTTether on Ethereum (ERC20)TRON_USDTTether on Tron (TRC20)TON_USDTTether on TONBSC_USDTTether on BNB Chain (BEP20)USDCUSD Coin on EthereumSOLSolanaTRXTronGRAMTON (ex-Toncoin)BNBBNB ChainXRPXRP Ledger (needs memo)DOGEDogecoinNEARNEAR
The full list with decimals is in GET /v1/orders/config → assets.
Rules that keep a swap safe
- Amounts are strings
- Send and read every amount as a decimal string ("0.01", not 0.01 or 1e-2). Do not convert to floating point. Precision cannot exceed the asset's decimals.
- Addresses are checked
- recipient must be valid on the destination network, refundTo on the source network. Invalid addresses get 400 before any provider is asked.
- Keep the x-order-token secret
- 64 lowercase hex characters you generate yourself. The server stores only its SHA-256. Lose it and you cannot read the order; leak it and anyone can.
- Quotes expire
- A quoteToken lives about 30 seconds. If creating the order fails with an expired quote, ask for a new quote. Never reuse a preview as a price promise.
- Memo is mandatory where present
- If the order has depositMemo (XRP), the deposit must carry it or it will not be credited.
- Fees are already included
- expectedOutput and minimumOutput already include the service fee (feeBps, feeAmount) and provider fees. Network gas of your own deposit transaction is extra.
- No JSON Content-Type on GET
- Send Content-Type: application/json only with a body. POST without it gets 400.
- Server-side use
- Call the API from a server, script, bot or agent. Browsers on other websites are blocked by CORS and Origin checks; embed a link to 00swap.com instead.
Order statuses
preparing- Order is being created with the provider.
awaiting_deposit- Waiting for your deposit to depositAddress.
confirming- Deposit seen, the swap is in progress.
done- Final. Paid out: see actualOutput and destinationTx.
refunded- Final. Returned to refundTo: see refundedAmount.
incomplete_deposit- Less than sendAmount arrived; the provider resolves it, keep polling.
failed- Final. The swap failed; contact support with the order id.
expired- Final. No deposit arrived in time; nothing was charged.
creation_unknown- The provider did not confirm creation; do not send funds, keep polling.
Errors
400- Invalid input: unknown asset, same asset on both sides, bad amount or precision, invalid address, unknown field.
403- Missing or invalid x-order-token, or a request from a foreign website (Origin).
404- Order not found for this id and token.
409- Creating the order failed with code quote_expired, quote_stale or rate_changed: request a fresh quote and confirm it with the user again. Repeating the same quoteToken after a timeout is safe.
429- Rate limit or provider capacity. Wait for the Retry-After header (or retryAfterMs) and repeat.
503- New orders are paused or every provider is unavailable.
providerErrors- Preview and quote answer 200 with partial results: routes from providers that answered and providerErrors[] with a code from the rest — amount_too_low, no_liquidity, pair_unavailable, invalid_recipient, invalid_refund, address_rejected, busy (retry after retryAfterMs).
Instructions for AI agents
Give your agent 00swap.com/llms.txt or openapi.json. When it swaps for a person, it should follow these rules:
- Always show the user the asset, network, amount to send, expected and minimum amount to receive, and fee before creating an order, and get an explicit yes.
- Show depositAddress and depositMemo exactly as returned. Never shorten, retype or guess them.
- Make sure the user sends the source asset on the source network (for example USDT on Tron for TRON_USDT, not USDT on Ethereum).
- Do not promise the expected amount: the user is guaranteed at least minimumOutput, otherwise the swap is refunded.
- Keep the x-order-token and order id so you can report the status later; do not print the token in public channels.
- If new orders are paused or a route is missing, say so. Do not invent prices or routes.
FAQ
Do I need an API key or an account?
No. The public API needs no key, no registration and no KYC. Limits are per IP address.
Can an AI agent (ChatGPT, Claude, Gemini, a custom bot) swap crypto with this API?
Yes. An agent with HTTP access can list assets, compare prices, create an order and track it. The user only has to send the deposit from their own wallet. Point the agent at https://00swap.com/llms.txt.
Is 00Swap custodial?
No. Deposits go straight to the liquidity provider's address, and the result goes to your recipient address. 00Swap never holds funds or keys.
How much does it cost?
The API is free to call. A swap costs the service fee shown as feeBps in /v1/orders/config and in every route, plus provider fees; both are already subtracted from expectedOutput.
Which coins and networks are supported?
Bitcoin, Ethereum, Solana, Tron, TON, BNB Chain, Arbitrum, Base, Polygon, Avalanche, XRP, Dogecoin, Bitcoin Cash, NEAR and Zcash, including USDT and USDC on several networks. The exact list is in GET /v1/orders/config.
Is there an OpenAPI specification?
Yes: https://00swap.com/openapi.json (OpenAPI 3) describes every public endpoint and schema, and the Swagger UI at https://api.00swap.com/reference lets you try them in the browser.