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

# Gnani Evon API

> Generate text with Gnani's language model through an OpenAI-compatible Chat Completions API.

Early access
**Gnani Evon v3.5** is now available as an API to early access registrants.

## Overview

The Gnani Evon API generates text. You send a conversation, and the model writes the next message. Use it to answer questions, summarise, translate, classify, extract details, or hold a conversation. You can write prompts and get replies in Indian languages as well as English; see [Indian languages](https://docs.gnani.ai/api/LLM/indian-languages.md).

It follows **OpenAI's Chat Completions API**. If your code already uses OpenAI's SDK or API, you change the base URL and the API key, and it works.

| | |
| - | - |
| **Endpoint** | `POST https://api.vachana.ai/v1/chat/completions` |
| **Model** | `evon-v3.5`, the one model the API serves. It is the default, so you can leave out `model`. |
| **Input and output** | Text in, text out |
| **Languages** | English and 10 Indian languages. See [Indian languages](https://docs.gnani.ai/api/LLM/indian-languages.md). |
| **Context window** | 64K tokens (65,536) on Free and Pay-as-you-go plans; 128K tokens (131,072) on Enterprise. Input and output together. See [Limits](https://docs.gnani.ai/api/LLM/limits.md). |
| **Thinking** | On by default. See [Thinking](https://docs.gnani.ai/api/LLM/thinking.md). |
| **Tools and output** | [Tool calling](https://docs.gnani.ai/api/LLM/tool-calling.md), [JSON output](https://docs.gnani.ai/api/LLM/structured-outputs.md) and built-in [web search](https://docs.gnani.ai/api/LLM/web-search.md) |
| **Authentication** | Your Gnani API key, in `X-API-Key-ID` or `Authorization: Bearer` |
| **Response** | One JSON object, or a live stream of the reply with `"stream": true` |

## Make your first request

```bash cURL theme={null}
curl https://api.vachana.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key-ID: $GNANI_API_KEY" \
  -d '{
    "model": "evon-v3.5",
    "messages": [
      {"role": "user", "content": "Say hello in Hindi."}
    ]
  }'
```

> [card] [Quickstart](https://docs.gnani.ai/api/LLM/quickstart.md)
>
> Get a key, send your first request in cURL, Python or JavaScript, and read the reply.

> [!NOTE]
>
> **The model thinks before it answers, by default.** Its thinking is returned in `message.reasoning`, apart from the answer in `message.content`, and it counts as output tokens. For quick answers, send `"reasoning_effort": "none"` to turn thinking off. See [Thinking](https://docs.gnani.ai/api/LLM/thinking.md).

## How a conversation works

The API does not remember earlier requests. Each request carries **the whole conversation**, oldest message first, and the model answers the last one. To continue a chat, add the model's reply and the user's next message to `messages` and send it all again.

```json theme={null}
{
  "messages": [
    {"role": "system", "content": "You are a support assistant for a bank. Keep answers short."},
    {"role": "user", "content": "How do I block my debit card?"},
    {"role": "assistant", "content": "Open the app, go to Cards, choose your debit card and tap Block."},
    {"role": "user", "content": "Can I unblock it later?"}
  ]
}
```

| Role | Who writes it | Use it for |
| - | - | - |
| `system` | You | Instructions for the whole conversation: the assistant's job, tone, language, rules. Put it first. `developer` means the same. |
| `user` | Your end user | What the user says or asks. |
| `assistant` | The model | The model's earlier replies, sent back so it has the context. |
| `tool` | Your code | The result of a function the model asked you to run. See [Tool calling](https://docs.gnani.ai/api/LLM/tool-calling.md). |

Every message needs `content`. The only exception is an `assistant` message that carries `tool_calls`.

## Using OpenAI's SDKs and tools

Point any OpenAI-compatible client at Gnani with two settings:

| Setting | Value |
| - | - |
| Base URL | `https://api.vachana.ai/v1` |
| API key | Your Gnani API key. The SDK sends it as `Authorization: Bearer <key>`, which the API accepts. |

Parameters that OpenAI's SDKs do not know, such as `top_k` or `enable_thinking`, go in `extra_body` (Python) or straight into the request object (JavaScript):

```python Python theme={null}
completion = client.chat.completions.create(
    model="evon-v3.5",
    messages=[{"role": "user", "content": "Write a two-line poem about the monsoon."}],
    temperature=0.8,
    extra_body={"top_k": 50, "repetition_penalty": 1.1},
)
```

```javascript JavaScript theme={null}
const completion = await client.chat.completions.create({
  model: "evon-v3.5",
  messages: [{ role: "user", content: "Write a two-line poem about the monsoon." }],
  temperature: 0.8,
  top_k: 50,
  repetition_penalty: 1.1,
});
```

What is different from OpenAI is listed in [Migrating from OpenAI](https://docs.gnani.ai/api/LLM/openai-compatibility.md).

### Gnani Python SDK

For Python, `gnani-vachana` has a sync client (`GnaniLLMClient`) and an async client (`AsyncGnaniLLMClient`). They are built on OpenAI's SDK, so they are called the same way, and they set the base URL and read `GNANI_API_KEY` for you. Gnani-only parameters go in `extra_body`, as above.

```bash theme={null}
pip install "gnani-vachana[llm]"
```

See [Python SDK: LLM](https://docs.gnani.ai/python-sdk/llm.md).

## Explore the docs

> [card] [Quickstart](https://docs.gnani.ai/api/LLM/quickstart.md)
>
> Send your first request in a few minutes.

> [card] [Chat Completions reference](https://docs.gnani.ai/api/LLM/chat-completions.md)
>
> Every request parameter, the response objects, and a playground.

> [card] [Python SDK](https://docs.gnani.ai/python-sdk/llm.md)
>
> Sync and async clients, with install steps.

### Guides

> [card] [Streaming](https://docs.gnani.ai/api/LLM/streaming.md)
>
> Show the reply word by word while the model writes it.

> [card] [Thinking](https://docs.gnani.ai/api/LLM/thinking.md)
>
> How the model reasons before answering, and when to turn it off.

> [card] [Tool calling](https://docs.gnani.ai/api/LLM/tool-calling.md)
>
> Let the model call your functions and APIs.

> [card] [JSON output](https://docs.gnani.ai/api/LLM/structured-outputs.md)
>
> Get replies your code can parse.

> [card] [Web search](https://docs.gnani.ai/api/LLM/web-search.md)
>
> Answer with up-to-date information from the web, with sources.

> [card] [Indian languages](https://docs.gnani.ai/api/LLM/indian-languages.md)
>
> Prompt and reply in Indian languages, and control the reply language.

> [card] [Migrating from OpenAI](https://docs.gnani.ai/api/LLM/openai-compatibility.md)
>
> What works as in OpenAI, what differs, and Gnani-only options.

### Recipes

> [card] [Voice agent](https://docs.gnani.ai/api/LLM/recipes/voice-agent.md)
>
> Speech to text, Evon and text to speech in one loop.

> [card] [Support bot](https://docs.gnani.ai/api/LLM/recipes/support-bot.md)
>
> Answer order questions with tool calling.

> [card] [Intent classification](https://docs.gnani.ai/api/LLM/recipes/intent-classification.md)
>
> Classify Hindi and Kannada messages into JSON.

> [card] [Web search Q\&A](https://docs.gnani.ai/api/LLM/recipes/web-search-qa.md)
>
> Answer with current information and cited sources.

### Reference

> [card] [Safety and privacy](https://docs.gnani.ai/api/LLM/safety.md)
>
> What the safety filters refuse, and how personal data is masked.

> [card] [Limits](https://docs.gnani.ai/api/LLM/limits.md)
>
> Context size, rate limits and the daily token quota.

> [card] [Errors](https://docs.gnani.ai/api/LLM/errors.md)
>
> Every error, what it means, and when to retry.

> [card] [Changelog](https://docs.gnani.ai/api/LLM/changelog.md)
>
> What changed in the API and the docs.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.