---
title: Embed API Authentication
description: Authenticate PostNitro Embed API requests with the embed-api-key header. Pass your PostNitro API key on every request and handle common auth errors.
canonical: https://postnitro.ai/docs/embed/api/authentication
---

# Authentication

Every Embed API request must include your PostNitro API key in the
`embed-api-key` header:

```
embed-api-key: <YOUR_EMBED_API_KEY>
```

An `authorization` header is also accepted as an alternative.

## Getting an API key

See [Obtaining an API Key](https://postnitro.ai/docs/embed/obtaining-an-api-key) for step-by-step
instructions on generating a key from your PostNitro workspace.

## Example

```bash
curl --location 'https://embed-api.postnitro.ai/brand' \
  --header 'embed-api-key: pn-your-api-key'
```

## Error responses

| Condition | Status | Body |
| --- | --- | --- |
| No key supplied | `401` | `{ "status": false, "message": "Unauthorized" }` |
| Key not found / not an API key | `401` | `{ "status": false, "message": "Unable to find embed details, please check your Embed API key..." }` |
| No workspace attached to key | `401` | `{ "status": false, "message": "Unable to find workspace details, please attach a workspace to this API key." }` |
| No active/paid plan | `402` | `{ "status": false, "message": "Embed API requires a paid main plan with the API Credits add-on, or an active Embed API subscription." }` |
