LLM API
LLM API
透過 OpenAI-compatible 和 Anthropic-compatible 協議呼叫 Felo 模型 endpoints。
/api/v1/models認證
Bearer API key or X-API-Key
Content type
application/json
限流說明
Model service limits may apply. Retry with backoff on 429 or 503.
LLM API 透過 Felo API Platform 提供直接模型呼叫 endpoints。適合呼叫通用語言模型、複用 OpenAI-compatible 或 Anthropic-compatible 客戶端,或把 agent framework 接入 Felo API Platform。
LLM API 目前包含三個模型呼叫入口:
POST /api/v1/responses: OpenAI Responses 相容POST /api/v1/chat/completions: OpenAI Chat Completions 相容POST /api/v1/messages: Anthropic Messages 相容
認證
LLM API 請求需要 Felo API Platform key。可以使用 Authorization: Bearer ... 或 X-API-Key。
Authorization: Bearer YOUR_API_KEYX-API-Key: YOUR_API_KEY更多 key 建立和管理方式,請檢視 認證指南。
Base URL
https://openapi.felo.aiAnthropic SDK 請使用 https://openapi.felo.ai/api,因為 SDK 會自動追加 /v1/messages。
通用 Headers
| Header | 必填 | 說明 |
|---|---|---|
Authorization | Yes, unless X-API-Key is used | Bearer YOUR_API_KEY 格式的 API key |
X-API-Key | Yes, unless Authorization is used | Bearer header 的替代方式 |
Content-Type | Yes | 必須是 application/json |
X-Request-Id | No | 可選 request ID,便於排查問題 |
Model Discovery
GET https://openapi.felo.ai/api/v1/models回應遵循 OpenAI-compatible models list shape。請在 Responses、Chat Completions 和 Messages 請求的 model 欄位中使用返回的 model IDs。
模型與價格
價格以 USD 展示。Token rates 按 1M tokens 展示。Web search usage 如果由模型服務返回,則按 $0.01 每次 search 收費。
| Model ID | Context | Max output | Input / 1M tokens | Output / 1M tokens | Cache read / 1M tokens | Cache write / 1M tokens |
|---|---|---|---|---|---|---|
claude-haiku-4-5 | 200K | 64K | $1.00 | $5.00 | $0.10 | $1.25 |
claude-sonnet-4-6 | 1M | 128K | $3.00 | $15.00 | $0.30 | $3.75 |
claude-opus-4-8 | 1M | 128K | $5.00 | $25.00 | $0.50 | $6.25 |
claude-sonnet-5 | 1M | 128K | $2.00 | $10.00 | $0.20 | $2.50 |
gpt-5.5 | 1.05M | 128K | $5.00 | $30.00 | $0.50 | - |
gpt-5.5-pro | 1.05M | 128K | $30.00 | $180.00 | - | - |
gpt-5.6-luna | 1.05M | 128K | $1.00 | $6.00 | $0.10 | $1.25 |
gpt-5.6-terra | 1.05M | 128K | $2.50 | $15.00 | $0.25 | $3.125 |
gpt-5.6-sol | 1.05M | 128K | $5.00 | $30.00 | $0.50 | $6.25 |
grok-4.5 | 500K | - | $2.00 | $6.00 | $0.50 | - |
GPT-5.6 提供三個檔位:Luna 適合快速、低成本工作負載;Terra 適合均衡的 coding、推理和 agentic 任務;Sol 適合旗艦級複雜推理和 coding。每個檔位也提供 -pro 模型 ID(gpt-5.6-luna-pro、gpt-5.6-terra-pro 和 gpt-5.6-sol-pro),使用相同底層模型並開啟 pro reasoning mode。-pro ID 的價格、上下文長度和最大輸出保持不變。
Basic Usage
export FELO_API_KEY="YOUR_API_KEY"import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env.FELO_API_KEY,
baseURL: "https://openapi.felo.ai/api",
});
const message = await client.messages.create({
model: "claude-sonnet-4-6",
max_tokens: 128,
messages: [{ role: "user", content: "Summarize direct model APIs in one sentence." }],
});Protocol Reference
回應s
POST https://openapi.felo.ai/api/v1/responses常用欄位:model、input、instructions、stream、temperature、max_output_tokens。
Chat Completions
POST https://openapi.felo.ai/api/v1/chat/completions適合 OpenAI-compatible chat clients。常用欄位包括 model、messages、stream、temperature、max_tokens、tools 和 response_format。
Messages
POST https://openapi.felo.ai/api/v1/messages適合 Anthropic-compatible clients 和 Claude Code。常用欄位包括 model、messages、max_tokens、stream 和 tools。