OpenAI-compatible chat completion API
The Aotearoa Inference API provides an OpenAI-compatible endpoint for chat completions. This allows you to use existing OpenAI client libraries and tools with Aotearoa Inference.
Authentication Required: All API requests require a valid API key.
Create an API key from your dashboard after signing up.
Authenticate requests using Bearer token authentication in the Authorization header:
Authorization: Bearer sk-aotearoa-xxxxxxxxxxxxxxxxxxxxxYou can create up to 10 API keys per account. Keys are in the format: sk-aotearoa-{32_hex_chars}
POST https://www.aotearoainference.com/api/v1/chat/completionsCompatible with OpenAI's /v1/chat/completions endpoint.
Authorization: Bearer sk-aotearoa-xxxxxxxxxxxxxxxxxxxxx Content-Type: application/json
{
"model": "auto", // Optional, use "auto" for automatic selection
"provider": "elastix-deepseek", // Optional, specific provider selection
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
]
}messages (required) - Array of message objects with "role" and "content"model (optional) - Use "auto" for automatic selection or specific model nameprovider (optional) - Select specific provider: "elastix-deepseek", "elastix-qwen", "elastix-kimi", "elastix-gpt-oss-120b", "elastix-gemini", "elastix-llama", "elastix-mistral", or "elastix-claude"stream (not supported) - Streaming is not currently supported| Provider Name | Display Name | Model |
|---|---|---|
elastix-deepseek | Aotearoa Inference | DeepSeek-V3.2 |
elastix-qwen | Aotearoa Inference | Qwen3-Coder-480B-A35B-Instruct |
elastix-kimi | Aotearoa Inference | Kimi-K2-Thinking |
elastix-gpt-oss-120b | Aotearoa Inference | gpt-oss-120b |
elastix-gemini | Aotearoa Inference | Gemini 3 Flash Preview |
elastix-llama | Aotearoa Inference | Llama 3.3 70B Instruct |
elastix-mistral | Aotearoa Inference | Mistral Large 2411 |
elastix-claude | Aotearoa Inference | Claude Sonnet 4.5 |
If no provider is specified, requests use auto-rotation between active providers.
{
"id": "chatcmpl-1234567890",
"object": "chat.completion",
"created": 1234567890,
"model": "anthropic",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I'm doing well, thank you for asking."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
}
}curl https://www.aotearoainference.com/api/v1/chat/completions \
-H "Authorization: Bearer sk-aotearoa-xxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"messages": [
{
"role": "user",
"content": "What is the meaning of life?"
}
]
}'curl https://www.aotearoainference.com/api/v1/chat/completions \
-H "Authorization: Bearer sk-aotearoa-xxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"provider": "elastix-deepseek",
"messages": [
{
"role": "user",
"content": "Explain quantum computing"
}
]
}'from openai import OpenAI
client = OpenAI(
base_url="https://www.aotearoainference.com/api/v1",
api_key="sk-aotearoa-xxxxxxxxxxxxxxxxxxxxx" # Your API key
)
response = client.chat.completions.create(
model="auto",
messages=[
{"role": "user", "content": "What is the meaning of life?"}
]
)
print(response.choices[0].message.content)from openai import OpenAI
client = OpenAI(
base_url="https://www.aotearoainference.com/api/v1",
api_key="sk-aotearoa-xxxxxxxxxxxxxxxxxxxxx" # Your API key
)
# Select a specific provider using extra_body
response = client.chat.completions.create(
model="auto",
messages=[
{"role": "user", "content": "Explain quantum computing"}
],
extra_body={"provider": "elastix-deepseek"}
)
print(response.choices[0].message.content)import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://www.aotearoainference.com/api/v1',
apiKey: 'sk-aotearoa-xxxxxxxxxxxxxxxxxxxxx', // Your API key
});
const response = await client.chat.completions.create({
model: 'auto',
messages: [
{ role: 'user', content: 'What is the meaning of life?' }
],
});
console.log(response.choices[0].message.content);import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://www.aotearoainference.com/api/v1',
apiKey: 'sk-aotearoa-xxxxxxxxxxxxxxxxxxxxx', // Your API key
});
// Select a specific provider using extra_body
const response = await client.chat.completions.create({
model: 'auto',
messages: [
{ role: 'user', content: 'Explain quantum computing' }
],
// @ts-ignore - extra_body for provider selection
extra_body: { provider: 'elastix-kimi' }
});
console.log(response.choices[0].message.content);Errors are returned in OpenAI-compatible format with appropriate HTTP status codes:
{
"error": {
"message": "Invalid API key",
"type": "authentication_error",
"code": "invalid_api_key"
}
}{
"error": {
"message": "Insufficient balance. Please add credits to your account.",
"type": "insufficient_balance",
"code": "insufficient_balance"
}
}{
"error": {
"message": "Messages array is required",
"type": "invalid_request_error",
"code": "invalid_messages"
}
}