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

# Authentication

> How to authenticate requests to the Snippex API

All requests to the Snippex API must include a valid API key in the `Authorization` header.

## Getting a key

1. Sign in at [snipex.dev/dashboard](https://snipex.dev/dashboard)
2. Click **New key**
3. Give it a name and click **Create**
4. Copy the full key — it's only shown once

Keys are prefixed with `snx_`.

## Using your key

Pass it as a Bearer token in every request:

```bash theme={null}
Authorization: Bearer snx_your_api_key
```

**Example:**

```bash theme={null}
curl -X POST https://api.snipex.dev/v1/search \
  -H "Authorization: Bearer snx_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"query": "..."}'
```

## Security best practices

<Warning>
  Never expose your API key in client-side code, public repositories, or logs.
</Warning>

* Store keys in environment variables, not hardcoded in source code
* Use one key per application or environment (staging vs. production)
* Rotate keys immediately if you suspect they've been compromised — delete the old one from the dashboard and create a new one
* On the server side, pass requests through a backend proxy rather than calling Snippex directly from the browser

## Errors

| Status                  | Meaning                                                        |
| ----------------------- | -------------------------------------------------------------- |
| `401 Unauthorized`      | Missing, invalid, or revoked API key                           |
| `429 Too Many Requests` | Rate limit exceeded — see [Rate Limits](/concepts/rate-limits) |
