Skip to main content

Overview

Anannas provides a unified OpenAI-compatible API for accessing multiple LLM providers. The Anannas API endpoint is https://api.anannas.ai/v1 and uses standard HTTP POST requests with JSON payloads.

Authentication

All requests require a Bearer token in the Authorization header. Get your API key from the Anannas dashboard.
Authorization: Bearer <ANANNAS_API_KEY>

Endpoint

POST https://api.anannas.ai/v1/chat/completions

Request Format

The Anannas API follows the OpenAI Chat Completions format. Required fields:
  • model (string): Model identifier in format provider/model-name (e.g., openai/gpt-5-mini, anthropic/claude-3-sonnet)
  • messages (array): Array of message objects with role and content fields

Using the OpenAI SDK

The official OpenAI SDK works with Anannas by setting the base_url parameter:
from openai import OpenAI

client = OpenAI(
  base_url="https://api.anannas.ai/v1",
  api_key="<ANANNAS_API_KEY>",
)

response = client.chat.completions.create(
  model="openai/gpt-5-mini",
  messages=[
    { "role": "user", "content": "Explain quantum computing" }
  ]
)

print(response.choices[0].message.content)

Direct HTTP Requests

import requests

response = requests.post(
  "https://api.anannas.ai/v1/chat/completions",
  headers={
    "Authorization": "Bearer <ANANNAS_API_KEY>",
    "Content-Type": "application/json",
  },
  json={
    "model": "openai/gpt-5-mini",
    "messages": [
      { "role": "user", "content": "Explain quantum computing" }
    ]
  }
)

data = response.json()
print(data["choices"][0]["message"]["content"])

Response Format

Responses follow the OpenAI Chat Completions schema:
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1677652288,
  "model": "openai/gpt-5-mini",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Quantum computing is..."
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 50,
    "total_tokens": 60
  }
}

Streaming

Enable streaming by setting stream: true. The Anannas API returns Server-Sent Events (SSE) with incremental text deltas. See the Streaming documentation for implementation details.

Model Format

Browse All Models

For a complete list of available models with pricing and capabilities, visit anannas.ai/models.
Models are specified as provider/model-name:
  • openai/gpt-5-mini
  • openai/gpt-3.5-turbo
  • anthropic/claude-3-sonnet
  • anthropic/claude-3-opus
Query available models via GET /v1/models or see the models documentation.

Error Handling

The Anannas API returns standard HTTP status codes:
  • 200: Success
  • 400: Invalid request (malformed JSON, missing required fields)
  • 401: Authentication failed (invalid or missing API key)
  • 402: Insufficient credits
  • 429: Rate limit exceeded
  • 500: Internal server error
Error responses follow this format:
{
  "error": {
    "message": "Invalid model: unknown-model",
    "type": "invalid_request_error"
  }
}

Next Steps