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

# Authentication

> Authenticate FiveMesh API requests with scoped service keys.

FiveMesh API requests use service keys created from the dashboard.

Keys are scoped to personal resources or organization resources, and can be limited by service, action and CDN path prefix.

## Authorization header

Pass the service key as a bearer token.

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

Example request shape:

```bash theme={null}
curl "$FIVEMESH_API_URL/v1/..." \
  -H "Authorization: Bearer $FIVEMESH_API_KEY"
```

## Key scopes

Choose scopes based on where the key runs:

| Scope                  | Use it when                                                       |
| ---------------------- | ----------------------------------------------------------------- |
| Personal resources     | A script operates services owned by your personal workspace.      |
| Organization resources | A script operates services shared with an organization workspace. |
| CDN path prefixes      | A script should only read or write selected public asset paths.   |

## Secret handling

Store service keys in server environment variables, deployment secrets or a server-only configuration file.

<Warning>
  The secret is shown once when the key is created. Rotate the key if it has been copied into a client script, repository or browser bundle.
</Warning>

## Related pages

* [API keys](/account/api-keys)
* [FiveMesh CDN API](/api-reference/cdn)
* [FiveMesh Cache API](/api-reference/cache)
