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

# Authentication

> Set up API authentication for Forii

Every Forii request requires a Bearer token in the `Authorization` header.

## Quick setup

```bash theme={null}
export FORII_API_KEY="forii_sk_..."
```

```python theme={null}
from openai import OpenAI
import os

client = OpenAI(
    base_url="https://api.forii.in/inference/v1",
    api_key=os.environ["FORII_API_KEY"],
)
```

```javascript theme={null}
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.FORII_API_KEY,
  baseURL: "https://api.forii.in/inference/v1",
});
```

```bash theme={null}
curl https://api.forii.in/inference/v1/chat/completions \
  -H "Authorization: Bearer $FORII_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "forii/deepseek-v3", "messages": [...]}'
```

For full details on key creation, scopes, and management, see [Authentication](/docs/concepts/authentication).
