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

# Authentication

All requests to the Sunra API are authenticated with an API key. You can create and manage your keys in your [dashboard](https://sunra.ai/dashboard/api-tokens).

## Setting your API key

Set your API key as an environment variable:

```bash theme={null}
export SUNRA_KEY="your-api-key-here"
```

The official [client libraries](/client-libraries) read `SUNRA_KEY` from the environment automatically, so no further configuration is needed. Each client also accepts credentials explicitly if you prefer to pass the key in code.

## Raw HTTP requests

If you call the API directly over HTTP, pass the key in the `Authorization` header. The two product APIs use different schemes:

| API                      | Base URL           | Header                             |
| ------------------------ | ------------------ | ---------------------------------- |
| Multimodal (predictions) | `api.sunra.ai`     | `Authorization: Key $SUNRA_KEY`    |
| LLM (completions)        | `api-llm.sunra.ai` | `Authorization: Bearer $SUNRA_KEY` |

The same API key works for both APIs.

## Keeping your key secure

Your API key grants access to your account balance — treat it like a password. Never embed it in client-side code (browsers or mobile apps); route requests through your own backend instead. See [Server-side integration](/multimodal/server-side-integration) for the recommended setup.
