# API keys and integrator fees

> Get a Wagyu integrator key in two minutes, earn your own fee on every order you send, read your reporting, and understand rate limits, order ownership and session credentials.

You do not need a key to quote, create or track swaps. A key is what attributes orders to your app and pays you a fee on each one.

| With a key you get | |
| --- | --- |
| **Your own fee** | 0–5% on every order you send, paid to your own wallets. |
| **Attribution and reporting** | Your orders, volume and fees earned, across all your keys. |
| **Limits that grow with you** | A new integration works right away on starter limits. Wagyu raises them for production traffic. |

## Get a key (self-serve, about two minutes)

1. Open **[wagyu.xyz/api](https://wagyu.xyz/api)**.
2. **Connect a wallet.** Any EVM wallet (MetaMask, Rabby…) or a Solana wallet. This wallet owns the integration; you sign in with it again to manage it.
3. **Sign the login message.** It is a plain message, not a transaction: no gas, nothing moves. Only sign it on wagyu.xyz. The login lasts 24 hours.
4. **Create an integration.**
   - **App name:** 2–50 characters (letters, digits, spaces, `-`, `_`).
   - **Payout addresses:** one **EVM**, one **Solana** and one **Bitcoin** address. All three are required. If you signed in with an EVM wallet, the EVM field is pre-filled.
5. **Copy the key.** It looks like `wg_` followed by 48 hex characters and **is shown once**. Wagyu stores only a hash; afterwards the page shows the first 12 characters so you can tell keys apart.
6. **Set your fee.** A new integration starts at `0`%. Change it on the same page, from `0` to `5`.

> **Starter limits:** A new integration works right away on **starter limits**: a small allowance of orders a minute, unfinished orders and quotes a minute, shared by all its keys. Every caller of a starter key is also held to the [per-IP limits](#limits), as if it sent no key. The portal shows the exact numbers on each integration, and `access` in `GET /v2/integrator/me` returns them. A request over a starter limit gets `429 rate_limited`, and its `error` says it is a starter limit. To raise them, [contact support](https://t.me/wagyu_support) with your app's name and the volume you expect.

One wallet can own up to **5 integrations**, and each integration can have **several keys** (one per server or environment). All keys of an integration share its fee and payout addresses. From the same page you can change the fee and the payout addresses (your wallet signs the new addresses, so a session alone cannot redirect your fees), issue or revoke a key, delete the integration (every key stops at once, and this cannot be undone from the page), and see orders, volume and fees earned.

> **Keys are for servers:** Keys from the portal are **server keys**: keep them on your backend and never ship them in a web page or an app. For a browser or mobile app, ask [Wagyu support](https://t.me/wagyu_support) for a **public-client key**. It still earns your fee, but it uses per-IP limits and cannot read reporting. All the users of one public-client key also share one request allowance per minute, so a key extracted from your app cannot be used without bound. A public-client key cannot be turned into a server key.

## Send the key

Send it as a header on quote and create requests:

```http
X-Integrator-Key: wg_YOUR_KEY
```

| Situation | What the API does |
| --- | --- |
| No key | Works. The order is not attributed and carries no integrator fee. |
| `X-API-Key: wg_…` | Accepted as an alias of `X-Integrator-Key`. |
| Invalid, revoked or suspended key | `401 unauthorized`. |
| `integratorFeePercent` sent without a key | `401 unauthorized`. |
| Key put in the URL (`?apiKey=…`) | `400 invalid_request`: the API refuses query parameters it does not know. |
| Key or settings changed in the portal | Can take up to one minute to apply. |

Each line above that names a status was checked against the live API. With an invalid key:

<!-- POST /v2/swaps/quote · 401 -->
```json
{
  "code": "unauthorized",
  "error": "Authentication required."
}
```

## Your fee

Your integration's default fee applies to every order sent with your key. To charge a different fee on one quote or order, send `integratorFeePercent` (0–5) in the body:

```json
{ "integratorFeePercent": 0.5 }
```

Your fee is **added on top of Wagyu's own fee**, so the user sees it in the quote. The quote returns it as `integratorFee`: `{ feePercent, feeAmountUsd, feeAddress }`, or `null` when no fee applies to that route. Treat the quote as the source of truth.

The payout address depends on what the user sends:

| User sends from | Your fee is paid to your |
| --- | --- |
| An EVM chain (Ethereum, Arbitrum, Base, BSC, HyperEVM…) | EVM address |
| Solana | Solana address |
| Bitcoin | Bitcoin address |
| Monero (XMR) | EVM address |
| Tron | No integrator fee on Tron sources today (`integratorFee` is `null`) |

A fee too small to be worth its own transfer cost is **skipped**, not owed. Sending `integratorFeePercent` above `0` on a Tron source is refused with `400`, since there is no address to pay it to.

## Reporting

Both routes need a **server** key and cover the whole integration across its keys. A public-client key gets `403`.

| Route | Returns |
| --- | --- |
| [`GET /v2/integrator/me`](https://docs.wagyu.xyz/api-reference/get-integrator.md) | `{ integrator, stats, access }`: profile, fee settings, activity, current limits and usage. |
| [`GET /v2/integrator/orders`](https://docs.wagyu.xyz/api-reference/list-integrator-orders.md) | `{ orders, total, limit, offset }`: attributed orders, each with a fee status: `none`, `projected`, `paid`, `owed` or `skipped`. |

These two routes are not in `openapi.json`.

## Limits

Requests without a key, and requests with a public-client key, are limited per IP. A public-client key's requests also share one allowance across all its users: the per-IP request limit below unless Wagyu set another for that key (`X-RateLimit-Resource: key_requests`). These are the current defaults:

| Default limit (anonymous or per IP) | Value | Field in defaultLimits |
| --- | --- | --- |
| Requests per minute | 600 | `requestLimitPerMin` |
| Quotes per minute | 60 | `quoteLimitPerMin` |
| Order creations per minute | 6 | `createLimitPerMin` |
| Unfinished orders at once | 5 | `maxOpenOrders` |
| Window in which an unfinished order counts | 30 minutes | `openOrderWindowMinutes` |

_Live from `GET /v2/swaps/terms`, read when this page was built (4 Dec 2026, 19:24 UTC)._

A new integration is on [starter limits](#get-a-key-self-serve-about-two-minutes). Once Wagyu approves it, its server keys share **integration limits**: one allowance for the whole integration, across all its keys and every server they call from. `access.tier` in `GET /v2/integrator/me` says which you are on: `starter` or `standard`. A standard integration starts on a preset that Wagyu raises for your traffic, so tell [support](https://t.me/wagyu_support) the volume you expect. Either way, read your limits from `access.limits` instead of assuming the defaults. On `429`, wait for the `Retry-After` header. `X-RateLimit-Resource` names the limit you hit, and the `error` says whose it is: your integration's, one key's, or one end user's. The values are listed in [Errors, limits, retries](https://docs.wagyu.xyz/actions-and-retries.md#rate-limits).

Order creations are also limited in how many can be in progress at once from one address, your server's included. Past that, a create gets `429` with `X-RateLimit-Resource: creation` and a `Retry-After` of a few seconds: retry when one of your creates has returned.

Unfinished orders count against `maxOpenOrders` for 30 minutes. They stop counting once completed, failed, expired or refunded. Revoking or rotating a key does not free their slots.

### Forward each end user's IP (backends serving many users)

Everything your backend sends shares your integration's limits, so one busy user can use them up for everyone. Forwarding each user's IP adds a per-user ceiling under those limits. It does not add capacity: to serve more traffic, ask for higher integration limits. Forwarding needs a `standard` integration: ask [support](https://t.me/wagyu_support) to approve your server's egress IP, then send the user's IP on each request. `access.clientIpForwarding.status` says where you stand: `unavailable` (not on the standard tier), `inactive` (no server approved yet) or `active`.

```http
X-Integrator-Key: wg_YOUR_KEY
X-End-User-IP: 203.0.113.42
```

- Send one literal IPv4 or IPv6 address: no port, hostname, CIDR range or list. Take it from your trusted ingress and overwrite any value the user supplied.
- Use `X-End-User-IP`, not `X-Forwarded-For`, `CF-Connecting-IP` or `X-Real-IP`.
- Each forwarded user gets the per-user limits in `access.clientIpForwarding.limits`, and every request still counts against your integration's limits. Once forwarding is on, requests without the header share one per-user allowance.
- An IPv6 user counts as its /64, like a direct caller: users in one /64 share one allowance.
- Forwarding from a server that is not approved returns `403`; an invalid address from an approved server returns `400`.

## Order ownership

Orders are not tied to an account. Whoever holds an order's **session** owns it.

| Credential | How to send it | What it allows |
| --- | --- | --- |
| `sessionId`, returned when the order is created | Header `X-Session-ID` | Read the order and take every owner action (refund address, review, delete…). |
| The order's exact destination address | Query `?verify=<address>` | Read that one order. No actions. |
| Your integrator key | Header `X-Integrator-Key` | Attribution and fees. It does not unlock other people's orders. |

- Keep the session out of URLs, logs and analytics.
- An `orderId` alone grants nothing. A missing order and a wrong proof both answer `404`.
- With a valid integrator key you may supply your own `sessionId` (16–64 characters of hex digits and hyphens) at creation, to group your users' orders. It is **not** an idempotency key and does not prevent duplicates.

---
Source: https://docs.wagyu.xyz/authentication · Built from the live Wagyu API on 2026-12-04.
