Source: https://ailoot.ai/docs/keys/
Canonical: https://ailoot.ai/docs/en/keys/
Language: en

[Overview](https://ailoot.ai/docs/en/) 

# API keys and base URL

[Markdown](https://ailoot.ai/docs/en/keys/index.md)

Where to get a key, which URL to configure in each SDK, and how to send the key.

## [](https://ailoot.ai/docs/keys/#key)API key

Create the key in the Dashboard at [ailoot.ai](https://ailoot.ai) after [signing up](https://ailoot.ai/register). It has the format `sk-…`. You can create several keys: one for your work computer, one for your server, and one for each application. This makes it easier to revoke one without affecting the others.

You can set a total spending limit, expiry, IP allowlists and blocklists, and spending limits for 5-hour, 1-day, and 7-day windows. If a restriction is triggered, you receive a clear error: `api_key_quota_exhausted` (total limit exhausted), `usage_limit_reached` (the key’s spending window is exhausted; wait for the window to reset or increase the limit), `api_key_expired` or `permission_denied` (for example, the request came from an IP that is not allowed).

Do not publish your key in code, repositories, or screenshots. Store it in an environment variable or secrets manager. If it leaks, delete it in the Dashboard and create a new one.

## [](https://ailoot.ai/docs/keys/#base-url)API base URL

The main rule: OpenAI-compatible clients use a URL with `/v1`; Anthropic and Gemini use one without it.

| Client | Base URL | Request destination |
| --- | --- | --- |
| OpenAI SDK and compatible clients | `https://api.ailoot.ai/v1` | `/v1/chat/completions`, `/v1/responses`, `/v1/embeddings` |
| Anthropic SDK, Claude Code | `https://api.ailoot.ai` | `/v1/messages` |
| Google GenAI SDK, Gemini CLI | `https://api.ailoot.ai` | `/v1beta/models/{model}:generateContent` |
| The client requires a full URL | `https://api.ailoot.ai/v1/chat/completions` | as specified |

Received 404 right after setup? The URL is almost always the cause: an extra or missing `/v1`, a double slash, or `/chat/completions` where the client already appends it.

## [](https://ailoot.ai/docs/keys/#auth)How to send the key

Ailoot accepts the key in any of these three headers; whichever your SDK sends will work:

| Header | Clients that use it |
| --- | --- |
| `Authorization: Bearer sk-…` | OpenAI SDK, most clients |
| `x-api-key: sk-…` | Anthropic SDK, Claude Code with ANTHROPIC\_API\_KEY |
| `x-goog-api-key: sk-…` | Google GenAI SDK, Gemini CLI |

On paths `/v1/…` a key in the URL (`?key=` or `?api_key=`) is not accepted: the request receives 400 with the code `invalid_request` and a message stating that the key was sent in the URL. This keeps the key out of logs and browser history. If you have already used the key in a URL, it is best to create a new one.

On Gemini paths `/v1beta/…` for compatibility with Google, the API accepts `?key=` with the lowest priority, after headers. `?api_key=` is also rejected with 400 on these paths. It is still more reliable to send the key in the header `x-goog-api-key`.

## [](https://ailoot.ai/docs/keys/#env)Environment variables

You can create one variable and use it in the settings of different applications:

```bash
# ~/.zshrc or ~/.bashrc
export AILOOT_API_KEY="sk-..."

# for applications that read the standard names
export OPENAI_BASE_URL="https://api.ailoot.ai/v1"
export OPENAI_API_KEY="$AILOOT_API_KEY"
export ANTHROPIC_BASE_URL="https://api.ailoot.ai"
export ANTHROPIC_AUTH_TOKEN="$AILOOT_API_KEY"
```

```powershell
setx AILOOT_API_KEY "sk-..."

# for applications that read the standard names
setx OPENAI_BASE_URL "https://api.ailoot.ai/v1"
setx OPENAI_API_KEY "sk-..."
setx ANTHROPIC_BASE_URL "https://api.ailoot.ai"
setx ANTHROPIC_AUTH_TOKEN "sk-..."
# restart the terminal so the variables take effect
```

## [](https://ailoot.ai/docs/keys/#check)Check your key

The least expensive way to check a key is to request the model list: it is free.

```bash
curl -s https://api.ailoot.ai/v1/models \
  -H "Authorization: Bearer $AILOOT_API_KEY"
```

Still have questions? Send your Request ID and a description — we'll help you troubleshoot.[Contact support](mailto:support@ailoot.ai)

## Ailoot · The company and its project portfolio





Ailoot combines established operating experience, a large client base, stable service and ongoing KPI control.





The company and its project portfolio: millions of customers; monthly sales in the billions.





Ailoot brings that operating experience to API access for AI features in customer products, agents, applications and automations.
