Qiguard API
The Qiguard API prices token swaps and builds the transaction for them on BSC, Ethereum, Base and Polygon. Every trade settles in one transaction through the Qiguard settlement contract of the chain, straight from the taker's wallet.
Paths, parameters and response fields follow the 0x Swap API v2 and Gasless API v2 wherever the meaning is the same, so an existing 0x integration moves over by changing the host and the key (the 0x header names are accepted too); the few parameters that differ are listed on Migrate from 0x.
Not in v1: integrator fees (swapFee*), exact-out (buyAmount) and the /swap/permit2/* endpoints.
Products
| Product | What it does | Chains |
|---|---|---|
| Swap (allowance holder) | price and quote; the quote returns the transaction the taker sends | BSC, Ethereum, Base, Polygon |
| Gasless | The taker signs a Permit2 message; the Qiguard relayer sends the transaction and pays the gas | BSC, Base |
| Chain | chainId | Swap | Gasless | Sources | Listed tokens |
|---|---|---|---|---|---|
| BSC | 56 | yes | yes | PancakeSwap_V2, PancakeSwap_V3 | 46 |
| Ethereum | 1 | yes | no | Uniswap_V2, Uniswap_V3 | 54 |
| Base | 8453 | yes | yes | Uniswap_V2, Uniswap_V3 | 21 |
| Polygon | 137 | yes | no | QuickSwap_V2, Uniswap_V3 | 16 |
Gasless is being enabled per chain; until then POST /gasless/submit returns 503 GASLESS_NOT_ENABLED, and GET /gasless/chains shows enabled: false for that chain. Gasless price and quote work on both chains meanwhile.
Base URL and headers
- Base URL:
https://api.qiguard.com. HTTPS only. - Keyed endpoints (price, quote and gasless) need two headers:
qg-api-key: qg_sk_...andqg-version: v1. The 0x names0x-api-keyand0x-version: v2work as well. - Keyless endpoints:
GET /swap/chains,GET /gasless/chains,GET /sources,GET /tokens,GET /status. - Amounts are decimal strings in base units. Responses use checksummed addresses. The native coin of every chain is
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE. - Every response carries the header
qg-zidand the body fieldzid. Keep it in your logs: it identifies the request.
Access
- Sign in at dashboard.qiguard.com with MetaMask.
- Create an app (products and chains) and a secret key.
- Every new app is reviewed during the invite phase. Until it is approved, its keys answer
403 APP_NOT_APPROVED.
The Quickstart walks through the first price, quote and swap.
What the API does not do
- It never holds user funds or user keys. The taker's wallet approves the settlement contract (or Permit2 for gasless) and the contract pays the output to the taker in the same transaction.
- Swaps are exact-in:
sellAmountis fixed,buyAmountis computed. - One route per trade: one liquidity source family per chain (a V2 and a V3 source), at most two hops.
Pages
- Swap: parameters, pairs, fees, approvals and the transaction.
- Gasless: Permit2 signature, submit, status and sponsored gas.
- API reference: every endpoint, parameter, response and schema.
- Errors, Rate limits and plans, Idempotency, Versioning.
- Contracts and fees, Security, Testing, Changelog.
- Machine-readable: openapi.yaml, openapi.json, llms.txt.
This page as Markdown: index.md. All pages for tools: llms.txt.