API Quickstart
Make your first AVELIN API call in under five minutes. AVELIN is an AI Laboratory that builds Cross-Model MoE (Mixture-of-Experts) models — trained AI systems that fuse knowledge from multiple model architectures into single unified models. We don't just route; we build and fuse. The API serves these models through a single governed endpoint.
Enterprise licensing available: Deploy AVELIN models on your own GPUs with full data sovereignty. Request a POC for enterprise licensing options.
The API is a drop-in replacement: change only 2 lines of code (base URL and API key) to migrate from OpenAI or Anthropic.
1. Get an API key
Create a key from your AVELIN account. It will look like:
sk-ave...xxxx
Keep it secret. Set it as an environment variable so it never lands in code:
export AVELIN_API_KEY="sk-ave...xxxx"
2. Choose your track
Both tracks are backed by the same models — pick whichever matches your stack.
OpenAI track
Base URL: https://api.avelin.ai/v1
Endpoint: POST /v1/chat/completions
cURL
curl https://api.avelin.ai/v1/chat/completions \ -H "Authorization: Bearer sk-avelin-YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "avelin-pro", "messages": [ { "role": "user", "content": "Give me three productivity tips." } ] }'
Python (OpenAI SDK)
from openai import OpenAI client = OpenAI( base_url="https://api.avelin.ai/v1", api_key="sk-ave...xxxx", # or os.environ["AVELIN_API_KEY"] ) resp = client.chat.completions.create( model="avelin-pro", messages=[{"role": "user", "content": "Give me three productivity tips."}], ) print(resp.choices[0].message.content)
JavaScript / TypeScript (OpenAI SDK)
import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://api.avelin.ai/v1", apiKey: process.env.AVELIN_API_KEY, }); const resp = await client.chat.completions.create({ model: "avelin-pro", messages: [{ role: "user", content: "Give me three productivity tips." }], }); console.log(resp.choices[0].message.content);
Response shape (OpenAI)
{ "id": "chatcmpl-...", "object": "chat.completion", "model": "avelin-pro", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "1. Time-block your calendar...", "reasoning_content": "The user wants practical tips..." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 12, "completion_tokens": 180, "total_tokens": 192 } }
Streaming (OpenAI)
stream = client.chat.completions.create( model="avelin-pro", messages=[{"role": "user", "content": "Write a haiku about sovereignty."}], stream=True, ) for chunk in stream: delta = chunk.choices[0].delta if delta.content: print(delta.content, end="", flush=True)
Anthropic track
Base URL: https://api.avelin.ai
Endpoint: POST /v1/messages
Header: anthropic-version: 2023-06-01
cURL
curl https://api.avelin.ai/v1/messages \ -H "Authorization: Bearer sk-avelin-YOUR_KEY" \ -H "Content-Type: application/json" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "avelin-pro", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Give me three productivity tips." } ] }'
Python (Anthropic SDK)
from anthropic import Anthropic client = Anthropic( base_url="https://api.avelin.ai", api_key="sk-ave...xxxx", # or os.environ["AVELIN_API_KEY"] ) msg = client.messages.create( model="avelin-pro", max_tokens=1024, messages=[{"role": "user", "content": "Give me three productivity tips."}], ) print(msg.content[0].text)
JavaScript / TypeScript (Anthropic SDK)
import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic({ baseURL: "https://api.avelin.ai", apiKey: process.env.AVELIN_API_KEY, }); const msg = await client.messages.create({ model: "avelin-pro", max_tokens: 1024, messages: [{ role: "user", content: "Give me three productivity tips." }], }); console.log(msg.content[0].text);
Response shape (Anthropic)
{ "id": "resp_...", "type": "message", "role": "assistant", "model": "avelin-pro", "content": [ { "type": "text", "text": "1. Time-block your calendar..." } ], "stop_reason": "end_turn", "usage": { "input_tokens": 12, "output_tokens": 180, "total_tokens": 192 } }
System prompts (Anthropic)
The Anthropic surface uses a top-level system parameter instead of a system
message in the messages array:
msg = client.messages.create( model="avelin-coding-fast", max_tokens=1024, system="You are a senior software engineer.", messages=[{"role": "user", "content": "Write a debounce decorator."}], )
Thinking control (Anthropic)
Extended thinking is enabled by default on reasoning-capable models. To disable:
msg = client.messages.create( model="avelin-pro", max_tokens=1024, thinking={"type": "disabled"}, messages=[{"role": "user", "content": "Summarize this document."}], )
When thinking is enabled, the response includes a separate thinking content
block before the final text block.
Streaming (Anthropic)
with client.messages.stream( model="avelin-pro", max_tokens=1024, messages=[{"role": "user", "content": "Write a haiku about sovereignty."}], ) as stream: for text in stream.text_stream: print(text, end="", flush=True)
3. Pick the right model
All models are built with AVELIN's Cross-Model MoE technology in our AI Lab.
Cost savings vs. direct providers:
- Intelligence family: up to 85% cheaper
- Coding family: up to 86% cheaper
- Agentic family: up to 87% cheaper
Full descriptions: Model Catalog.
Key differences between tracks
Next steps
- Full API Reference — every endpoint, parameter, and response shape
- SDKs & Tools — CLI and editor integration configuration
- Model Catalog — capabilities and selection guidance