# 無需自架的 LiteLLM 替代方案

LiteLLM is open-source software you deploy on your own server — Docker, config files, provider keys, uptime your problem. RunAPI is a hosted gateway: same OpenAI-compatible API, same 100+ LLMs, no server to run. Change the base URL and your existing code keeps working. RunAPI also adds image, video, and music generation, built-in billing, MCP server, CLI, and SDKs at 50% off official rates.

*Updated June 23, 2026 · RunAPI Editorial*

## LiteLLM vs RunAPI——自架還是託管？

LiteLLM is an open-source Python proxy you run on your own server. It supports 100+ LLMs through a unified OpenAI-compatible interface — you pay provider costs and your own hosting, but you control everything. RunAPI is the managed version of that idea: the same OpenAI-compatible API, no server to run, 50% off official model rates, and coverage extended to image, video, and music generation under one API key. If the setup and ops work of self-hosting isn&#39;t something you want to own, RunAPI gets you the same multi-model access without it.

- **託管模式**: LiteLLM 在您的基礎設施上運行（Docker、VM、K8s）。RunAPI 是託管服務——向 runapi.ai 發送請求，無需部署。
- **模態覆蓋範圍**: LiteLLM 路由文字 LLM。RunAPI 路由 LLM 並在同一金鑰下新增圖像、影片、音樂和音訊生成。
- **定價**: LiteLLM 是免費軟體；您需支付提供商 API 費用加上託管費用。RunAPI 收取官方模型定價的 50%，無基礎設施開銷。
- **開發者工具套件**: RunAPI 提供 MCP 伺服器、CLI，以及 Python、Node.js、PHP、Java、Ruby 和 Go 的 SDK，並完全相容 OpenAI SDK。

## LiteLLM vs RunAPI 功能詳細比較

The table compares the two gateways across the dimensions that matter most: whether you want to run your own server or just use an API, how much you pay, and what models you can actually reach.

| 功能 | LiteLLM | RunAPI |
|---|---|---|
| 託管模式 | 自架（您的基礎設施） | 完全託管服務 |
| LLM 路由 | 是——100+ 個模型 | 是——100+ 個模型 |
| 圖像生成 | 否 | 是 |
| 影片生成 | 否 | 是 |
| 音樂與音訊 | 否 | 是 |
| OpenAI 相容 API | 是 | 是 |
| 內建計費 | 手動（自備金鑰） | 是——統一帳戶計費 |
| MCP 伺服器 | 否 | 是 |
| 官方 SDK | Python（LiteLLM SDK） | Python、Node.js、PHP、Java、Ruby、Go + OpenAI 相容 |
| CLI | litellm CLI（伺服器管理） | 是——生成與金鑰管理 |
| 費用 | 提供商費用 + 託管費用 | 官方提供商定價五折 |

## 捨棄自架代理後會有什麼改變？

Running LiteLLM means cloning the repo, editing a .env file with a master key and salt key, running docker-compose, then configuring each provider through the admin UI — and that&#39;s just the first time. After that you own the uptime, the upgrades, and the key rotation. RunAPI removes that layer entirely. Send requests to runapi.ai and pay per call. No server, no config files, no provider accounts to juggle.

### 無需配置伺服器

LiteLLM requires a running Python process or Docker container on a VPS you pay for and monitor. RunAPI is an HTTPS endpoint — point your client at it and start calling.

### 無需維護設定檔

LiteLLM 的 config.yaml 將模型名稱映射到提供商金鑰並處理容錯。RunAPI 在內部處理路由；您只需提供一個 API 金鑰。

### 無需為每個提供商管理金鑰

使用 LiteLLM 時，您需要在伺服器上儲存 Anthropic、OpenAI、Gemini 和其他金鑰。RunAPI 只需在您這端保管一個金鑰——它在其端管理提供商憑證。

### 統一計費於一處

LiteLLM gives you raw provider invoices across multiple accounts. RunAPI consolidates all usage into a single dashboard with per-call cost records — one bill instead of a bunch of paid API accounts.


## RunAPI 路由哪些模型？

LiteLLM&#39;s strength is breadth — it routes 100+ LLMs from every major provider. RunAPI matches that LLM coverage across the frontier models most teams actually use (Claude, GPT, Gemini, DeepSeek) and adds generative media models not available through LiteLLM.

### 語言模型

Claude, GPT, Gemini, DeepSeek, and other LLMs for chat, coding, reasoning, and tool use — the same text coverage LiteLLM users expect from the frontier models.

### 圖像模型

文字轉圖像和圖像編輯模型，包括 Flux 和 Seedream，可使用與 LLM 呼叫相同的 API 金鑰呼叫。

### 影片模型

文字轉影片和圖像轉影片模型，用於生成短片，按每任務計費。

### 音樂與音訊

音樂生成和音訊模型，用於配樂和配音工作——完全超出 LiteLLM 範疇的模態。


## RunAPI 定價與自架 LiteLLM 相比如何？

LiteLLM is free software but you pay full provider rates on top of what your VPS costs (~$6–12/month) plus time spent maintaining the setup. RunAPI charges 50% of official provider rates with no hosting overhead. For teams that aren&#39;t optimizing LiteLLM&#39;s advanced routing features, the total cost often favors the managed option.

