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

# API Overview

> Toàn bộ endpoint dành cho team — xác thực, video, generate, image.

Tất cả request cần header:

```
Authorization: Bearer <your-token>
```

***

## Models

| Method | Endpoint | Mô tả |
| - | - | - |
| `GET` | `/v1/models` | Danh sách model team được phép dùng |

→ [Chi tiết](/docs/api/models)

***

## Video Generation

Async — tạo job, poll kết quả.

| Method | Endpoint | Mô tả |
| - | - | - |
| `POST` | `/v1/videos` | Tạo video job (trả về `id` ngay) |
| `GET` | `/v1/videos/{id}` | Lấy trạng thái + kết quả job |
| `GET` | `/v1/videos` | Danh sách job của team |
| `POST` | `/v1/videos/sync` | Tạo video và chờ kết quả (dev only) |

→ [Tạo video](/docs/api/create-video) · [Lấy kết quả](/docs/api/get-video) · [Danh sách](/docs/api/list-videos)

***

## Text Generation

Synchronous — trả kết quả ngay, không cần poll.

| Method | Endpoint | Mô tả |
| - | - | - |
| `POST` | `/v1/chat/completions` | Chat LLM — OpenAI-compatible `messages[]` format (GPT, Gemini, o-series, ...) |
| `POST` | `/v1/generate` | STT, OCR, caption — và một số LLM model qua `prompt` field |

**Dùng endpoint nào?** Kiểm tra `capabilities.endpoint` trong `GET /v1/models`:

* `"/v1/chat/completions"` → dùng `POST /v1/chat/completions` với `messages[]`
* `"/v1/generate"` → dùng `POST /v1/generate` với `prompt`

**Ví dụ — Chat LLM:**

```bash theme={null}
curl -X POST https://hypergate.store/v1/chat/completions \
  -H "Authorization: Bearer your-token" \
  -H "Content-Type: application/json" \
  -d '{ "model": "gemini-2.5-flash", "messages": [{"role":"user","content":"Hello"}] }'
```

**Ví dụ — STT/OCR/Caption:**

```bash theme={null}
curl -X POST https://hypergate.store/v1/generate \
  -H "Authorization: Bearer your-token" \
  -H "Content-Type: application/json" \
  -d '{ "model": "openai-whisper-turbo", "audio": "https://example.com/audio.mp3" }'
```

→ [Chi tiết generate](/docs/api/generate)

***

## Image Generation

Synchronous — trả URL ảnh ngay (HTTP 200).

| Method | Endpoint | Mô tả |
| - | - | - |
| `POST` | `/v1/images/generations` | Text-to-image (sync, 200) |
| `POST` | `/v1/images/edits` | Image-to-image (sync, 200) |
| `GET` | `/v1/images/{id}` | Poll legacy job |
| `POST` | `/v1/images` | Legacy alias — async 202, poll `/v1/images/{id}` |

**Ví dụ — text to image:**

```bash theme={null}
curl -X POST https://hypergate.store/v1/images/generations \
  -H "Authorization: Bearer your-token" \
  -H "Content-Type: application/json" \
  -d '{ "model": "gpt-image-2/text-to-image", "prompt": "A futuristic city" }'
```

→ [Chi tiết](/docs/api/images)

***

## Usage & Stats

| Method | Endpoint | Mô tả |
| - | - | - |
| `GET` | `/v1/usage` | Thống kê sử dụng của team |

→ [Chi tiết](/docs/api/usage)


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