Felo API PlatformFelo API Platform

Felo API (harness)

LLM API

通过 OpenAI-compatible 和 Anthropic-compatible 协议调用 Felo 模型 endpoints。

GET/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 兼容

待开放:Decisions API

此接口尚未在公开 API 开放,请确认可用后再运行示例。

POST https://openapi.felo.ai/api/v1/decisions

向 jev-1.13(也接受 typesafe/jev-1.13)提供上下文和明确的类型化问题。调用 /api/v1/decisions,不能使用 Chat Completions、Messages 或 Responses 入口。不支持流式请求。

请求字段

  • model: jev-1.13
  • state: 待判断的上下文,可以是字符串或 JSON 值。
  • questions: 以名称为键的问题对象,每个问题包含 type、instructions 和 criteria。
import os
import requests

response = requests.post(
    "https://openapi.felo.ai/api/v1/decisions",
    headers={"Authorization": f"Bearer {os.environ['FELO_API_KEY']}"},
    json={
        "model": "jev-1.13",
        "state": "Help! My payouts have been failing for 3 days.",
        "questions": {
            "is_urgent": {
                "type": "noul",
                "instructions": "Does this message convey urgency?",
                "criteria": {"true": "Time-sensitive", "false": "No urgency"},
            },
            "department": {
                "type": "choice",
                "instructions": "Which team should handle this?",
                "criteria": {
                    "billing": "Payments, invoicing, refunds",
                    "technical": "Bugs, outages, integrations",
                    "sales": "Pricing, upgrades, new accounts",
                },
            },
            "frustration": {
                "type": "score",
                "instructions": "How frustrated is the customer?",
                "criteria": ["Calm", "Frustrated", "Very angry"],
            },
        },
    },
    timeout=60,
)
response.raise_for_status()
answers = response.json()["answers"]
print(answers["is_urgent"]["noul"])
print(answers["department"]["choice"], answers["department"]["probabilities"])
print(answers["frustration"]["score"])

返回类型

noul:0 到 1 的概率;choice:选中的选项及概率分布;score:有序标准对应的数值得分及概率分布。

错误使用数值 HTTP 状态码 error.code 和 error.message。读取 answers 前先处理非 2xx 响应。

用量与价格

响应包含 usage.input_tokens、usage.output_tokens,也可能包含 usage.cost。2026-09-22 核对的参考费率:输入每百万 tokens 0.042 美元,输出 0 美元。输出零价不代表输入免费。价格可能更新,估算时以公布的模型价格及账户适用折扣为准。

认证

LLM API 请求需要 Felo API Platform key。可以使用 Authorization: Bearer ... 或 X-API-Key。

Authorization: Bearer YOUR_API_KEY
X-API-Key: YOUR_API_KEY

更多 key 创建和管理方式,请查看 认证指南。

Base URL

https://openapi.felo.ai

Anthropic SDK 请使用 https://openapi.felo.ai/api,因为 SDK 会自动追加 /v1/messages。

通用 Headers

Header必填说明
AuthorizationYes, unless X-API-Key is usedBearer YOUR_API_KEY 格式的 API key
X-API-KeyYes, unless Authorization is usedBearer header 的替代方式
Content-Type是必须是 application/json
X-Request-Id否可选 request ID,便于排查问题

Model Discovery

总目录保留全部模型类型。需要视频或决策模型时,可直接查询对应目录:

接口模型范围
GET /api/v1/models全部类型(保持兼容)
GET /api/v1/videos/models视频生成 (video_generation)
GET /api/v1/decisions/models决策模型,包括 Jev (decisions)

三个接口均支持可选查询参数 provider(如 openrouter),返回 {"object":"list","data":[...]}。每项包含 id、object、created、owned_by 和 model_kind。分类列表使用启用渠道映射覆盖后的最终类型。

列表只返回未删除、已启用、开启展示且具有符合渠道条件的当前价格的模型,价格为 0 也有效。新同步模型默认隐藏,需要管理员开启展示。三个列表共用人工排序,同值按模型名称和 ID 排序。无匹配项返回 HTTP 200 和空 data 数组。查询只读本地目录,不触发模型调用或计费。

仅 GET /api/v1/models 支持 exclude_video_and_decisions(布尔值,默认 false)。设为 true 时按最终类型排除 video_generation 和 decisions,图片模型仍保留。可与 provider 组合;省略或设为 false 时保持完整目录。非法布尔值返回 HTTP 422。

curl "https://openapi.felo.ai/api/v1/models?exclude_video_and_decisions=true&provider=openrouter" \
  -H "Authorization: Bearer ${FELO_API_KEY}"
curl "https://openapi.felo.ai/api/v1/videos/models?provider=openrouter" \
  -H "Authorization: Bearer ${FELO_API_KEY}"
curl "https://openapi.felo.ai/api/v1/decisions/models?provider=openrouter" \
  -H "Authorization: Bearer ${FELO_API_KEY}"

按 model_kind 选择调用入口:chat 使用该模型支持的 Responses、Chat Completions 或 Messages;video_generation 使用 POST /api/v1/videos/generations;decisions 使用 POST /api/v1/decisions;image_generation 使用 POST /api/v1/images/generations。详情仍通过 GET /api/v1/models/{model_id} 查询。列表中的模型并非都能用于对话入口。

模型与价格

价格以 USD 展示。Token rates 按 1M tokens 展示。Web search usage 如果由模型服务返回,则按 $0.01 每次 search 收费。

Model IDContextMax outputInput / 1M tokensOutput / 1M tokensCache read / 1M tokensCache write / 1M tokens
claude-haiku-4-5200K64K$1.00$5.00$0.10$1.25
claude-sonnet-4-61M128K$3.00$15.00$0.30$3.75
claude-opus-4-81M128K$5.00$25.00$0.50$6.25
claude-sonnet-51M128K$2.00$10.00$0.20$2.50
claude-haiku-5-51M128K$0.10$0.50$0.01$0.0125
gpt-5.51.05M128K$5.00$30.00$0.50-
gpt-5.5-pro1.05M128K$30.00$180.00--
gpt-5.6-luna1.05M128K$1.00$6.00$0.10$1.25
gpt-5.6-terra1.05M128K$2.50$15.00$0.25$3.125
gpt-5.6-sol1.05M128K$5.00$30.00$0.50$6.25
grok-4.5500K-$2.00$6.00$0.50-
deepseek-v4-flash1M384K$0.09$0.18$0.018-

Claude Haiku 5.5 采用分档计价:prompt 不超过 100K tokens 时按上表标准费率计费;当单次请求的 prompt 超过 100K tokens 时,整个请求按长上下文费率计费——输入 $0.50、输出 $2.50、缓存读 $0.05、缓存写 $0.0625(每 100 万 tokens)。

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 的价格、上下文长度和最大输出保持不变。

DeepSeek V4 Flash 支持思考和非思考模式、JSON 输出、工具调用、Responses API 和 Anthropic API 兼容性。可通过 Felo 的 Responses、Chat Completions 和 Messages 接口调用;缓存写入价格暂未发布。

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。

Official Documentation