> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anannas.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get started with the Anannas API

## 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](https://anannas.ai/dashboard).

```bash theme={null}
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:

<CodeGroup>
  ```python python theme={null}
  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)
  ```

  ```typescript typescript theme={null}
  import OpenAI from "openai";

  const client = new OpenAI({
    baseURL: "https://api.anannas.ai/v1",
    apiKey: "<ANANNAS_API_KEY>",
  });

  const completion = await client.chat.completions.create({
    model: "anthropic/claude-3-sonnet",
    messages: [
      { role: "user", content: "Explain quantum computing" },
    ],
  });

  console.log(completion.choices[0].message.content);
  ```
</CodeGroup>

## Direct HTTP Requests

<CodeGroup>
  ```python python theme={null}
  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"])
  ```

  ```typescript typescript theme={null}
  const response = await fetch("https://api.anannas.ai/v1/chat/completions", {
    method: "POST",
    headers: {
      "Authorization": "Bearer <ANANNAS_API_KEY>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model: "anthropic/claude-3-sonnet",
      messages: [
        { role: "user", content: "Explain quantum computing" },
      ],
    }),
  });

  const data = await response.json();
  console.log(data.choices[0].message.content);
  ```

  ```bash bash theme={null}
  curl https://api.anannas.ai/v1/chat/completions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $ANANNAS_API_KEY" \
    -d '{
      "model": "openai/gpt-5-mini",
      "messages": [
        {"role": "user", "content": "Explain quantum computing"}
      ]
    }'
  ```
</CodeGroup>

## Response Format

Responses follow the OpenAI Chat Completions schema:

```json theme={null}
{
  "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](/API/Streaming) for implementation details.

## Model Format

<Card title="Browse All Models" icon="book">
  For a complete list of available models with pricing and capabilities, visit [anannas.ai/models](https://anannas.ai/models).
</Card>

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](/models).

## 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:

```json theme={null}
{
  "error": {
    "message": "Invalid model: unknown-model",
    "type": "invalid_request_error"
  }
}
```

## Next Steps

* Read the [API Overview](/API/Overview) for complete request/response schemas
* Review [Parameters](/API/Parameters) for all available options
* Check [Authentication](/API/Authentication) for security best practices
* Explore [Streaming](/API/Streaming) for real-time responses
