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

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

# Quick start — AI API key and first request

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

Get your first model response through Ailoot in a few minutes: a key, a URL, and one request.

Ailoot is a single API for AI models from OpenAI, Anthropic, Google, xAI, DeepSeek, Alibaba, Moonshot, Z.ai, MiniMax, NVIDIA, Meta, Poolside, and TypeSafe. One key and one dollar balance. The catalog contains 1256 model cards and 2692 documented methods. Alternative caller IDs or aliases are listed under the selected method when available.

Ailoot supports three API formats: OpenAI, Anthropic, and Gemini. This lets you use existing SDKs and almost any application that accepts a custom API URL, including Claude Code, Codex CLI, Cline, Cursor, Open WebUI, n8n, and dozens more.

| Method | When to use it |
| --- | --- |
| [HTTP request](https://ailoot.ai/docs/en/connect/curl/) | Any language, no dependencies; a quick way to check your key |
| [OpenAI SDK](https://ailoot.ai/docs/en/connect/openai-sdk/) | Python and Node.js; any catalog model in OpenAI format |
| [Anthropic SDK](https://ailoot.ai/docs/en/connect/anthropic-sdk/) | Claude and other models in Messages format |
| [Ready-made applications](https://ailoot.ai/integrations/en/) | 85 agents, editors, and chats: 77 with ready-to-use settings and another 8 under review |

Need a specific application? Open the [integration catalog](https://ailoot.ai/integrations/en/): each entry shows where to enter the URL and key, with a ready-to-copy configuration.

## Get an AI API key

[](https://ailoot.ai/docs/en/#key)Get a key

1. **Sign up**

   Create an account at [ailoot.ai/register](https://ailoot.ai/register). Then sign in through [ailoot.ai/login](https://ailoot.ai/login).
2. **Add funds to your balance**

   Open Pricing in the Dashboard: a one-time top-up from $18 or a subscription with a balance bonus. Learn more: [adding funds](https://ailoot.ai/docs/en/billing/topup/) and [subscriptions](https://ailoot.ai/docs/en/billing/subscriptions/).
3. **Create an API key**

   Open the keys section in the Dashboard and create a new key. It starts with `sk-`. Copy it from the Dashboard’s keys section and keep it safe like a password.

Save the key in an environment variable

```bash
export AILOOT_API_KEY="sk-..."
# check: this should return a list of models
curl -s https://api.ailoot.ai/v1/models -H "Authorization: Bearer $AILOOT_API_KEY" | head -c 300
```

## [](https://ailoot.ai/docs/en/#first-request)Send your first request

The API URL is `https://api.ailoot.ai`. For OpenAI-format SDKs, the base URL is `https://api.ailoot.ai/v1`; for Anthropic and Gemini, it is `https://api.ailoot.ai` with no suffix: those SDKs append the path themselves.

```bash
curl https://api.ailoot.ai/v1/chat/completions \
  -H "Authorization: Bearer $AILOOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5-5",
    "messages": [
      {"role": "user", "content": "Explain what an API is in two sentences."}
    ]
  }' 
```

```python
from openai import OpenAI
import os

client = OpenAI(max_retries=0, 
    base_url="https://api.ailoot.ai/v1",
    api_key=os.environ["AILOOT_API_KEY"],
)

resp = client.chat.completions.create(
    model="claude-sonnet-5-5",
    messages=[{"role": "user", "content": "Explain what an API is in two sentences."}],
)
print(resp.choices[0].message.content)
```

```js
import OpenAI from "openai";

const client = new OpenAI({ maxRetries: 0,
  baseURL: "https://api.ailoot.ai/v1",
  apiKey: process.env.AILOOT_API_KEY,
});

const resp = await client.chat.completions.create({
  model: "claude-sonnet-5-5",
  messages: [{ role: "user", content: "Explain what an API is in two sentences." }],
});
console.log(resp.choices[0].message.content);
```

```python
import anthropic
import os

client = anthropic.Anthropic(max_retries=0, 
    base_url="https://api.ailoot.ai",   # without /v1: the SDK adds /v1/messages itself
    api_key=os.environ["AILOOT_API_KEY"],
)

msg = client.messages.create(
    model="claude-sonnet-5-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Explain what an API is in two sentences."}],
)
print(msg.content[0].text)
```

The response uses the familiar format. The `usage` section shows tokens used for the question and response; these determine the charge.

200 OK

```json
{
  "id": "chatcmpl-8f2c…",
  "object": "chat.completion",
  "created": 1790812800,
  "model": "claude-sonnet-5-5",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "An API is an agreement on how one program asks another to do something…"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 21,
    "completion_tokens": 48,
    "total_tokens": 69
  }
}
```

## [](https://ailoot.ai/docs/en/#streaming)Streaming responses

With `"stream": true` the response uses Server-Sent Events, as in the original APIs, so SDKs and clients parse it without changes. In the OpenAI SDK, you can request the final `usage` in the last event.

Ailoot delivers billed text responses after calculating their cost. With `stream: true` the format is still streaming (SSE), but the text arrives as one block when the model finishes, rather than word by word. If a response takes longer than about 15 seconds, Chat Completions, Responses, and Messages streams first send `: ping` control lines, roughly every 10 seconds, followed by a `: ailoot-charged-usd …` line containing the amount charged and then the data itself. SDKs skip these control lines.

```python
stream = client.chat.completions.create(
    model="gpt-6.1-sol",
    messages=[{"role": "user", "content": "Write a haiku about rain"}],
    stream=True,
    stream_options={"include_usage": True},
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)
```

```js
const stream = await client.chat.completions.create({
  model: "gpt-6.1-sol",
  messages: [{ role: "user", content: "Write a haiku about rain" }],
  stream: true,
  stream_options: { include_usage: true },
});
for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}
```

```bash
curl -N https://api.ailoot.ai/v1/chat/completions \
  -H "Authorization: Bearer $AILOOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-6.1-sol", "stream": true,
       "messages": [{"role": "user", "content": "Write a haiku about rain"}]}' 
```

## [](https://ailoot.ai/docs/en/#models)Choose a model

The field `model` — the exact identifier from the [model catalog](https://ailoot.ai/models/en/) or the response to `GET /v1/models`. Many models have short aliases, such as `claude-sonnet-latest` or `qwen`. The catalog shows which model an alias currently points to. Use an exact ID for reproducible results.

| Task | Where to start |
| --- | --- |
| Code and agents | `claude-sonnet-5-5`, `gpt-6.1-sol`, `claude-opus-5-5` |
| Fast and inexpensive | `gemini-3.8-flash`, `deepseek-v4.1-flash`, `qwen3.8-flash` |
| Long context up to 1M tokens | `claude-sonnet-5-5`, `deepseek-v4-pro`, `qwen3.8-max` |
| Images | `gpt-image-2.5`, `gemini-3.1-flash-image`, `grok-imagine-image-2.0` |

Not every model is available in every format. For example, Gemini models work through Anthropic Messages and the native Gemini format; the only Gemini model available through OpenAI Chat is `gemini-3.6-flash`. You can see which formats a model supports in the [catalog](https://ailoot.ai/models/en/).

## [](https://ailoot.ai/docs/en/#next)What's next

[**How it works** Request flow, reserve and charge, errors](https://ailoot.ai/docs/en/how-it-works/)

[**Compatibility** Supported formats and clients](https://ailoot.ai/docs/en/compatibility/)

[**Integrations** 77 apps with ready-to-use configurations](https://ailoot.ai/integrations/en/)

[**Errors and limits** Response codes and how to handle them](https://ailoot.ai/docs/en/errors/)

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

## AI API key and first request

### Where do I create an AI API key?

Open the keys section in the Dashboard and create a new key. It starts with sk-. Copy it from the Dashboard’s keys section and keep it safe like a password.

Connect Ailoot to Claude Code, OpenCode, Hermes or your own app.

## The company and its project portfolio

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

## Buy tokens at a discount.

Subscription discounts for regular use. Promo codes offer up to 50% off token purchases.

Subscription

Choose a discounted plan for your regular requests.

Promo code: up to 50% off

Enter your code at checkout. The price updates to reflect the current promotion.

Spending in your history

The model, tokens and amount are recorded for each request.

[Choose a subscription](https://ailoot.ai/docs/en/billing/subscriptions/) · [View model prices](https://ailoot.ai/models/en/)

## Connect the API to a product you sell.

Use Ailoot in SaaS, apps and bots under its official service offer and licence agreement. Request a reseller licence for resale.

Commercial application

Add text, image, video and audio generation to paid features in your service.

Reseller licence

Send a description of your project and how you provide access. Request written terms for use and resale.

Documents on the website

The service offer, licence agreement and data processing policy are available before you connect.

[Request a reseller licence](mailto:support@ailoot.ai) · [Service offer and licence agreement](https://ailoot.ai/legal/offer?lang=en)

## Questions

How do I send my first API request?

Create an Ailoot API key. Set https://api.ailoot.ai/v1 for OpenAI SDK, or https://api.ailoot.ai for Anthropic and Gemini SDK. GET /v1/models is free and lists models available to your key; then use the example for the selected model and API method.

Which API key should I use?

Use an Ailoot API key from your account in the authentication field of the selected client format. Send GET /v1/models with that same key to check its model access for free; a key from another service does not provide access to Ailoot.

What should I check if the first request fails?

Check the API address, Ailoot API key, exact model ID and API method against the model card and request example. Read the returned error; if you need help, send support@ailoot.ai the error and request ID without your API key.

What does a subscription give me?

A discount on token purchases for regular use. Choose a plan for your request volume; subscription terms and pricing are shown at checkout.

How do I apply a promo code for up to 50% off?

Enter the promo code when buying tokens. The total updates according to the promotion terms; you can see the discount before paying.

## 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.
