OpenAI-compatible
The path above: any OpenAI-shaped client — the OpenAI SDK, LangChain, LlamaIndex, LiteLLM, Vercel AI SDK — pointed at /api/v1, with model IDs in provider/model-name form.
from openai import OpenAI
client = OpenAI(
base_url = "https://api.airouter.kz/api/v1",
api_key = "air_live_..."
)
client.chat.completions.create(
model = "anthropic/claude-opus-4-7",
messages = [{"role": "user", "content": "hi"}],
)
Anthropic native
Already on the official Anthropic SDK? Point it at /anthropic and leave the code alone: /v1/messages and /v1/messages/count_tokens, Anthropic model names, anthropic-version and anthropic-beta passed through, streaming and errors in Anthropic's own format.
from anthropic import Anthropic
client = Anthropic(
base_url = "https://api.airouter.kz/anthropic",
api_key = "air_live_..."
)
client.messages.create(
model = "claude-opus-4-7",
max_tokens = 1024,
messages = [{"role": "user", "content": "hi"}],
)