Yielding Bear — Unified LLM Routing API
Yielding Bear provides a single unified API that routes every LLM request to the cheapest capable model across 16+ providers — saving 60-80% vs calling OpenAI, Anthropic, or Google directly.
Setup (First Time Only)
- 1. Get an API key at https://yieldingbear.com/api
- 2. Set environment variable:
CODEBLOCK0
- 3. Save to your shell profile (optional):
CODEBLOCK1
Quick Start — OpenClaw Agents
Method 1: Direct API calls
CODEBLOCK2
Method 2: OpenAI-compatible drop-in replacement
CODEBLOCK3
Model Routing
| Task Type | Routes To | Cost/1M |
|---|
| Summaries, classification | Llama 3.1 8B | $0.04 |
| Email drafting, formatting |
DeepSeek V3 | $0.07 |
| General chat, code | GPT-4o-mini | $0.15 |
| Complex reasoning | YB Sentinel 70B | $0.06 |
| Fast completions | Gemini 2.0 Flash | $0.10 |
Override routing:
CODEBLOCK4
OpenClaw Agent Integration
For OpenClaw sub-agents
Set in environment before spawning:
CODEBLOCK5
The agent uses YB automatically when calling OpenAI-compatible endpoints.
For custom tools and scripts
CODEBLOCK6
Cost Comparison
| Task | Direct OpenAI | Via YB | Savings |
|---|
| 1M simple summaries | $150 | $40 | 73% |
| 1M email drafts |
$300 | $60 | 80% |
| 1M chat completions | $500 | $150 | 70% |
| 1M reasoning tasks | $3,000 | $300 | 90% |
Key Links
- - API Docs: https://yieldingbear.com/developers
- Yields page: https://yieldingbear.com/yields
- How it works: https://yieldingbear.com/how-it-works
- Dashboard: https://yieldingbear.com/dashboard
- Get API key: https://yieldingbear.com/api
Yielding Bear — 统一LLM路由API
Yielding Bear提供单一统一API,可将每个LLM请求路由至16+提供商中最具性价比的模型——相比直接调用OpenAI、Anthropic或Google,可节省60-80%成本。
设置(仅首次使用)
- 1. 获取API密钥:访问 https://yieldingbear.com/api
- 2. 设置环境变量:
bash
export YIELDINGBEAR
APIKEY=yb
liveyour
keyhere
- 3. 保存至Shell配置文件(可选):
bash
echo export YIELDINGBEAR
APIKEY=yb
liveyour
keyhere >> ~/.zshrc
source ~/.zshrc
快速入门 — OpenClaw代理
方法1:直接API调用
bash
curl -X POST https://api.yieldingbear.com/v1/chat/completions \
-H Authorization: Bearer $YIELDINGBEARAPIKEY \
-H Content-Type: application/json \
-d {
model: auto,
messages: [{role: user, content: 总结此邮件:...}],
max_tokens: 500
}
方法2:OpenAI兼容即插即用
python
from openai import OpenAI
client = OpenAI(
apikey=ybliveyourkey,
base_url=https://api.yieldingbear.com/v1
)
相同SDK。相同代码。成本降低60-80%。
模型路由
| 任务类型 | 路由至 | 成本/百万token |
|---|
| 摘要、分类 | Llama 3.1 8B | $0.04 |
| 邮件起草、格式化 |
DeepSeek V3 | $0.07 |
| 通用聊天、代码 | GPT-4o-mini | $0.15 |
| 复杂推理 | YB Sentinel 70B | $0.06 |
| 快速补全 | Gemini 2.0 Flash | $0.10 |
覆盖路由:
json
{ model: claude-3.5-haiku, routing: { capabilities: [reasoning] } }
OpenClaw代理集成
针对OpenClaw子代理
在生成前设置环境变量:
bash
export YIELDINGBEARAPIKEY=yblive...
代理在调用OpenAI兼容端点时会自动使用YB。
针对自定义工具和脚本
bash
RESULT=$(curl -s -X POST https://api.yieldingbear.com/v1/chat/completions \
-H Authorization: Bearer $YIELDINGBEARAPIKEY \
-H Content-Type: application/json \
-d {model:auto,messages:[{role:user,content:分析:$1}]})
echo $RESULT
成本对比
| 任务 | 直接OpenAI | 通过YB | 节省 |
|---|
| 100万次简单摘要 | $150 | $40 | 73% |
| 100万次邮件草稿 |
$300 | $60 | 80% |
| 100万次聊天补全 | $500 | $150 | 70% |
| 100万次推理任务 | $3,000 | $300 | 90% |
关键链接
- - API文档:https://yieldingbear.com/developers
- 收益页面:https://yieldingbear.com/yields
- 工作原理:https://yieldingbear.com/how-it-works
- 控制面板:https://yieldingbear.com/dashboard
- 获取API密钥:https://yieldingbear.com/api