| 模型 | 官方輸入 /百萬 | 官方輸出 /百萬 | RunAPI 輸入 /百萬 | RunAPI 輸出 /百萬 |
|---|---|---|---|---|
| Claude Sonnet 4.6 | $6.00 | $30.00 | $3.00 | $15.00 |
| Claude Opus 4.7 | $10.00 | $50.00 | $5.00 | $25.00 |
| GPT-5.4 | $2.50 | $15.00 | $1.25 | $7.50 |
| Gemini 2.5 Pro | $1.25 | $10.00 | $0.63 | $5.00 |

## 如何從 LiteLLM 切換至 RunAPI

1. **建立 RunAPI 帳戶** — 在 runapi.ai 註冊。無需信用卡即可開始。
2. **取得您的 API 金鑰** — 前往 Dashboard -&gt; API Keys，建立金鑰並複製到您的環境中。
3. **更新 Base URL** — 在您的 OpenAI 相容客戶端或 LiteLLM 設定中，將 Base URL 更改為 https://runapi.ai/v1，並將 LiteLLM 金鑰替換為 RunAPI 金鑰。無需其他程式碼修改。
4. **停用您的 LiteLLM 伺服器** — 請求開始透過 RunAPI 路由後，您可以停止 LiteLLM 程序並移除伺服器。儲存在其中的提供商金鑰也不再需要。

## LiteLLM 替代方案常見問題

### Isn&#39;t this still paying for cloud APIs? How is this different from just using the services directly?

Good question — the difference is one API key, one bill, and one base URL. With LiteLLM you still need an Anthropic key, an OpenAI key, a Gemini key, and so on, plus the LiteLLM server to hold them all together. RunAPI gives you a single key that reaches every model. You drop it in where you used to put your OpenAI key, change the base URL to runapi.ai/v1, and you&#39;re done. No accounts to manage per provider, no invoices per service.

### You started with self-hosted, then immediately added a bunch of paid cloud API subscriptions — isn&#39;t that the opposite of self-hosted?

LiteLLM gives you self-hosting with full control — your server, your provider keys, your config files. RunAPI is the other side of that choice: no Docker, no VPS to pay for, no config.yaml to maintain, no uptime to monitor. You still get the same OpenAI-compatible API and access to 100+ LLMs. The tradeoff is that you don&#39;t run the infrastructure; RunAPI does. If control and privacy are the priority, LiteLLM makes sense. If you want multi-model access without the setup, RunAPI gets you there faster.

### Is RunAPI a drop-in replacement for LiteLLM?

RunAPI is a drop-in replacement for the OpenAI-compatible API surface — the same /v1/chat/completions endpoint. Change the base URL and API key in your existing client and requests start routing through RunAPI. LiteLLM-specific features like virtual keys and custom routing rules have no equivalent, so check those before switching.

### RunAPI 與 LiteLLM 相比費用如何？

LiteLLM is free software but you pay full provider rates plus the cost of running a server (a VPS typically runs $6–12/month) plus time spent on upgrades, config changes, and debugging outages. RunAPI charges 50% of official model rates with no hosting overhead. For Claude Sonnet 4.6, that is $3 per million input tokens and $15 per million output tokens versus $6 and $30 at official rates — and nothing extra for the server.

### RunAPI 可與 Claude Code、Cursor 和 Windsurf 搭配使用嗎？

是的。在每個工具的設定中將 Anthropic 或 OpenAI 的 Base URL 設為 RunAPI 端點，並使用您的 RunAPI 金鑰。三個工具均無需額外修改即可使用。同一金鑰也可解鎖圖像、影片和音訊模型，適用於需要多模態生成的專案。

### 什麼是 MCP 伺服器？它與 LiteLLM 有何不同？

RunAPI 提供 Model Context Protocol 伺服器，讓支援 MCP 的主機（如 Claude Code）可直接從助理介面發現模型、查詢定價並建立任務。LiteLLM 沒有 MCP 伺服器。RunAPI MCP 伺服器是附加功能——您可以將其與 REST API 並用，而非取代。

### 我可以將 OpenAI Python SDK 與 RunAPI 搭配使用嗎？

Yes. Point the base_url parameter at https://runapi.ai/v1 and pass your RunAPI key as api_key. The rest of your OpenAI SDK code stays unchanged. RunAPI also publishes its own typed SDKs for Python, Node.js, PHP, Java, Ruby, and Go if you prefer a client built for RunAPI&#39;s full API surface including media generation.

### LiteLLM 的虛擬金鑰和消費追蹤功能會怎樣？

LiteLLM&#39;s virtual key system lets you issue internal keys with per-key spend caps and model restrictions — useful if you&#39;re running LiteLLM as a shared hub for a family or team. RunAPI doesn&#39;t have virtual keys, but provides per-account usage reporting and per-call cost records in the dashboard. If the main reason you use LiteLLM&#39;s virtual keys is to track or limit spend, RunAPI&#39;s account billing covers that. If you need to issue keys to other people with different model access, evaluate that gap before migrating.

