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

# Authentication

> How F13 API keys work and how to handle them

The API authenticates with bearer API keys:

```text theme={null}
Authorization: Bearer f13_sk_live_…
```

Every request must carry this header. Requests without a valid key receive a
[`401`](https://docs.f13.com/errors).

## API keys

Keys are created per workspace in the [dashboard](https://app.f13.com) under
**Settings → API keys**. A key is tied to the workspace it was created in:
usage is billed to that workspace and generated assets are saved to its
library.

* **Format** - `f13_sk_live_` followed by 43 characters of random data.
* **Shown once** - the full key appears only at creation. The dashboard keeps
  a short prefix (for example `f13_sk_live_AbCd1234`) so you can tell keys
  apart, but the secret itself is not retrievable. Keys are stored hashed.
* **Revocation** - revoking a key takes effect immediately; requests with a
  revoked key receive `401`.
* **No test mode** - there is no `f13_sk_test_` variant. All keys are live
  and all successful generations are billed.

## Handling keys safely

> [!WARNING]
>
> Never ship an API key in client-side code - browser bundles, mobile apps, or
> public repositories. Anyone holding the key can generate at your workspace's
> expense. Calls to the API belong on your server.

* Load keys from environment variables or a secret manager, never from source
  control.
* Create one key per integration or environment so you can revoke narrowly.
* Revoke and replace a key immediately if you suspect it leaked.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.