---
title: LLM API — OpenAI 相容 | RunAPI
description: 透過一個 OpenAI 相容的 API endpoint 存取 RunAPI 語言模型。
url: https://runapi.ai/zh-TW/llm.md
canonical: https://runapi.ai/zh-TW/llm
locale: zh-TW
site: RunAPI
image: https://runapi.ai/assets/opengraph-bfaaa0f0.png
alternates:
  en: https://runapi.ai/llm
  zh-CN: https://runapi.ai/zh-CN/llm
  es: https://runapi.ai/es/llm
  ja: https://runapi.ai/ja/llm
  de: https://runapi.ai/de/llm
  fr: https://runapi.ai/fr/llm
  pt-BR: https://runapi.ai/pt-BR/llm
  ko: https://runapi.ai/ko/llm
  it: https://runapi.ai/it/llm
  nl: https://runapi.ai/nl/llm
  pl: https://runapi.ai/pl/llm
  tr: https://runapi.ai/tr/llm
  zh-TW: https://runapi.ai/zh-TW/llm
  zh-HK: https://runapi.ai/zh-HK/llm
  ar: https://runapi.ai/ar/llm
  x-default: https://runapi.ai/llm
---

> HTML version: https://runapi.ai/zh-TW/llm
> Site index for agents: https://runapi.ai/llms.txt

<!-- llm-api-slot: api-hero-metrics owner=API-1983 state=ready -->

# LLM API — OpenAI 相容

