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

# KiosAPI Authentication — API Key and Header Formats

> Pass your KiosAPI API key in the correct HTTP header for OpenAI-compatible, Claude native, and Gemini native endpoints — with curl examples.

Every request to KiosAPI requires an API key passed in the HTTP headers. The header format you use depends on which endpoint you're calling — OpenAI-compatible endpoints, Claude native, and Gemini native each follow their own convention.

## API Key

Your KiosAPI API key follows this format:

```text theme={null}
sk-kilo-xxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

Treat your key as a secret. Never expose it in client-side code, commit it to version control, or write it to logs. Load it at runtime using environment variables or a secrets manager.

## OpenAI Format (Bearer Header)

Use this header when calling the OpenAI-compatible endpoints (`/v1/chat/completions` or `/v1/responses`):

```bash theme={null}
curl https://kiosapi.com/v1/chat/completions \
  -H "Authorization: Bearer sk-kilo-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'
```

| Header          | Value                         |
| --------------- | ----------------------------- |
| `Authorization` | `Bearer sk-kilo-xxxxxxxxxxxx` |
| `Content-Type`  | `application/json`            |

<Tip>
  This is the most common format. OpenAI SDK libraries send this header automatically when you set `api_key` on the client — you don't need to add it manually.
</Tip>

## Claude Native Format (x-api-key + anthropic-version)

Use these headers when calling the Claude native endpoint (`/v1/messages`):

```bash theme={null}
curl https://kiosapi.com/v1/messages \
  -H "x-api-key: sk-kilo-xxxxxxxxxxxx" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-20250514",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'
```

| Header              | Value                  |
| ------------------- | ---------------------- |
| `x-api-key`         | `sk-kilo-xxxxxxxxxxxx` |
| `anthropic-version` | `2023-06-01`           |
| `Content-Type`      | `application/json`     |

<Warning>
  The `anthropic-version` header is **mandatory** for the Claude native endpoint. Omitting it returns a `400 Bad Request` error.
</Warning>

## Gemini Native Format (x-goog-api-key)

Use this header when calling the Gemini native endpoint (`/v1beta/models/{model}:generateContent`):

```bash theme={null}
curl "https://kiosapi.com/v1beta/models/gemini-2.5-flash:generateContent" \
  -H "x-goog-api-key: sk-kilo-xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {"parts": [{"text": "Hello!"}]}
    ]
  }'
```

| Header           | Value                  |
| ---------------- | ---------------------- |
| `x-goog-api-key` | `sk-kilo-xxxxxxxxxxxx` |
| `Content-Type`   | `application/json`     |

## Getting Your API Key

<Steps>
  <Step title="Log into kiosapi.com">
    Go to [kiosapi.com](https://kiosapi.com) and sign in to your account.
  </Step>

  <Step title="Navigate to Dashboard > Token Management">
    Open the **Dashboard** and select **Token Management** from the menu.
  </Step>

  <Step title="Create or copy your token">
    Create a new token or copy an existing one to use in your requests.
  </Step>
</Steps>

<Tip>
  Your API key carries full access to your KiosAPI account. Never share it publicly, commit it to version control, or embed it in client-side applications. Use environment variables or a secrets manager to load it at runtime.
</Tip>

<Warning>
  KiosAPI keys are **not** interchangeable with keys from OpenAI, Anthropic, or Google. Always use a KiosAPI key (`sk-kilo-...`) with `kiosapi.com`, and never send it to `api.openai.com`, `api.anthropic.com`, or `googleapis.com` — it will be rejected. Likewise, third-party provider keys will not work with `kiosapi.com`. Mixing up base URLs and keys is the most common cause of `401 Unauthorized` errors.
</Warning>
