Skip to main content
Tired of juggling multiple API keys, SDKs, and docs just to work with different AI models? Anannas unifies access to multiple LLM providers under one simple API.
Send a request once -> route it anywhere.
One key, all models.
Looking for supported models? See the models page for details.

Using the OpenAI SDK

Anannas is fully compatible with the official OpenAI SDK. Just point the base URL to Anannas and use your Anannas API key.
from openai import OpenAI

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

completion = client.chat.completions.create(
  model="openai/gpt-4o",
  messages=[
    { "role": "user", "content": "Hello from Anannas!" }
  ]
)
print(completion.choices[0].message.content)

Using the Anannas API directly

You can also call the API directly with fetch, requests, or curl.
import requests
import json

response = requests.post(
  "https://api.anannas.ai/v1/chat/completions",
  headers={
    "Authorization": "Bearer <ANANNAS_API_KEY>",
    "Content-Type": "application/json",
  },
  data=json.dumps({
    "model": "openai/gpt-3.5-turbo",
    "messages": [
      { "role": "user", "content": "Hello from Anannas!" }
    ]
  })
)

print(response.json())

Streaming

The Anannas API also supports streaming responses, so you can get tokens as theyโ€™re generated - perfect for chat UIs and real-time applications.
Was this page helpful?