# 多模態

> 在 LLMoxy 中使用圖像、音訊、視訊和 Realtime 介面。

多模態能力取決於選中的模型。請透過 `GET /v1/models` 或控制台價格頁確認當前可用的多模態模型。

## 圖像

OpenAI 風格圖像生成：

```bash
curl https://llmoxy.com/v1/images/generations \
  -H "Authorization: Bearer <LLMOXY_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "A clean product icon for an LLM gateway",
    "size": "1024x1024",
    "response_format": "url"
  }'
```

LLMoxy 也會轉發模型特有的圖像參數，只要所選模型支援它們。

圖像編輯路由：

```txt
POST /v1/images/edits
POST /v1/edits
```

## 音訊

文字轉語音：

```bash
curl https://llmoxy.com/v1/audio/speech \
  -H "Authorization: Bearer <LLMOXY_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "input": "Hello from LLMoxy.",
    "voice": "alloy",
    "response_format": "mp3"
  }' \
  --output speech.mp3
```

音訊轉錄和翻譯使用 multipart 表單上傳：

```txt
POST /v1/audio/transcriptions
POST /v1/audio/translations
```

## 視訊

OpenAI 相容視訊生成：

```bash
curl https://llmoxy.com/v1/videos \
  -H "Authorization: Bearer <LLMOXY_API_KEY>" \
  -F model=sora-2 \
  -F prompt="cute cat dance" \
  -F seconds=8
```

查詢狀態：

```bash
curl "https://llmoxy.com/v1/videos/$TASK_ID" \
  -H "Authorization: Bearer <LLMOXY_API_KEY>"
```

下載內容：

```bash
curl "https://llmoxy.com/v1/videos/$TASK_ID/content" \
  -H "Authorization: Bearer <LLMOXY_API_KEY>" \
  --output output.mp4
```

LLMoxy 也支援 `POST /v1/video/generations` 的 JSON 視訊生成介面，以及 Kling、Jimeng 等廠商風格路由。具體支援的模型請查看控制台模型列表。

## Realtime

Realtime 使用 WebSocket 端點：

```txt
wss://llmoxy.com/v1/realtime?model=gpt-4o-realtime-preview
```

服務端客戶端可在握手時使用標準認證頭；瀏覽器客戶端可使用 OpenAI 風格子協定金鑰格式。

本文是 https://tw.llmoxy.com/docs/api-reference/multimodal 的 markdown 版本。
