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

# Authentication

> Bearer API key authentication for all versioned endpoints.

## Bearer token auth

Send your API key in the `Authorization` header:

```http theme={null}
Authorization: Bearer <API_KEY>
```

All `/v1/*` endpoints require this header.

## API key formats

* Live keys: `sf_live_...`
* Test keys: `sf_test_...`

<Note>
  In self-hosted setups, use the key printed by `npm run seed` or any key you have provisioned via the dashboard.
</Note>

## Missing or invalid auth responses

<Tabs>
  <Tab title="Missing header">
    ```json theme={null}
    {
      "error": {
        "code": "unauthorized",
        "message": "Missing or invalid Authorization header"
      }
    }
    ```
  </Tab>

  <Tab title="Invalid key">
    ```json theme={null}
    {
      "error": {
        "code": "unauthorized",
        "message": "Invalid API key"
      }
    }
    ```
  </Tab>
</Tabs>
