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

# Bắt đầu nhanh

> Lấy API Key, thay thế Base URL và gửi yêu cầu đầu tiên.

## Bước đầu tiên: Lấy API Key

1. Đăng nhập vào [bảng điều khiển API của 出海营](https://aiid.edu.kg/console)
2. Vào trang mã token để tạo API Key
3. Sau đó sử dụng thông qua `Authorization: Bearer YOUR_API_KEY`

## Bước thứ hai: Cấu hình Base URL

```bash theme={null}
API_BASE_URL="https://api.aiid.edu.kg"
```

Nếu client hiện tại mặc định là:

* `https://api.openai.com`
* `https://api.openai.com/v1`

Thì hãy thay thế tương ứng bằng:

* `https://api.aiid.edu.kg`
* `https://api.aiid.edu.kg`

## Bước 3: Gửi yêu cầu đầu tiên

### Python

```python theme={null}
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.aiid.edu.kg",
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello, what can you do?"}],
)

print(response.choices[0].message.content)
```

### cURL

```bash theme={null}
curl https://api.aiid.edu.kg/v1/chat/completions   -H "Content-Type: application/json"   -H "Authorization: Bearer YOUR_API_KEY"   -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello world!"}]
  }'
```

## Kiến nghị tích hợp

* Dự án mới nên ưu tiên bắt đầu từ giao diện tương thích OpenAI
* Khi chỉnh sửa ảnh, cần đặc biệt lưu ý `multipart/form-data` và yêu cầu đối với trường tệp
* Với API tác vụ video, cần lưu trước `task_id` hoặc `operation_name` rồi mới truy vấn
* Khi gỡ lỗi thất bại, ưu tiên xem mã trạng thái HTTP, `error.code` và `error.message`

## Bước tiếp theo

* Gỡ lỗi trực tuyến: Xem  \`vi/online-debug%60
* AI tạo mã gọi lệnh: Xem  \`vi/ai-codegen%60
* Nhóm mô hình và năng lực: Xem  \`vi/models%60