透過一個 OpenAI 相容的 endpoint 存取 [Claude](https://runapi.ai/zh-TW/models/claude.md)、GPT、[Gemini](https://runapi.ai/zh-TW/models/gemini.md)、[DeepSeek](https://runapi.ai/zh-TW/models/deepseek.md) 和 Grok。/v1/chat/completions、/v1/messages、/v1/responses。

[取得 API Key](https://runapi.ai/zh-TW/login) [瀏覽模型](https://runapi.ai/zh-TW/models.md)

67 個模型 · 直接替換 base_url · 按 token 付費

| Value | Metric |
| --- | --- |
| 67 | LLM 模型 |
| 15-25% | 低於官方價格 |
| 2 行 | 遷移只需 |


<!-- llm-api-slot: llm-playground owner=API-1987 state=dependency_pending -->


<!-- llm-api-slot: multi-model-comparison owner=API-1984 state=ready -->

## 多模型比較

提示詞: `用一句話解釋量子運算`

| Model | Provider | Price |
| --- | --- | --- |
| Claude/claude-fable-5 (`/v1/messages`) | Anthropic | Input $10.00 / 1M tokens \| Output $50.00 / 1M tokens |
| Claude/claude-fable-5-1 (`/v1/messages`) | Anthropic | Input $10.00 / 1M tokens \| Output $50.00 / 1M tokens |
| Claude/claude-haiku-4-5-20251001 (`/v1/messages`) | Anthropic | Input $0.60 / 1M tokens \| Output $3.00 / 1M tokens |


<!-- llm-api-slot: endpoint-shape-cards owner=API-1985 state=ready -->

## 4 種 endpoint 格式，一把 key

- **Chat completion** - 所有 SDK 都已支援的 OpenAI 格式。替換 base_url，同時保留現有請求程式碼。
- **Message** - 適用於 system prompt、工具使用和結構化內容區塊的 Messages API 格式。
- **Response** - 適用於多輪 agent 迴圈的有狀態格式，由伺服器端處理對話。
- **Embedding** - 用於檢索的向量 embeddings，以同一把 RunAPI key 按 token 計費。


<!-- llm-api-slot: model-pricing-list owner=API-1986 state=ready -->
## 一把 key 使用所有 LLM

| Model | Provider | Price |
| --- | --- | --- |
| Claude/claude-fable-5 | Anthropic | $10.00 / 1M in |
| Claude/claude-fable-5-1 | Anthropic | $10.00 / 1M in |
| Claude/claude-haiku-4-5-20251001 | Anthropic | $0.60 / 1M in |
| Claude/claude-opus-4-1-20250805 | Anthropic | $9.00 / 1M in |
| Claude/claude-opus-4-5-20251101 | Anthropic | $3.00 / 1M in |
| Claude/claude-opus-4-6 | Anthropic | $3.00 / 1M in |
| Claude/claude-opus-4-7 | Anthropic | $3.00 / 1M in |
| Claude/claude-opus-4-8 | Anthropic | $3.00 / 1M in |


[查看全部 67 個 LLM 模型](https://runapi.ai/zh-TW/models.md)


<!-- llm-api-slot: quickstart-code-panel owner=API-1988 state=ready -->
## 快速入門

### 使用 OpenAI 格式呼叫任何模型

#### curl

```bash
curl https://runapi.ai/v1/chat/completions \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"Explain the difference between concurrency and parallelism."}]}'
```

#### 回應

```json
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "model": "deepseek-v4-flash",
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 8,
    "total_tokens": 20
  }
}
```


<!-- llm-api-slot: four-step-flow owner=API-1989 state=ready -->
## 四步完成第一次生成

**使用方式**

1. **取得 API 金鑰** - 為你的 RunAPI 帳戶建立一個金鑰。
2. **使用 OpenAI 格式** - 透過文件中的 OpenAI 相容端點傳送請求。
3. **智慧路由** - RunAPI 為你的請求選擇受支援的路由。
4. **串流回應** - 當所選端點支援 SSE 時接收串流輸出。


<!-- llm-api-slot: benefit-cards owner=API-1990 state=ready -->

## 為什麼開發者選擇 RunAPI

### 一把 Key，所有模型

不再為 API 金鑰疲於奔命。一次整合即可存取所有供應商的 230+ 個模型。

### 節省 15-25% 費用

我們與供應商的用量協議意味著價格比直接購買更低，且不額外加價。

### 自動容錯切換

若供應商故障，我們會路由至下一個最佳選項，讓您的應用程式持續運作。

### 相容 OpenAI

OpenAI SDK 的直接替代方案。只要修改一行程式碼，即可存取任何模型。

### 即時帳單

只為實際用量付費。按請求計費，無最低消費；可依模型和專案追蹤成本。

### 資料隱私

隱私政策說明了請求資料和生成內容的處理與保存方式。



<!-- llm-api-slot: related-api-cards owner=API-1991 state=ready -->

### 探索

## 更多 AI API

- [Video API](https://runapi.ai/zh-TW/models.md?modality=video) - 使用 80 個模型生成、編輯及放大影片 [了解更多](https://runapi.ai/zh-TW/models.md?modality=video)
- [Image API](https://runapi.ai/zh-TW/models.md?modality=image) - 使用 49 個模型建立與轉換圖像 [了解更多](https://runapi.ai/zh-TW/models.md?modality=image)
- [Music API](https://runapi.ai/zh-TW/models.md?modality=audio_music) - 以 AI 創作原創音樂 [了解更多](https://runapi.ai/zh-TW/models.md?modality=audio_music)
- [Audio API](https://runapi.ai/zh-TW/models.md?modality=audio_music) - 使用 31 個模型進行文字轉語音 [了解更多](https://runapi.ai/zh-TW/models.md?modality=audio_music)


<!-- llm-api-slot: team-use-case-cards owner=API-1992 state=ready -->

## 團隊如何運用它

**程式開發 Agents**

將規劃任務交給 Opus，將編輯任務交給低成本模型；共用同一個 key 與一張帳單。

**RAG 管線**

embeddings 和生成使用相同 endpoint，讓檢索與回答共用預算。

**內容生成**

將草稿分送至多個模型並保留最佳版本，無須簽訂五家供應商合約。

**多模型比較**

只要變更一個字串，即可在 Claude、GPT 和 Gemini 之間對同一個 prompt 進行 A/B 測試。



<!-- llm-api-slot: comparison-matrix owner=API-1993 state=ready -->

## RunAPI 與其他方案比較

| 功能 | RunAPI | OpenRouter | 直接 API |
| --- | --- | --- | --- |
| LLM 模型 | 66 | 300+ | 1 個供應商 |
| 其他模態 | 影片、圖片、音樂、音訊 | 否 | 依供應商而定 |
| 定價 | 比官方價格低 15–25% | 市場價格 | 官方費率 |
| 原生 Messages API | 是 | 否 | 是 |
| 統一點數 | 是 | 是 | 否 |
| MCP server + CLI | 是 | 否 | 否 |


<!-- llm-api-slot: faq-accordion owner=API-1994 state=ready -->

## LLM API 常見問題

### 如何從 OpenAI 相容用戶端遷移？

將用戶端指向文件列出的 RunAPI base URL，並使用您的 RunAPI key。維持所選 endpoint 支援的請求格式。

### 支援串流嗎？

所選模型和 endpoint 提供串流回應時，即可使用串流。

### 工具呼叫可以運作嗎？

在其執行階段合約宣告支援工具的模型和 endpoint 格式上，可使用工具呼叫。

### token 如何計費？

模型目錄中列有輸入與輸出費率。使用量會依請求回報的 token 數量計費。

### 我該使用哪個 endpoint？

請選擇符合您現有用戶端及請求所需功能的 endpoint 格式。

### 如果路由無法使用怎麼辦？

API 會透過文件定義的回應合約傳回請求狀態，讓您的應用程式能重試或選擇其他支援的模型。



<!-- llm-api-slot: final-cta owner=API-1995 state=ready -->
## 替換兩行，保留您的程式碼

您已部署的 OpenAI 格式背後有 67 個模型。免費開始，無需信用卡。

- [取得 API Key](https://runapi.ai/zh-TW/login)
- [閱讀文件](https://runapi.ai/zh-TW/docs/guides)




---

## More from RunAPI

- [Home](https://runapi.ai/zh-TW/.md)
### 產品
- [模型目錄](https://runapi.ai/zh-TW/models.md)
- [價格](https://runapi.ai/zh-TW/pricing.md)
- [提供商](https://runapi.ai/zh-TW/models#all-models)
### 開發者
- [文件](https://runapi.ai/zh-TW/docs/guides)
- [SDK](https://runapi.ai/zh-TW/sdk.md)
- [CLI](https://runapi.ai/zh-TW/cli.md)
- [MCP Server](https://runapi.ai/zh-TW/mcp.md)
### 指南
- [Claude Code 與 Cursor](https://runapi.ai/zh-TW/claude-code-vs-cursor.md)
- [Cursor API 設定](https://runapi.ai/zh-TW/cursor-api-setup.md)
- [RunAPI 與 OpenRouter](https://runapi.ai/zh-TW/openrouter-alternative.md)
### 公司
- [企業版](https://runapi.ai/zh-TW/contact.md)
- [聯絡我們](https://runapi.ai/zh-TW/contact.md)
### 法律
- [服務條款](https://runapi.ai/zh-TW/terms.md)
- [隱私權](https://runapi.ai/zh-TW/privacy.md)
- [Site index for agents](https://runapi.ai/llms.txt)

Contact: contact@runapi.ai

## Structured data

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-TW",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-TW",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/zh-TW/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "zh-TW",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/zh-TW",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/zh-TWicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  }
]
```
