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

# Authentication

> Authenticate requests to the VLM Run Gateway API

<Card title="Free during alpha" icon="gift" href="/gateway/rate-limits">
  The VLM Run Gateway is currently **free to use** and **rate-limited** per IP or
  API key (60 requests/min, 1000 requests/hr). See
  [Rate Limits](/gateway/rate-limits) for tier details and how to request a
  higher quota.
</Card>

The VLM Run Gateway accepts a standard `Authorization: Bearer <token>` header on every
endpoint. All Gateway endpoints allow anonymous access today, so authentication
is optional. Sign in with an API key when you want usage attributed to your
account instead of a shared IP bucket.

## Tiers

| Tier          | How to authenticate                                               | Rate limit       | Bucket key   |
| ------------- | ----------------------------------------------------------------- | ---------------- | ------------ |
| Anonymous     | Omit the header, or send `Bearer ""` / `Bearer vlmrun`            | 60/min · 1000/hr | Client IP    |
| Authenticated | `Bearer <VLMRUN_API_KEY>` from [app.vlm.run](https://app.vlm.run) | 60/min · 1000/hr | Your account |

Both tiers share the same numeric limits during the alpha. The difference is
attribution: anonymous requests are capped per IP (so they can be shared with
other users behind the same NAT or proxy), while authenticated requests are
capped per account.

<Note>
  Every endpoint documented under [API Reference](/gateway/api-reference/post-chat-completions)
  accepts anonymous traffic today: chat completions, models, embeddings,
  audio transcriptions, and health. This may tighten as the Gateway moves
  toward general availability, so authenticate with an API key if you're
  building something you plan to run in production.
</Note>

## Get an API key

1. Sign up at [app.vlm.run](https://app.vlm.run).
2. Copy your API key from the dashboard.
3. Set it as an environment variable:

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
export VLMRUN_API_KEY="your-api-key"
```

## Examples

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  from openai import OpenAI

  client = OpenAI(
      base_url="https://gateway.vlm.run/v1/openai",
      api_key="<VLMRUN_API_KEY>",  # omit, or use "vlmrun", for anonymous access
  )

  models = client.models.list()
  for model in models.data:
      print(model.id)
  ```

  ```bash cURL theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  curl https://gateway.vlm.run/v1/openai/models \
    -H "Authorization: Bearer $VLMRUN_API_KEY"
  ```
</CodeGroup>

An invalid (non-empty, unrecognized) bearer token returns `403` rather than
falling back to anonymous access. See
[Error Codes](/gateway/error-codes) for the response body.

## Related

<CardGroup cols={2}>
  <Card title="Rate Limits" icon="bolt-lightning" href="/gateway/rate-limits">
    Per-tier quotas and how to request a higher limit.
  </Card>

  <Card title="Error Codes" icon="circle-exclamation" href="/gateway/error-codes">
    403 (invalid API key) and 429 (rate limit) response bodies.
  </Card>
</CardGroup>
