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

# Authentication

> Authenticate V1 requests and trace them with request IDs.

All V1 endpoints require an API key.

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

Create and revoke keys in the [Viggle Dashboard](https://portal.viggle.ai/keys). Keep keys in server-side environment variables; never expose them in browser code, mobile apps, or public repositories.

## Example

```bash theme={null}
curl "https://apis.viggle.ai/v1/renders/render_xxx" \
  -H "Authorization: Bearer $VIGGLE_API_KEY"
```

## Request IDs

Every response includes an `X-Request-Id` header. You may also provide your own value in the request. Include this ID when contacting support so we can trace the request.

```bash theme={null}
curl "https://apis.viggle.ai/v1/renders/render_xxx" \
  -H "Authorization: Bearer $VIGGLE_API_KEY" \
  -H "X-Request-Id: checkout-render-42"
```

## Authentication errors

V1 errors use one envelope:

```json theme={null}
{
  "error": {
    "code": "invalid_api_key",
    "message": "Invalid or expired API key",
    "request_id": "req_123abc"
  }
}
```

See [Errors and recovery](/v1/production/errors) for handling guidance.
