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

# Authentication

> How to get and use your Kyma API key.

## Get your API key

<Steps>
  <Step title="Register">
    Go to [kymaapi.com](https://kymaapi.com) and create an account with email + password, or sign in with Google.
  </Step>

  <Step title="Copy your key">
    Your API key starts with `ky-` and is shown after registration. You can also find it in the [Dashboard](https://kymaapi.com/dashboard).
  </Step>

  <Step title="Use it">
    Pass your key as a Bearer token in the `Authorization` header.
  </Step>
</Steps>

## Using your API key

Include your key in every API request:

```bash theme={null}
curl https://kymaapi.com/v1/chat/completions \
  -H "Authorization: Bearer ky-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"model": "llama-3.3-70b", "messages": [{"role": "user", "content": "Hello"}]}'
```

With the OpenAI SDK:

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

client = OpenAI(
    base_url="https://kymaapi.com/v1",
    api_key="ky-your-api-key"  # or set OPENAI_API_KEY env var
)
```

## Environment variables

<Tip>
  Never hardcode your API key. Use environment variables instead.
</Tip>

```bash theme={null}
export OPENAI_API_KEY="ky-your-api-key"
export OPENAI_BASE_URL="https://kymaapi.com/v1"
```

Then in your code:

```python theme={null}
client = OpenAI()  # automatically reads env vars
```

## Managing keys

* **Create keys**: [Dashboard](https://kymaapi.com/dashboard) → Create Key
* **Multiple keys**: Create separate keys for dev/staging/production
* **Delete keys**: Remove compromised keys instantly from Dashboard
* **View usage**: Track requests per key in Dashboard
