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

# Authentication and API Keys

> Create a Fiddler API key, send it in the Authorization header, and fix 401 and 403 errors.

Every call to the Fiddler REST API must carry an API key, a secret string that tells Fiddler who is calling.
The Fiddler Python client and SDKs take the same key as their token.

## Create a Key

* **For your own scripts and notebooks**, create a personal API key under **Settings**, then **Credentials**. It acts as you, with your permissions. See [Creating API Keys](https://docs.fiddler.ai/reference/administration/settings.md#creating-api-keys).
* **For automated work**, such as pipelines and collectors, use a service account key. An Org Admin creates it, it starts with `fks_`, and it has only the access the admin grants. See [Create an API Key](https://docs.fiddler.ai/reference/access-control/service-accounts.md#create-an-api-key).

Fiddler shows a key only once, when you create it. Copy it and store it like a password.

## Send the Key

Send the key in the `Authorization` header, the line of the request that carries it. Write `Bearer`, a space, and then the key:

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

## Use Your Fiddler Address

Send each request to the address of your own Fiddler site, the one you open in your browser to sign in, followed by the path of the call.
This page uses `https://your-instance.fiddler.ai`, and the REST API reference samples use `https://api.example.com`. Replace either with your address.

## Example Request

This request lists the projects your key can see. It works with a personal API key or a Specific Projects service account key; an Entire Org service account key gets 403. See [List of projects](https://docs.fiddler.ai/sdk-api/rest-api/projects/get-projects.md).
Set `FIDDLER_API_KEY` to your key first.

```bash theme={null}
curl -H "Authorization: Bearer $FIDDLER_API_KEY" \
  "https://your-instance.fiddler.ai/v3/projects"
```

## 401 and 403 Errors

* **401 Unauthorized**: Fiddler didn't accept the key. The `Authorization` header is missing or doesn't start with `Bearer`, or the key is mistyped, expired, disabled, or revoked.
* **403 Forbidden**: Fiddler accepted the key, but it isn't allowed to make this call. A personal key can do only what your role allows. A service account key can do only what its capabilities or project roles allow.

For each 403 message and its fix, see [Troubleshooting](https://docs.fiddler.ai/reference/access-control/service-accounts.md#troubleshooting) on Service Accounts and API Keys.
