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

# Authentication

> Authenticate Fetch Hive API requests with a workspace API key from the dashboard

Use a workspace API key to authenticate requests to the public Fetch Hive API.

## Authentication header

Send your API key in the `Authorization` header on every request:

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

Fetch Hive uses the same bearer header for public invoke endpoints and public resource endpoints.

## How do I create an API key? <a href="#create-api-key" id="create-api-key" />

Open **Settings**, then click **API Keys**.

If your workspace does not have a default key yet, click **Create Default Key**.

If you want another key for a specific service or environment, click **Add API Key**.

Choose the environment you want to use:

* **Production**
* **Staging**
* **Development**

Copy the full key when Fetch Hive shows **Your New API Key**. After that dialog closes, Fetch Hive usually only shows the key prefix.

## Example request

```bash theme={null}
curl 'https://api.fetchhive.com/v1/prompt/invoke' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  --data-raw '{
    "deployment": "YOUR_DEPLOYMENT_NAME",
    "variant": "YOUR_VARIANT_NAME",
    "inputs": {
      "text": "Fetch Hive helps teams ship AI products faster."
    },
    "streaming": true
  }' \
  --compressed
```

## What happens when authentication fails?

If the API key is missing, invalid, or revoked, Fetch Hive returns an error response.

```json theme={null}
{
  "error": "Invalid access."
}
```

See [Errors and rate limits](./errors-and-rate-limits) for common status codes and error shapes. For API key management in the dashboard, see [API keys](../workspace/api-keys).
