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

# Authentication

> Authenticate to the HERO REST API and MCP server with Bearer API keys. Generate, scope, and revoke keys from your account settings.

The HERO REST API authenticates with **API keys** issued from your account settings. <br />
Pass the key on every request as:

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

## Generating an API key

1. Sign in at [HERO](https://app.myhero.so).
2. Open **[Settings](https://app.myhero.so/#/settings/account "https://app.myhero.so/#/settings/account")** and click **Generate new API key**.
3. Choose a name, workspace scope (all of your workspaces, or specific ones), and an expiry. Copy the key — it's shown once.
4. Use it in any `Authorization: Bearer <key>` header.

API keys inherit your user permissions within the workspaces they're **scoped** to. <br />
Revoking a key from the same settings page invalidates it **immediately**.

## Using the same key for MCP

Your `hero_ak_*` API key also authenticates MCP clients (Cursor, VS Code, Claude Desktop, Claude Code) — see [MCP authentication](./mcp/authentication) for client-config snippets and the OAuth alternative. Tokens issued from the MCP settings page (`hero_at_*` prefix) work the same way; the two settings pages are just convenience for the two surfaces.
