OpenAI-compatible API for multi-provider AI inference
Get started with Aotearoa Inference API in minutes. First, create an API key from your dashboard.
curl https://elasterrific.com/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"messages": [
{"role": "user", "content": "What is the capital of France?"}
]
}'Authenticate your API requests using Bearer token authentication in the Authorization header.
Authorization: Bearer sk-aotearoa-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxYour API keys carry many privileges, so keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, etc.
/api/v1/chat/completionsCreates a chat completion response. This endpoint is compatible with the OpenAI Chat Completions API format.
A list of messages comprising the conversation so far. Each message must have a role (system, user, or assistant) and content.
The model/provider to use. Use "auto" (default) to automatically rotate between providers, or specify a provider name like "elastix-deepseek", "elastix-qwen", etc.
Not supported yet. Must be false or omitted.
{
"id": "chatcmpl-abc123...",
"object": "chat.completion",
"created": 1738134000,
"model": "DeepSeek-V3.2",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The capital of France is Paris."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 15,
"completion_tokens": 8,
"total_tokens": 23
},
"aotearoa": {
"provider": "elastix-deepseek",
"cost": {
"input": 0.0000006,
"output": 0.0000028,
"total": 0.0000034
},
"balance": 4.9999966,
"duration_ms": 1234
}
}The aotearoa object contains additional metadata specific to Aotearoa Inference, including the provider used, cost breakdown, remaining balance, and response duration.
from openai import OpenAI
# Use Aotearoa Inference as a drop-in replacement for OpenAI
client = OpenAI(
api_key="sk-aotearoa-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
base_url="https://elasterrific.com/api/v1"
)
response = client.chat.completions.create(
model="auto", # or specify a provider like "elastix-deepseek", "elastix-qwen"
messages=[
{"role": "user", "content": "Explain quantum computing in simple terms"}
]
)
print(response.choices[0].message.content)
# Access Aotearoa-specific metadata
aotearoa_info = response.model_dump()["aotearoa"]
print(f"Provider: {aotearoa_info['provider']}")
print(f"Cost: ${aotearoa_info['cost']['total']:.6f}")
print(f"Balance: ${aotearoa_info['balance']:.4f}")import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'sk-aotearoa-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
baseURL: 'https://elasterrific.com/api/v1'
});
async function chat() {
const response = await client.chat.completions.create({
model: 'auto',
messages: [
{ role: 'user', content: 'What is machine learning?' }
]
});
console.log(response.choices[0].message.content);
// Access Aotearoa-specific metadata
console.log('Provider:', response.aotearoa.provider);
console.log('Cost: $' + response.aotearoa.cost.total.toFixed(6));
console.log('Balance: $' + response.aotearoa.balance.toFixed(4));
}
chat();curl https://elasterrific.com/api/v1/chat/completions \
-H "Authorization: Bearer sk-aotearoa-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a haiku about coding"
}
]
}'Specify one of these provider names in the model parameter, or use "auto" to automatically rotate between providers for load distribution.
| Provider Name | Model | Auto-Select |
|---|---|---|
| elastix-gpt-oss-120b | gpt-oss-120b | Yes |
| elastix-deepseek | DeepSeek-V3.2 | Yes |
| elastix-kimi | Kimi-K2-Thinking | Yes |
| elastix-qwen | Qwen3-Coder-480B-A35B-Instruct | Yes |
| auto | Rotates automatically | Default |
missing_api_key / invalid_api_keyMissing or invalid Authorization header. Ensure you're using Authorization: Bearer sk-aotearoa-xxx.
insufficient_balanceYour account balance is too low. Add more credits from your dashboard.
invalid_messagesThe messages array is empty or invalid. Ensure you're sending at least one message.
streaming_not_supportedStreaming is not yet supported. Set stream: false or omit the parameter.
internal_errorAn unexpected error occurred. Contact support if the issue persists.
All API calls are billed based on token usage. Costs are deducted from your account balance in real-time. View detailed pricing on the pricing page.
Balance Tracking: Every API response includes your remaining balance in the aotearoa.balance field, so you can monitor your usage in real-time.
Need help? We're here to assist you.