> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bungee.exchange/llms.txt
> Use this file to discover all available pages before exploring further.

# Get API Access

> Get API access to the Bungee API.

We support three types of API integrations, each with different endpoints, authentication methods, and rate limits:

1. **Public Sandbox** — For quick testing and development (no authentication required)
2. **Dedicated Backend** — For server-to-server integrations (API key authentication)
3. **Frontend / Direct** — For frontend, dApp, or mobile integrations (domain/IP whitelist)

For production use, [request API access here](https://forms.gle/z3q5RdXjouuXR85k9). Once you receive your API key, include it as `x-api-key` in the request header when making calls to the dedicated backend endpoint. You will also receive an affiliate ID for tracking purposes—include it as `affiliate` in the request header.

Each integration type uses a different base URL. See the details below and the comparison table for specific endpoints, authentication requirements, and rate limits.

### Public Sandbox — For Testing Only[​](#public-sandbox--for-testing-only "Direct link to Public Sandbox — For Testing Only")

* Endpoint: `https://public-backend.bungee.exchange/`

* Who this is for: Developers or teams who want to quickly try out APIs without setup.

* Key facts:

  * No authentication or whitelisting
  * Very limited RPS (shared/public)
  * Not suitable for production

### Dedicated Backend Integrators[​](#dedicated-backend-integrators "Direct link to Dedicated Backend Integrators")

* Endpoint: `https://dedicated-backend.bungee.exchange/`

* Who this is for: Projects that run their own backend servers and call our APIs server-to-server (typically a single IP or small range).

* Key facts:

  * Auth: API key via `x-api-key`
  * Default 20 RPS (extendable)
  * Limits enforced at the API key level

#### Example request[​](#example-request "Direct link to Example request")

```bash theme={null}
curl --location 'https://dedicated-backend.bungee.exchange/api/v1/supported-chains' \
  --header 'x-api-key: [YOUR-API-KEY]' \
  --header 'affiliate: [YOUR-AFFILIATE-ID]'
```

<Note>
  **Native Tokens**: For native assets (e.g., ETH, POL), use `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee` as the token address.

  **Token Decimals**: Always fetch token decimals via `/api/v1/tokens/list` to ensure accuracy when calculating `inputAmount` in wei.
</Note>

This API key provides you with a higher rate limit of 20 requests per second. You can find detailed documentation on all available endpoints on the [API Reference](/api-reference).

#### Security Recommendation[​](#security-recommendation "Direct link to Security Recommendation")

For production use, we strongly recommend routing API calls through your backend to keep your API key secure.

Exposing the key in frontend code allows anyone to extract it, which can lead to exhausted rate limits or unexpected costs.

If your frontend must call the API directly, please contact us to enable your allowed origin(s).

### Frontend / Direct Integrators[​](#frontend--direct-integrators "Direct link to Frontend / Direct Integrators")

* Endpoint: `https://backend.bungee.exchange/`

* Who this is for: Projects that call Bungee APIs directly from their frontend, apps, or mobile clients.

* Key facts:

  * Auth: Domain/IP whitelist (no API key)
  * Default 100 RPM per IP
  * Limits enforced at the IP level

## Comparison Table[​](#comparison-table "Direct link to Comparison Table")

| Integrator Type   | Endpoint                                     | Authentication      | Rate Limit          | Enforcement Method | Use Case                  |
| ----------------- | -------------------------------------------- | ------------------- | ------------------- | ------------------ | ------------------------- |
| Sandbox (Public)  | `https://public-backend.bungee.exchange/`    | None                | Very Limited        | Shared/Public      | Testing only              |
| Dedicated Backend | `https://dedicated-backend.bungee.exchange/` | API Key             | 20 RPS (extendable) | API key–based      | Production backends       |
| Frontend / Direct | `https://backend.bungee.exchange/`           | Whitelisted Domains | 100 RPM             | IP–based           | Frontends, dApps, wallets |

## Server Request ID[​](#server-request-id "Direct link to Server Request ID")

All responses include a `server-req-id` header that can be used for debugging purposes when contacting support. When encountering any errors or unexpected behavior:

1. Always capture and log this ID along with the error details
2. Include this ID when reporting issues to the Bungee team
3. Add the ID to any error messages shown to users to facilitate troubleshooting

Example of capturing the `server-req-id` in error handling:

```javascript theme={null}
async function getQuote(params) {
  const url = `${BUNGEE_API_BASE_URL}/api/v1/bungee/quote`;
  const queryParams = new URLSearchParams(params);
  const queryUrl = `${url}?${queryParams}`;

  const response = await fetch(queryUrl);
  const data = await response.json();
  const serverReqId = response.headers.get("server-req-id");

  if (!data.success) {
    throw new Error(
      `Quote error: ${data.statusCode}: ${data.message}. server-req-id: ${serverReqId}`
    );
  }

  return data.result;
}
```

The `server-req-id` provides the Bungee team with crucial information to trace the exact request through their systems, significantly improving debugging efficiency and resolution time.
