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 | 是 | 必须是 application/json |
X-Request-Id | 否 | 可选 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。