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

# Authentication

> API keys, headers, and base URLs for Relay.

All public Relay routes use the API key from [console.pipellm.ai](https://console.pipellm.ai). Never send provider keys; Relay authenticates your account and routes upstream.

## Default path

For OpenAI-compatible chat, use:

| | |
| - | - |
| Base URL | `https://api.pipellm.ai/v1` |
| Header | `Authorization: Bearer $PIPELLM_API_KEY` |

```bash theme={"dark"}
curl https://api.pipellm.ai/v1/chat/completions \
  -H "Authorization: Bearer $PIPELLM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5","messages":[{"role":"user","content":"Hello"}]}'
```

Video uses the same Bearer header on `https://api.pipellm.ai` (no `/v1` prefix):

```bash theme={"dark"}
curl https://api.pipellm.ai/v2/videos \
  -H "Authorization: Bearer $PIPELLM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"seedance-2-0-mini","prompt":"A cat walking in the rain"}'
```

## Protocol headers

Native routes keep the header the corresponding SDK expects:

| Request format | Base URL | Header |
| - | - | - |
| OpenAI Chat Completions / Responses | `https://api.pipellm.ai/v1` | `Authorization: Bearer $PIPELLM_API_KEY` |
| Anthropic Messages | `https://api.pipellm.ai` | `x-api-key: $PIPELLM_API_KEY` |
| Gemini Generate Content | `https://api.pipellm.ai` | `x-goog-api-key: $PIPELLM_API_KEY` |
| Video (`/v2/videos`) | `https://api.pipellm.ai` | `Authorization: Bearer $PIPELLM_API_KEY` |

Anthropic requests also send `anthropic-version: 2023-06-01`.

## Converter routes

Use a converter base URL only when you want to keep one SDK format and call a model from another protocol family. See [Routing & Protocols](/guides/routing-protocols).

| Format | Base URL |
| - | - |
| OpenAI converter | `https://api.pipellm.ai/openai/v1` |
| OpenAI Responses converter | `https://api.pipellm.ai/responses/v1` |
| Anthropic converter | `https://api.pipellm.ai/anthropic` |
| Gemini converter | `https://api.pipellm.ai/gemini` |

## Failed authentication

Missing or invalid keys return `401`:

```json theme={"dark"}
{
  "error": {
    "type": "authentication_error",
    "code": "401",
    "message": "Incorrect API key provided. Please visit https://console.pipellm.ai/account/api-keys to find your API key."
  }
}
```

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


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