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

# Authentication

> How to obtain and use an API key for Bebop's trading and data APIs.

All production usage of Bebop's APIs requires an API key. Without one, trading endpoints return widened demo-mode quotes and some endpoints are inaccessible entirely.

## Obtaining an API Key

Request an API key through the [Bebop support page](/support). The team will provision a key and send it to you directly.

## Passing Your API Key

<Tabs>
  <Tab title="REST APIs">
    For HTTP requests (RFQ, Aggregation, Trade History), pass `source` (your partner identifier) as a query parameter, and authenticate with either the `source-auth` query parameter or header:

    ```python theme={null}
    YOUR_API_KEY = "YOUR_API_KEY"

    # Option 1: query parameter
    params = {"source": "your-partner-id", "source-auth": YOUR_API_KEY}

    # Option 2: Authorization header
    params = {"source": "your-partner-id"}
    headers = {"source-auth": f"{YOUR_API_KEY}"}
    ```
  </Tab>

  <Tab title="WebSocket">
    For WebSocket connections (Price API), pass `name` (your integration identifier) and `authorization` as query parameters:

    ```python theme={null}
    ws_url = "wss://api.bebop.xyz/pmm/ethereum/v3/pricing?name=YOUR_NAME&authorization=YOUR_API_KEY"
    ```
  </Tab>
</Tabs>

## What Requires Authentication

| API                   | Without key                                                                           | With key                                                                       |
| --------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| **Price API**         | Cannot connect                                                                        | Full access to real-time price streams                                         |
| **RFQ API**           | Demo mode  - quotes are widened, heavily rate limited and not suitable for production | Firm, tight quotes ready for execution                                         |
| **Aggregation API**   | Demo mode  - quotes are widened, heavily rate limited and not suitable for production | Firm, tight quotes ready for execution                                         |
| **Trade History API** | Public lookups by wallet address only                                                 | Full access  - filter by `source` to see trades attributed to your integration |

Demo mode is useful for testing your integration flow end-to-end before going live, but the prices returned are not competitive.

## Rate Limits

Rate limits apply per API key. If you have concerns about throughput for your use case, reach out via the [support page](/support).

## Best Practices

Keep your API key secret. Do not expose it in client-side code, public repositories, or browser network requests. All Bebop API calls should be made from your backend.

If you suspect your key has been compromised, contact the Bebop team immediately via the [support page](/support) to rotate it.
