Aotearoa Inference API

OpenAI-compatible chat completion API

Overview

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.

Authentication

Authenticate requests using Bearer token authentication in the Authorization header:

Authorization: Bearer sk-aotearoa-xxxxxxxxxxxxxxxxxxxxx

Getting an API Key

  1. Sign up or sign in to your account
  2. Navigate to Dashboard → API Keys
  3. Click "Create New API Key"
  4. Give your key a descriptive name (e.g., "Production", "Development")
  5. Copy the key immediately - it's only shown once

You can create up to 10 API keys per account. Keys are in the format: sk-aotearoa-{32_hex_chars}

Endpoint

POST https://www.aotearoainference.com/api/v1/chat/completions

Compatible with OpenAI's /v1/chat/completions endpoint.

Request Format

Headers

Authorization: Bearer sk-aotearoa-xxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json

Request Body

{
  "model": "auto",           // Optional, use "auto" for automatic selection
  "provider": "elastix-deepseek",    // Optional, specific provider selection
  "messages": [
    {
      "role": "user",
      "content": "Hello, how are you?"
    }
  ]
}

Parameters

  • messages (required) - Array of message objects with "role" and "content"
  • model (optional) - Use "auto" for automatic selection or specific model name
  • provider (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

Available Providers

Provider NameDisplay NameModel
elastix-deepseekAotearoa InferenceDeepSeek-V3.2
elastix-qwenAotearoa InferenceQwen3-Coder-480B-A35B-Instruct
elastix-kimiAotearoa InferenceKimi-K2-Thinking
elastix-gpt-oss-120bAotearoa Inferencegpt-oss-120b
elastix-geminiAotearoa InferenceGemini 3 Flash Preview
elastix-llamaAotearoa InferenceLlama 3.3 70B Instruct
elastix-mistralAotearoa InferenceMistral Large 2411
elastix-claudeAotearoa InferenceClaude Sonnet 4.5

If no provider is specified, requests use auto-rotation between active providers.

Response Format

{
  "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
  }
}

Example Usage

cURL (Auto-Rotation)

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 (Specific Provider)

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"
      }
    ]
  }'

Python (Auto-Rotation)

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)

Python (Specific Provider)

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)

JavaScript (Auto-Rotation)

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);

JavaScript (Specific Provider)

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);

Error Handling

Errors are returned in OpenAI-compatible format with appropriate HTTP status codes:

401 Unauthorized

{
  "error": {
    "message": "Invalid API key",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}

402 Payment Required

{
  "error": {
    "message": "Insufficient balance. Please add credits to your account.",
    "type": "insufficient_balance",
    "code": "insufficient_balance"
  }
}

400 Bad Request

{
  "error": {
    "message": "Messages array is required",
    "type": "invalid_request_error",
    "code": "invalid_messages"
  }
}