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

# Authentication

> Send your dashboard API key in the X-API-Key header on every /v1 request.

All `/v1` endpoints require an API key. There is no unauthenticated public tier on these routes.

<Steps>
  <Step title="Create a key">
    Sign in to the [PolymarketData dashboard](https://app.polymarketdata.co) and create an API key.
  </Step>

  <Step title="Send it on every request">
    Use the `X-API-Key` header:

    ```bash theme={null}
    X-API-Key: pk_live_your_key_here
    ```
  </Step>
</Steps>

<CodeGroup>
  ```bash curl theme={null}
  curl "https://api.polymarketdata.co/v1/health" \
    -H "X-API-Key: pk_live_your_key_here"
  ```

  ```python python theme={null}
  import os
  import requests

  headers = {"X-API-Key": os.environ["POLYMARKETDATA_API_KEY"]}
  response = requests.get(
      "https://api.polymarketdata.co/v1/health",
      headers=headers,
      timeout=30,
  )
  response.raise_for_status()
  ```

  ```javascript javascript theme={null}
  const response = await fetch("https://api.polymarketdata.co/v1/health", {
    headers: { "X-API-Key": process.env.POLYMARKETDATA_API_KEY },
  });
  ```
</CodeGroup>

## Python SDK

The SDK reads `POLYMARKETDATA_API_KEY` automatically. You can also pass the key explicitly:

```python theme={null}
from polymarketdata import PolymarketDataClient

with PolymarketDataClient(api_key="pk_live_your_key_here") as client:
    print(client.utility.health().status)
```

<Warning>
  Keep live keys out of notebooks, git, and client-side apps. Use an environment variable or a secret manager.
</Warning>

## Failed authentication

| Status | Meaning                                                                            |
| ------ | ---------------------------------------------------------------------------------- |
| `401`  | Header missing, key invalid, or key expired                                        |
| `403`  | Key is valid, but the plan does not allow this resolution, lookback, or data point |
| `429`  | Rate limit exceeded for this key                                                   |

Missing key:

```json theme={null}
{ "detail": "API key is required. Include 'X-API-Key' header." }
```

Invalid or expired key:

```json theme={null}
{ "detail": "Invalid or expired API key." }
```

See [Errors and limits](/guides/errors) for plan `403` and rate-limit `429` handling.

<Tip>
  Call `GET /v1/usage` after you authenticate. It returns your plan name, remaining requests, allowed granularity, and which of metrics, prices, and books you can query.
</Tip>
