RouteFree
搜尋模型.../
登入

RouteFree 文件

RouteFree 是台灣的統一 AI API 閘道器 — 透過單一、與 OpenAI 相容的 API 端點,提供對 OpenAI、Anthropic、Google、Meta 等數百個模型的存取。

台幣計費・統一發票・中文支援。企業財務零障礙,政府採購資格。

30+ Models
GPT-5, Claude 4.6, Gemini 3, Llama 4 and more
OpenAI Compatible
Works with any OpenAI SDK — just change base URL
NTD Billing
Monthly unified invoices (統一發票)
High Availability
Priority-based upstream routing & failover

快速入門

五分鐘內開始使用。RouteFree 與 OpenAI SDK 完全相容 — 只需更改

Base URL

bash
https://routefree.tw/api/v1

Using the OpenAI SDK

RouteFree is fully compatible with the OpenAI SDK. Just change the base URL and API key — all other code stays the same.

python
from openai import OpenAI

client = OpenAI(
    base_url="https://routefree.tw/api/v1",
    api_key="sk-rf-YOUR_API_KEY",
)

completion = client.chat.completions.create(
    model="openai/gpt-4.1",
    messages=[
        {"role": "user", "content": "What is the meaning of life?"}
    ],
)

print(completion.choices[0].message.content)
Need an API key?
Get your API key from the API Keys page. All keys start with sk-rf-.

身份驗證

All API requests require an API key sent in the Authorization header.

bash
Authorization: Bearer sk-rf-YOUR_API_KEY

Create and manage keys from the API Keys dashboard. Keep your key secure and never expose it in client-side code.

Security Note
Never expose API keys in client-side JavaScript. Always proxy requests through your backend server.

Optional Headers

HTTP-Referer
string
Your site URL — used for analytics and rankings (optional)
X-Title
string
Your app name — shown in dashboards (optional)

設計原則

RouteFree 圍繞三個核心原則設計:

1. Unified Interface

One API, one SDK, 30+ models. Switch between OpenAI, Anthropic, Google, DeepSeek, Meta, and more without changing your code — just change the model ID.

2. Price Optimization

RouteFree automatically routes to the best available provider for your chosen model using a priority-based routing system. You pay only for what you use, billed in NTD with full invoicing support.

3. High Availability

Priority-based upstream routing means if a provider goes down, your requests are routed to the next available provider. No code changes, no downtime.

多模態

RouteFree 支援多模態輸入 — 將圖片、音訊和檔案與文字一起傳送至支援的模型。內容會直接傳送至上游供應商。

支援的模態

Input
Description
Example Models
文字標準文字訊息所有模型
圖片URL 或 base64 編碼圖片openai/gpt-4.1, anthropic/claude-sonnet-4.6, google/gemini-2.5-flash
檔案 / PDF透過 URL 的文件內容google/gemini-2.5-flash, anthropic/claude-sonnet-4.6

傳送圖片

使用 content 陣列格式搭配 image_url 部分:

python
response = client.chat.completions.create(
    model="openai/gpt-4.1",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "What's in this image?"},
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "https://example.com/photo.jpg",
                        "detail": "auto"  # "low", "high", or "auto"
                    }
                }
            ]
        }
    ],
)
print(response.choices[0].message.content)
傳送圖片
請查看模型頁面,了解每個模型支援的輸入模態。模態欄位顯示每個模型接受的輸入類型。

回報問題

透過回報問題、錯誤或建議幫助我們改善 RouteFree。我們積極監控所有回饋管道。

如何回報

管道
最適用於
回應時間
聯絡頁面一般回饋、功能需求1-2 個工作天
電子郵件錯誤報告、技術問題24 小時內
API 回應標頭自動回報的錯誤和指標自動

應包含的資訊

  • 請求 ID(來自回應 id 欄位)
  • 使用的模型和傳送的參數
  • 預期行為與實際行為
  • 時間戳記和問題頻率
  • 錯誤訊息或 HTTP 狀態碼

