Authentication
API v1 can be called with or without an API key. Without one you're on the free tier and identify yourself with your public integratorId; with one you get higher rate limits, can charge an integrator fee, and can create deposit addresses, which require a key.
Your integratorId
Your integratorId is your public identity at Swapper — the same id you pass to the widget. It identifies you; it doesn't authenticate you: it ships in your frontend, so anyone can read it and send it. You'll find it in the Integrator Dashboard under Settings. To get one, open a ticket in Discord — see Support.
Without a key (free tier)
Send your id as integrator — a field of the JSON body on POST endpoints, a query parameter on GET endpoints. It's required on /v1/quote:
curl -X POST "https://swapper.finance/api/v1/quote" \
-H "Content-Type: application/json" \
-d '{ "integrator": "YOUR_INTEGRATOR_ID", "fromChain": 8453, … }'An unknown or malformed
integratoris rejected with400INVALID_INTEGRATOR.The catalog and status endpoints (
/v1/chains,/v1/tokens,/v1/token,/v1/status) don't need it. You can still addintegratorto any request so it's counted under your integrator on the dashboard's API usage page.Keyless requests are rate-limited per client IP, with a ceiling per
integratorId— see Rate Limits.
With an API key
Create a key
Owners create keys in the Integrator Dashboard under API keys:
Keys look like
swp_followed by 43 characters.The full key is shown once, when you create it. Copy it straight into your secret manager; afterwards the dashboard only shows its prefix (e.g.
swp_AbCd1234).You can hold up to 10 active keys. All keys of an integrator share one rate-limit budget.
Keys are for production — there is no testnet environment for the API.
Name each key after where it lives ("Production server", "Reporting job") so you know what breaks if you revoke it.
Send it
Send the key in the x-swapper-api-key header on every request:
The key determines your integrator, so omit
integrator. If you do send it, it must match the key's integrator, or the request fails with400INVALID_INTEGRATOR.An unknown or revoked key fails with
401INVALID_API_KEY. v1 never silently downgrades a bad key to the free tier.
What a key unlocks
Higher rate limits, counted per integrator instead of per IP — see Rate Limits.
Integrator fees —
feeon/v1/quote. See Integrator Fees.Your own fee details on
/v1/status— for transfers that belong to you, the response also includesintegratorand thefeeCostsbreakdown.Per-key attribution on the dashboard's API usage page.
Rotate and revoke
To rotate: create a new key, deploy it, then revoke the old one in the dashboard. A revoked key stops working within a minute — requests using it then fail with 401 INVALID_API_KEY. Revoking can't be undone.
If a key leaks, revoke it immediately and create a replacement.
Browser requests and allowed origins
Because your integratorId is public, someone else's site could send it. Allowed origins let you lock browser use of your id to your own sites. Owners set them in the dashboard under Settings → Allowed origins.
The list is opt-in — while it's empty, any site can use your id. Once you add at least one origin:
Keyless browser requests that name your
integratorIdfrom any other origin are rejected with403ORIGIN_NOT_ALLOWED.Requests from your listed origins get widget-level rate limits — counted per end-user IP instead of against the shared public limits. See Rate Limits.
Not affected by the list:
requests that carry an API key;
server-side requests (no
Originheader);Swapper's hosted widget (
https://deposit.swapper.finance, what the iframe SDK loads) — it always works.
Origins are written as scheme://host[:port] with no path, e.g. https://app.example.com. They must use https (http is only accepted for localhost); you can list up to 20. The browser's Origin header is matched (or the Referer's origin when there is no Origin).
Last updated