Quick start — AI API key and first request
MarkdownGet your first model response through Ailoot in a few minutes: a key, a URL, and one request.
Full guide
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 | Any language, no dependencies; a quick way to check your key |
| OpenAI SDK | Python and Node.js; any catalog model in OpenAI format |
| Anthropic SDK | Claude and other models in Messages format |
| Ready-made applications | 85 agents, editors, and chats: 77 with ready-to-use settings and another 8 under review |
Get an AI API key
- Sign up
Create an account at ailoot.ai/register. Then sign in through ailoot.ai/login.
- 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 and subscriptions.
- 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.
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 300Send 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.
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."}
]
}' 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)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);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.
{
"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
}
}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.
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)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 ?? "");
}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"}]}' Choose a model
The field model — the exact identifier from the model catalog 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 |
What's next
More details
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 · View model prices
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 · Service offer and licence agreement
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.