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

# Giới thiệu

Avis cung cấp một backend tạo nội dung thông qua ba giao diện API có thể thay thế trực tiếp (drop-in): **OpenAI**, **Anthropic** và **Google Gemini**. Chỉ cần trỏ SDK hoặc tích hợp hiện có đến base URL tương ứng của Avis; bạn không cần thay đổi mã nguồn ngoài base URL và API key.

Mỗi giao diện đều chấp nhận mọi mô hình trong danh mục chung của Avis, bất kể giao thức được dùng để gọi (ví dụ, bạn có thể gọi mô hình Anthropic qua endpoint tương thích OpenAI).

### Bắt đầu

1. Tạo API key theo hướng dẫn trong phần Xác thực.
2. Chọn một giao diện bên dưới và cập nhật base URL trong SDK.
3. Gửi request đầu tiên.

### Base URL

```
https://api.avis.net
```

Mỗi giao diện có tiền tố đường dẫn riêng:

| Giao diện             | Base URL cho SDK                     |
| --------------------- | ------------------------------------ |
| Tương thích OpenAI    | `https://api.avis.net/api/openai/v1` |
| Tương thích Anthropic | `https://api.avis.net/api/anthropic` |
| Tương thích Gemini    | `https://api.avis.net/api/gemini`    |

### Ví dụ request

```bash
curl https://api.avis.net/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"
    }
  ]
}
```

### Thư viện

Dùng thư viện client chính thức cho giao diện bạn đang gọi:

| Giao diện | Thư viện                                                                                                       |
| --------- | -------------------------------------------------------------------------------------------------------------- |
| 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)                                                 |

Đặt `baseURL`/`baseUrl` của client thành đường dẫn Avis tương ứng và truyền Avis API key. Xem trang hướng dẫn của từng giao diện để biết cách cấu hình client:

* Tương thích OpenAI
* Tương thích Anthropic
* Tương thích Gemini

### Phiên bản

Mỗi giao diện dùng quy ước đường dẫn phiên bản của giao thức tương ứng (`openai/v1`, `anthropic/v1`, `gemini/v1beta`), thay vì có số phiên bản riêng của Avis. Cấu trúc request/response trong mỗi giao diện bám theo API upstream tương ứng. Xem trang tương thích để biết proxy đọc những trường nào và chuyển tiếp nguyên vẹn những trường nào.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avis.net/vi/tai-lieu-api/introduction.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
