> For the complete documentation index, see [llms.txt](https://docs.avis.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avis.xyz/api-reference/introduction.md).

# Introduction

Avis exposes a single generation backend through three drop-in API surfaces: **OpenAI**, **Anthropic**, and **Google Gemini**. Point your existing SDK or integration at the matching Avis base URL — no code changes beyond the base URL and API key.

Every surface accepts any model in the shared Avis model catalog, regardless of which protocol you call it through (e.g. you can call an Anthropic model via the OpenAI-compatible endpoint).

### Get started

1. Create an API key — see Authentication.
2. Pick a surface below and swap your SDK's base URL.
3. Send your first request.

### Base URL

```
https://api.avis.xyz
```

Each surface lives under its own path prefix:

| Surface              | SDK base URL                         |
| -------------------- | ------------------------------------ |
| OpenAI-compatible    | `https://api.avis.xyz/api/openai/v1` |
| Anthropic-compatible | `https://api.avis.xyz/api/anthropic` |
| Gemini-compatible    | `https://api.avis.xyz/api/gemini`    |

### Example request

```bash
curl https://api.avis.xyz/api/openai/v1/chat/completions \
  -H "x-api-key: $AVIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4-1-nano",
    "messages": [{ "role": "user", "content": "Hello!" }]
  }'
```

```json
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "model": "gpt-4-1-nano",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Hello! How can I help you today?" },
      "finish_reason": "stop"
    }
  ]
}
```

### Libraries

Use the official client library for the surface you're calling:

| Surface   | Library                                                                                                        |
| --------- | -------------------------------------------------------------------------------------------------------------- |
| OpenAI    | [`openai`](https://www.npmjs.com/package/openai) (Node), [`openai`](https://pypi.org/project/openai/) (Python) |
| Anthropic | [`@anthropic-ai/sdk`](https://www.npmjs.com/package/@anthropic-ai/sdk)                                         |
| Gemini    | [`@google/genai`](https://www.npmjs.com/package/@google/genai)                                                 |

Point the client's `baseURL`/`baseUrl` at the matching Avis path and pass your Avis API key — see the per-surface pages for exact client setup:

* OpenAI compatibility
* Anthropic compatibility
* Gemini compatibility

### Versioning

Each surface mirrors the path convention of the protocol it's compatible with (`openai/v1`, `anthropic/v1`, `gemini/v1beta`) rather than carrying its own Avis-specific version number. Within a surface, request/response shapes track the corresponding upstream API — see each compatibility page for the fields this proxy actually reads versus forwards untouched.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.avis.xyz/api-reference/introduction.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
