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

# Authentication

> Authenticate every request with your API key.

## API keys

Every request to the API is authenticated with an API key, passed in the `X-API-Key`
header. Keys are issued from the [dashboard](https://tallyscrape.com) and always start
with the `spy_` prefix.

```bash theme={null}
curl https://api.tallyscrape.com/scrape \
  -H "X-API-Key: spy_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://books.toscrape.com"}'
```

<Warning>
  Your API key is a secret. Keep it server-side, never commit it to source control, and
  never expose it in client-side code. Anyone with your key can spend your credits.
</Warning>

## Getting your key

1. Sign up on the [dashboard](https://tallyscrape.com).
2. Your API key is shown **once** at creation — copy it immediately.
3. Only a hash of the key is stored on our side, so we can never show it to you again.

## Rotating a key

You can regenerate your key from the dashboard at any time. Regenerating **immediately
invalidates the previous key** and returns a new one (shown once). Update your
integrations with the new key right away.

## Missing or invalid key

A request without a valid key returns **401 Unauthorized**:

```json theme={null}
{ "error": "Missing or invalid API key (X-API-Key header)." }
```

See [Errors](/errors) for the full list of status codes.
