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

# Authentication

> Authenticate every request with your secret API key.

Every request is authenticated with a secret key sent in the `X-Auth-Key` header.

```bash theme={null}
curl "https://www.serializedaudit.io/api/audit-contract?chain=base&address=0x..." \
  -H "X-Auth-Key: sk_live_your_key_here"
```

## Getting a key

Generate keys from the **API keys** section of your [dashboard](https://www.serializedaudit.io/portal). You can create several, name them per environment, and revoke or rotate any of them independently. The secret is shown **once** at creation, so copy it then.

## Keep your key secret

<Warning>
  Your key authenticates billable requests. Anyone who has it can spend your credits.
</Warning>

<CardGroup cols={2}>
  <Card title="Keep it server-side" icon="server">
    Call the API from your backend. Never ship a key in a browser bundle, mobile app, or public repo.
  </Card>

  <Card title="Rotate on exposure" icon="rotate">
    If a key leaks, rotate it from the dashboard. The old secret stops working immediately.
  </Card>
</CardGroup>

## Errors

A missing or invalid key returns `401 Unauthorized`. See [Errors & Status Codes](/errors).