請訪問我們的聯絡頁面提交回饋。

企業方案 BETA

RouteFree 企業方案提供專用基礎設施、自訂 SLA 和進階支援,適用於高流量 AI 工作負載的組織。

企業功能

專用基礎設施
隔離的運算資源,確保一致的延遲和吞吐量
自訂 SLA
99.9%+ 運行時間保證,附帶財務罰款
優先支援
專屬客戶經理和 1 小時回應時間
自訂速率限制
根據您的需求提供不限量 RPM/TPM
SSO / SAML
為您的組織整合單一登入
批量折扣
為高流量使用提供議定價格

政府採購

RouteFree 符合台灣政府採購資格。我們提供:

  • 統一編號開立發票
  • 政府格式報價單及合約
  • 符合台灣資料常駐要求
  • 支援政府採購招標流程
政府採購
如需企業定價和自訂方案,請訪問聯絡頁面或直接寄信給我們。

Error Codes

RouteFree uses standard HTTP status codes. Error responses follow the OpenAI format:

json
{
  "error": {
    "code": 401,
    "message": "No auth credentials found. Pass an Authorization header.",
    "metadata": {}
  }
}
Code
Name
Description
400Bad RequestMalformed request body or missing required parameters (model, messages)
401UnauthorizedAPI key is missing, invalid, or disabled
402Insufficient CreditsAccount has insufficient credits. Top up at the dashboard.
403ForbiddenAPI key does not have permission for this operation
404Not FoundModel not found or no upstream provider configured
429Too Many RequestsRate limit exceeded. Implement exponential backoff.
500Server ErrorInternal RouteFree error
502Bad GatewayUpstream provider returned an error
503Service UnavailableAll upstream providers are unavailable for this model

Handling Errors

python
from openai import OpenAI, APIError, RateLimitError

client = OpenAI(
    base_url="https://routefree.tw/api/v1",
    api_key="sk-rf-YOUR_API_KEY",
)

try:
    response = client.chat.completions.create(
        model="openai/gpt-4.1",
        messages=[{"role": "user", "content": "Hello!"}],
    )
except RateLimitError:
    print("Rate limited — waiting before retry...")
except APIError as e:
    print(f"API error {e.status_code}: {e.message}")

Rate Limits

Rate limits are applied per API key, measured in requests per minute (RPM) and tokens per minute (TPM).

Plan
RPM
TPM
Notes
Starter10 RPM100K TPMFor development and testing
Business100 RPM1M TPMFor production workloads
EnterpriseCustomUnlimitedNegotiated per use case

When a rate limit is exceeded, you'll receive a 429 response. Implement exponential backoff when retrying.

FAQ

How is RouteFree different from calling OpenAI directly?
RouteFree provides NTD billing, unified invoices (統一發票), Chinese support, and a single API across 30+ models. Access OpenAI, Anthropic, Google, DeepSeek, and more with the same code.
Do I need to change my existing code?
Minimal changes: set base_url to https://routefree.tw/api/v1, use your RouteFree API key (sk-rf-...), and prefix model IDs with the provider name (e.g. openai/gpt-4.1). All other code stays the same.
Does RouteFree store my messages?
No. We do not store message content. We only log token counts, model used, and timestamps for billing purposes. Your conversation data passes through to the upstream provider and is not retained.
Which OpenAI SDK features are supported?
Chat completions, streaming, tool calling, structured output (response_format), and assistant prefill all work. Features are passed through to the upstream provider.
How do I get a unified invoice (統一發票)?
Unified invoices are automatically issued at month-end for Business plan and above. Contact support for immediate issuance.
What payment methods are supported?
Credit cards (Taiwan-issued), bank transfer, and monthly billing (Business plan and above).
Can I use RouteFree with agent frameworks like LangChain or CrewAI?
Yes! Any framework that supports the OpenAI API works with RouteFree. Just set the base URL and use your RouteFree API key. See the Agentic Usage section for examples.