One API Key.
91 LLMs.
One OpenAI-compatible endpoint. Anthropic, OpenAI, Meta, Google, xAI, and the rest of the live catalog — same base URL, same SDK.
Low Latency Rails
Groq and other fast providers when the call is time-sensitive. Billed on the model you actually hit.
Auto Routing
On Max, Grizzly picks a lean rail first and only spends premium when the step needs it.
One API Key
Change model id in the request body. Keep the same base URL and client.
Quick Start
# OpenClaw plugin (requires OpenClaw installed and Node 22.22.3+)
openclaw plugins install clawhub:@yieldingbear/yieldingbear --accept-capabilities
openclaw plugins enable yieldingbear
openclaw gateway restart
# or: runtime installer (writes base_url + key for Hermes/OpenClaw)
curl -fsSL https://yieldingbear.com/install.sh | bash
# Then in any Node script (the SDK is vendored at ~/.yieldingbear/yieldingbear.mjs):
import { YieldingBear } from 'yieldingbear.mjs';
const client = await YieldingBear.fromKeyFile(); // hermes → openclaw → ~/.yieldingbear secrets
const chat = await client.chat.completions.create({
model: 'yieldingbear/grizzly-max', // smart router — or pin any specific model
messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(chat.choices[0].message.content);
console.log('cost: $' + client.cost(chat).toFixed(6));Notes:
- Prereqs: OpenClaw installed, Node 22.22.3+.
- Plugin is hooks-only: it registers a before_model_resolve hook. It does not write
base_urland does not prompt for a key. - Set your key: export
YIELDINGBEAR_API_KEY. Doctor may still ask forOPENAI_API_KEYuntil your SDK points athttps://yieldingbear.com/api/v1(or useinstall.shwhich writes runtime vars).
Supported Providers
Groq
Low-latency inference when speed is the constraint.
OpenAI
GPT-4o, GPT-4o-mini, o1, o3 — the models most SDKs already speak.
Anthropic
Claude Sonnet and friends for harder reasoning steps.
Gemini Flash/Pro for mid-tier and multimodal work.
DeepSeek
DeepSeek V3 and R1 — strong open-weight options.
xAI
Grok models when you want that stack on the same key.
Meta
Llama 3.x open-weight models.
Together
Hosted variants and fine-tune surfaces.
Introduction
Yielding Bear exposes 91 models on one OpenAI-compatible endpoint. Point your client at the base URL below — same request shape you already use.
With Max, Auto prefers a cheap rail for routine steps and only spends premium when the step needs it. Pin a model id anytime you want a fixed choice. Either way is the same endpoint.
Two modes: set model to a catalog id, or use yieldingbear/grizzly-max for Auto.
Base URL
https://yieldingbear.com/api/v1Pin a Model
You pick the exact id — useful when a step must stay on one vendor.
model: "openai/gpt-4o"Auto (Max)
Grizzly picks the rail. Needs Max or credits — not free pin-only.
model: "yieldingbear/grizzly-max"Note: The OpenAI-compatible data[] list from GET /api/v1/models does not include is_free. Free flags live in the sidecar yieldingbear.data[] and in GET /api/v1/pricing router tiers.
Authentication
All API requests require an API key passed as a Bearer token in the Authorization header. Get your API key from the dashboard.
Authorization: Bearer yb_live_sk_...xxxxxxxxxxxxxxxxxxxxxxxx
API Key Format
Keys use yb_live_sk_ (legacy grizzly_live_sk_ and yb_test_sk_ are still accepted). Example: yb_live_sk_…. Get yours from the dashboard.
Key Security
Keys are hashed with SHA-256 before storage. The raw key is only shown once at creation — store it securely in environment variables or a secrets manager.
Never expose your key
Do not commit API keys to version control. Use environment variables (.env files) and rotate keys regularly from the dashboard.
export YIELDINGBEAR_API_KEY= # YB_API_KEY also accepted export YIELDINGBEAR_API_KEY="yb_live_sk_aaf1ccf8b34ebda1c52d..." # Verify your key works curl https://yieldingbear.com/api/v1/usage \ -H "Authorization: Bearer $YIELDINGBEAR_API_KEY"
Chat Completions
The Chat Completions endpoint is universally compatible. Send a POST request with messages and receive a structured response. Works with any LLM SDK, including the OpenAI SDKs.
Endpoint
POST /api/v1/chat/completions
Request Body
{
"model": "groq/llama-3.1-8b-instant",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "What is the capital of France?" }
],
"temperature": 0.7,
"max_tokens": 256,
"stream": false
}cURL Example
curl -X POST https://yieldingbear.com/api/v1/chat/completions \
-H "Authorization: Bearer $YIELDINGBEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "groq/llama-3.1-8b-instant",
"messages": [{"role": "user", "content": "Hello!"}]
}'Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| model | string | — | Model identifier (e.g. groq/llama-3.1-8b-instant) |
| messages | array | — | Array of message objects with role and content |
| temperature | float | 0.7 | Sampling temperature (0–2). Lower = more deterministic. |
| max_tokens | int | 256 | Maximum tokens to generate |
| stream | bool | false | Enable streaming responses (SSE) |
| top_p | float | 1.0 | Nucleus sampling threshold |
| frequency_penalty | float | 0 | Penalty for token frequency (-2 to 2) |
| presence_penalty | float | 0 | Penalty for token presence (-2 to 2) |
Response Format
{
"id": "chatcmpl-3552055b-e963-4907-a077-d76f5a1019e7",
"object": "chat.completion",
"created": 1781641651,
"model": "groq/llama-3.1-8b-instant",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "The capital of France is Paris."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 36,
"completion_tokens": 24,
"total_tokens": 36
},
"cost_usd": 0.000017,
"balance_remaining_usd": 4.9911
}Response Format — Grizzly Maxrouting field
When you call any yieldingbear/grizzly-max* virtual model, the response gets an extra top-level routing object describing the decision, plus matching x-yb-routing-* headers. Use this to log/audit which underlying model actually served the request and to debug forced overrides.
{
"id": "chatcmpl-3552055b-e963-4907-a077-d76f5a1019e7",
"object": "chat.completion",
"created": 1781641651,
"model": "groq/llama-3-3-70b-versatile", ← actual underlying model that served the request
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "It's nice to meet you. Is there something I can help you with, or would you like to chat?"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 36,
"completion_tokens": 24,
"total_tokens": 36
},
"cost_usd": 0.000017,
"balance_remaining_usd": 4.9911,
"routing": {
"category": "general", ← which specialist was called
"intent": "text", ← text or image
"tier": "low", ← low = efficient, high = powerful
"routed_to": "groq/llama-3-3-70b-versatile", ← resolved underlying model
"reason": "general:no-high-signals;default-low", ← why this tier was picked
"explicit": false ← true if user forced tier/force via header or body
}
}Same yieldingbear/grizzly-max call, but with a hard-refactor prompt that triggered the high tier:
{
"id": "chatcmpl-R1p2pOLmD2huJgdFQLrm0BCd",
"model": "see live catalog", ← swapped to the pin a $0 catalog model
...
"routing": {
"category": "coding",
"intent": "text",
"tier": "high",
"routed_to": "see live catalog",
"reason": "cat=coding, kw:\"refactor\"",
"explicit": false
}
}Headers (every Grizzly request):
x-yb-routing-category— generalx-yb-routing-intent— text | imagex-yb-routing-tier— low | highx-yb-routing-target— the resolved underlying model idx-yb-routing-reason— human-readable reason (truncated to 200 chars)
Grizzly Max Examples
Call the Grizzly Auto router (or pin any live catalog model id). The router classifies the prompt and picks the most efficient underlying model — paying nothing extra on top of the routed model's per-Mtok rate. Same endpoint, same auth, same response shape as Chat Completions. Returns an extra routing field so you can see what was picked.
▸ yieldingbear/grizzly-max — Auto router (example)
Easy chat → efficient fast models. Hard reasoning → Claude Sonnet.
curl https://yieldingbear.com/api/v1/chat/completions \
-H "Authorization: Bearer $YIELDINGBEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "yieldingbear/grizzly-max",
"messages": [
{ "role": "user", "content": "Write a haiku about coding" }
]
}'▸ Example: coding prompt (same Auto model)
Snippets → fast models. Real refactors → qwen3-coder / frontier coding models.
curl https://yieldingbear.com/api/v1/chat/completions \
-H "Authorization: Bearer $YIELDINGBEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "yieldingbear/grizzly-max",
"messages": [
{ "role": "user", "content": "Refactor this Python function to use async/await:\n\ndef fetch_all(urls):\n return [requests.get(u).json() for u in urls]" }
]
}'▸ Example: copywriting (same Auto model)
Short copy → fast models. Long-form → Claude Sonnet.
Note: Images use a separate POST /api/v1/images endpoint (GET returns 405). Image prompts via this chat router return a 404 today.
curl https://yieldingbear.com/api/v1/chat/completions \
-H "Authorization: Bearer $YIELDINGBEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "yieldingbear/grizzly-max",
"messages": [
{ "role": "user", "content": "Write a 3-sentence product description for a bear-themed energy drink" }
]
}'▸ Example: research (same Auto model)
Simple Q&A → DeepSeek V3. Real forecasts → deepseek-reasoner. Live data with citations → perplexity/sonar-pro.
curl https://yieldingbear.com/api/v1/chat/completions \
-H "Authorization: Bearer $YIELDINGBEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "yieldingbear/grizzly-max",
"messages": [
{ "role": "user", "content": "What is the current price of NVDA and what is its 50-day moving average?" }
]
}'Tip: The Auto router supports "stream": true for SSE streaming, tools/function calling, and JSON mode. Pricing is whatever the routed underlying model charges — there's no Grizzly markup. See /api/v1/pricing for the current blended rates.
Embeddings
Generate text embeddings through a single endpoint. Output is an OpenAI-shaped vector array you can drop into any vector DB (Pinecone, Supabase pgvector, Weaviate, etc.). Use the response data[].embedding field — no parsing needed.
Endpoint
POST /api/v1/embeddings
Request Body
{
"model": "deepinfra/bge-base-en-v1.5",
"input": "The food was delicious and the service was excellent."
}curl -X POST https://yieldingbear.com/api/v1/embeddings \
-H "Authorization: Bearer $YIELDINGBEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepinfra/bge-base-en-v1.5",
"input": "The food was delicious and the service was excellent."
}'Response (truncated)
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [0.0107, 0.0557, 0.0270, ...768 floats total]
}
],
"model": "deepinfra/bge-base-en-v1.5",
"usage": { "prompt_tokens": 4, "total_tokens": 4 },
"cost_usd": 0,
"balance_remaining_usd": 4.99
}Available Embedding Models
deepinfra/bge-base-en-v1.5More embedding models are on the roadmap. Call GET /api/v1/models to see the live catalog.
Models
List all available models. This endpoint is public and does not require authentication. Use it to discover models and check their current pricing.
GET /api/v1/models
curl https://yieldingbear.com/api/v1/models
Popular Models by Category
Run GET /api/v1/models for the full live catalog (91 models).
Rate Limiting
Rate limits protect the API from abuse and ensure fair access. Limits are applied per API key and vary by tier.
Free Tier
Paid Tier
429 Response
When you exceed your tier's RPM, the API returns HTTP 429 with a JSON body. The standard Retry-After HTTP header is included (in seconds).
{
"error": {
"message": "Rate limit exceeded: 60 requests per minute",
"type": "rate_limit_exceeded",
"code": "rate_limit_exceeded"
}
}Best Practices
- • Implement exponential backoff with jitter for 429 responses
- • Cache responses where appropriate to reduce API calls
- • Use streaming for large responses to improve perceived latency
- • Contact support for higher rate limits on paid tiers
Streaming
Enable streaming to receive tokens as they are generated. This reduces perceived latency for long responses. Use the stream: true parameter.
Streaming Request
{
"model": "groq/llama-3.1-8b-instant",
"messages": [{"role": "user", "content": "Write a haiku about coding"}],
"stream": true
}Streaming Response (SSE)
data: {"id":"chatcmpl-e96f1581-d9bb-46c9-8f9c-68b27e45a717","choices":[{"finish_reason":null,"index":0,"delta":{"function_call":null,"tool_calls":null,"content":"Lines","role":"assistant"}}],"created":1781641928,"model":"llama-3.1-8b-instant","object":"chat.completion.chunk","system_fingerprint":"fp_e2c608b1d6","usage":{}}
data: {"id":"chatcmpl-e96f1581-d9bb-46c9-8f9c-68b27e45a717","choices":[{"finish_reason":null,"index":0,"delta":{"function_call":null,"tool_calls":null,"content":" of"}}],"created":1781641928,"model":"llama-3.1-8b-instant","object":"chat.completion.chunk","system_fingerprint":"fp_e2c608b1d6","usage":{}}
data: {"id":"chatcmpl-e96f1581-d9bb-46c9-8f9c-68b27e45a717","choices":[{"finish_reason":"stop","index":0,"delta":{"content":null}}],"created":1781641928,"model":"llama-3.1-8b-instant","object":"chat.completion.chunk","system_fingerprint":null,"usage":{}}
data: [DONE]Python Streaming Example
import sys
import os
sys.path.insert(0, os.path.expanduser("~/.yieldingbear"))
from yieldingbear import YieldingBear
client = YieldingBear.from_key_file() # picks up ~/.hermes/secrets/yieldingbear-token
for chunk in client.chat.completions.stream(
model="nvidia/nemotron-3.5-lightning", # or yieldingbear/grizzly-max Auto router
messages=[{"role": "user", "content": "Hello!"}],
):
if chunk.delta: # chunk.delta is a str of the new text
print(chunk.delta, end="", flush=True)Usage & Costs
Every chat response includes cost_usd and balance_remaining_usd. For an aggregated view (totals, per-model breakdown, recent requests), call GET /api/v1/usage with your API key.
Endpoint
GET /api/v1/usage
curl https://yieldingbear.com/api/v1/usage \ -H "Authorization: Bearer $YIELDINGBEAR_API_KEY"
Response (truncated)
{
"account": { "email": "you@example.com", "credit_balance_usd": 4.99 },
"totals": {
"cost_usd": 0.000452,
"prompt_tokens": 1359,
"completion_tokens": 1020,
"total_tokens": 2379,
"calls": 50
},
"by_model": [
{ "model": "yieldingbear/grizzly-max", "calls": 3, "tokens": 157, "cost_usd": 0.000031 },
{ "model": "anthropic/claude-3-5-sonnet-latest", "calls": 2, "tokens": 34, "cost_usd": 0.000306 }
],
"usage": [
{
"id": "edfcb790-d59e-4f51-b543-f45bf39bb3e9",
"model": "groq/llama-3.1-8b-instant",
"provider": "groq",
"input_tokens": 36,
"output_tokens": 8,
"total_tokens": 44,
"cost_usd": 0,
"latency_ms": 137,
"created_at": "2026-06-16T20:27:16.396812+00:00"
}
]
}Error Handling
The API follows OpenAI's error format. All errors return a JSON body with a top-level error object. Always check for errors in your response handling.
{
"error": {
"message": "Invalid API key",
"type": "invalid_request_error",
"code": "authentication_error",
"param": null,
"status": 401
}
}| Status | Code | Description |
|---|---|---|
| 400 | invalid_request | Malformed request body or missing required fields |
| 401 | authentication_error | Invalid or missing API key |
| 402 | insufficient_credits | Not enough credits for this request |
| 403 | model_not_allowed | Model requires a higher tier or is disabled |
| 422 | invalid_parameter | Parameter value is invalid (e.g., temperature > 2) |
| 429 | rate_limit_exceeded | Too many requests. Check X-RateLimit-Reset header |
| 500 | server_error | Internal server error. Retry with exponential backoff |
| 502 | upstream_error | LLM provider returned an error. Try a different model |
| 503 | service_unavailable | Service temporarily unavailable. Try again shortly |
Billing & Credits
Free: unlimited calls on the low-tier free model (nvidia/nemotron-3.5-lightning). Credits or Max open the rest of the catalog (OpenAI, Anthropic, Google, DeepSeek, Mistral, Groq, xAI, …) at a small markup over provider rates.
Free
Best for starters$0 / monthModels: Grizzly low-tier free model (see /api/v1/pricing)
Access: Unlimited requests
Paid
Most popularPay-as-you-goModels: All providers (91 models)
Access: Credits-based, min $10 deposit
Enterprise
For teamsCustom pricingModels: Custom routing, dedicated support
Access: Volume discounts, SLA
Sample Pricing (Paid Tier)
Blended rate = what the routed underlying model costs on average. For exact per-tier rates, see /api/v1/pricing.
SDKs & Libraries
Start with the native Yielding Bear SDK — zero dependencies, vendored by the installer. Every other LLM SDK works too: just point its base_url at https://yieldingbear.com/api/v1.
Yielding Bear SDK
Zero dependencies. Vendored to ~/.yieldingbear/lib/ by the installer.
Frequently Asked Questions
One API in front of 91+ models. Routine steps hit efficient fast models; hard reasoning hits frontier only when needed. Spend lands on outcomes, not overkill.
No. One API key from Yielding Bear connects you to all providers. We handle provider credentials, rate limits, retries, and failover automatically.
Integrate Any Model — any LLM SDK that points to an OpenAI-style base URL is supported out of the box, including the OpenAI, Anthropic, Google GenAI, Mistral, and Cohere SDKs. Just change the base URL to https://yieldingbear.com/api/v1 and add your Yielding Bear API key — everything else works the same.
Yielding Bear automatically retries on an alternative provider. Configure fallback chains in the dashboard or let our routing engine handle it automatically.
Fine-tuning is not currently exposed through the public API. Contact us for enterprise fine-tuning partnerships.
Call GET /api/v1/usage with your API key to get totals + per-model breakdowns in JSON, or use the dashboard for charts and credit top-ups.
Yes. The API is production-ready with 99.9% SLA only where contracted in writing (Enterprise FDE). Free tier is best for development and testing.