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

# Authentication

> Authenticate TrueMath API requests with a bearer API key. How to create a key, send it, and rotate or revoke it.

The TrueMath API authenticates every request with a bearer API key tied to your account.

## The Authorization header

Send your key in the `Authorization` header:

```http theme={null}
Authorization: Bearer tm_live_...
```

A key is a single opaque string of the form `tm_live_<prefix>_<secret>`. Treat the whole string as a secret credential.

## Creating a key

Generate a key in the [app](https://app.truemath.ai), under **••• → API Key**. Creating a key requires the developer or owner role on the account.

<Warning>
  The full key is shown **once**, at creation. Copy it and store it somewhere secure — it cannot be displayed again. If you lose it, rotate the key to issue a new one.
</Warning>

## Using a key

```bash theme={null}
curl https://api.truemath.ai/v1/domains \
  -H "Authorization: Bearer tm_live_..."
```

A key is either **active** or **revoked**. Rotating a key issues a new secret and invalidates the previous one; revoking a key disables API access until a new key is created.

## Authentication errors

| Status | Code                     | Meaning                                                        |
| ------ | ------------------------ | -------------------------------------------------------------- |
| `401`  | `error_unauthorized`     | Missing or malformed `Authorization` header, or an invalid key |
| `403`  | `error_disabled_api_key` | The key has been revoked or disabled                           |

See [Errors](/api/errors) for the full error reference.
