Getting started
Quick start
Make your first request in under a minute.
Base URL
All model endpoints are served from:
text
https://rutoken.ai
The API is compatible with the official OpenAI, Anthropic Claude and Google Gemini SDKs — point the SDK at this base URL and use your RuToken key.
Authentication
Create a key in the console under API Keys, then send it with every request:
| Format | Header |
|---|---|
| OpenAI | Authorization: Bearer sk-xxxx |
| Claude | x-api-key: sk-xxxx |
| Gemini | x-goog-api-key: sk-xxxx or ?key=sk-xxxx |
Keep your key secret. Never ship it in front-end code or commit it to a public repository.
First request
cURL
curl https://rutoken.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "Hello!"}]
}'
Python
from openai import OpenAI
client = OpenAI(base_url="https://rutoken.ai/v1", api_key="sk-xxxx")
resp = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)
Node.js
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://rutoken.ai/v1", apiKey: "sk-xxxx" });
const resp = await client.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);
Choosing a model
Browse available models and their prices in the Model Square. Use the exact model ID shown there in the model field.