# Base URL and authentication

> Vikey base URLs for the OpenAI format, the Anthropic format and Token Plan, how to send the API key, and optional headers.

## Base URL

Pick the base URL that matches the format your tool or SDK uses.

| For | Base URL | Endpoints used |
| --- | --- | --- |
| OpenAI-format SDKs and tools | `https://api.vikey.ai/v1` | `/chat/completions`, `/responses`, `/models` |
| Anthropic-format SDKs and tools (including Claude Code) | `https://api.vikey.ai` | `/v1/messages` |
| Token Plan | `https://api-plan.vikey.ai/v1` | Same as the OpenAI format, model `vikey/plan` |

**Mind the /v1**

The OpenAI SDK needs the base URL **with** `/v1`. The Anthropic SDK and Claude Code need it **without** `/v1`, because they add `/v1/messages` themselves. Getting this wrong is the most common cause of 404 errors.

## Sending the API key

Send the key in either header. Both are accepted on every endpoint.

```http
Authorization: Bearer YOUR_API_KEY
```

```http
x-api-key: YOUR_API_KEY
```

The OpenAI SDK uses `Authorization: Bearer` and the Anthropic SDK uses `x-api-key`. You do not need to set these headers yourself when you use an SDK.

## Optional headers

| Header | Purpose |
| --- | --- |
| `X-End-User` | An identifier for your own end user (not a Vikey user), such as a customer id in your app. Stored with the usage data. Use 1 to 128 characters: letters, digits, underscore, period, colon or hyphen. Invalid values are ignored, they never fail the request. Do not put emails or phone numbers here. |

## Checking the balance from the API

The balance is shown in the dashboard. `GET /v1/balance` only accepts a dashboard login token, not an API key, so in an app rely on the dashboard or handle the `402` error (see [Errors](/en/api/errors/)).

Source: https://docs.vikey.ai/en/base-url/
