One API Key.
98 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: 'nvidia/nemotron-3.5-lightning',
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, o3 — the models most SDKs already speak.
Anthropic
Claude Sonnet 4.6 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 98 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 live catalog id (for example groq/llama-3.1-8b-instant), or pin the $0 rail nvidia/nemotron-3.5-lightning.
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"$0 rail
Free pin. Max Auto still returns a routing object whose routed_to is a catalog id.
model: "nvidia/nemotron-3.5-lightning"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 grizzly_live_sk_...
API Key Format
New keys use grizzly_live_sk_. Legacy yb_live_sk_ and yb_test_sk_ keys still work. Example: grizzly_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="grizzly_live_sk_..." # 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 Max Auto routes a call, the response gets an extra top-level routing object plus matching x-yb-routing-* headers. model and routed_to are live catalog ids. Use this to log/audit which underlying model actually served the request.
{
"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 Auto call, but with a hard-refactor prompt that triggered the high-tier catalog pin:
{
"id": "chatcmpl-R1p2pOLmD2huJgdFQLrm0BCd",
"model": "anthropic/claude-sonnet-4.6", ← high-tier catalog pin
...
"routing": {
"category": "coding",
"intent": "text",
"tier": "high",
"routed_to": "anthropic/claude-sonnet-4.6",
"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
Pin any live catalog model id. Same endpoint, same auth, same response shape as Chat Completions. When Max Auto is on, the response includes a routing field whose routed_to is also a catalog id.
▸ nvidia/nemotron-3.5-lightning — $0 rail
Easy chat uses groq/llama-3.1-8b-instant. Hard reasoning uses anthropic/claude-sonnet-4.6.
curl https://yieldingbear.com/api/v1/chat/completions \
-H "Authorization: Bearer $YIELDINGBEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nvidia/nemotron-3.5-lightning",
"messages": [
{ "role": "user", "content": "Write a haiku about coding" }
]
}'▸ Example: coding prompt (qwen/qwen3-coder)
Snippets use groq/llama-3.1-8b-instant. Real refactors use qwen/qwen3-coder.
curl https://yieldingbear.com/api/v1/chat/completions \
-H "Authorization: Bearer $YIELDINGBEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen/qwen3-coder",
"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 (groq/llama-3.3-70b-versatile)
Short copy uses groq/llama-3.1-8b-instant. Long-form uses anthropic/claude-sonnet-4.6.
curl https://yieldingbear.com/api/v1/chat/completions \
-H "Authorization: Bearer $YIELDINGBEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "groq/llama-3.3-70b-versatile",
"messages": [
{ "role": "user", "content": "Write a 3-sentence product description for a bear-themed energy drink" }
]
}'▸ Example: research (perplexity/sonar-pro)
Simple Q&A uses deepseek/deepseek-v3.2. Forecasts use deepseek/deepseek-reasoner. Live citations use perplexity/sonar-pro.
curl https://yieldingbear.com/api/v1/chat/completions \
-H "Authorization: Bearer $YIELDINGBEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "perplexity/sonar-pro",
"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 (98 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":"groq/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":"groq/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":"groq/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",
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": "nvidia/nemotron-3.5-lightning", "calls": 3, "tokens": 157, "cost_usd": 0.000031 },
{ "model": "anthropic/claude-sonnet-4.6", "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 (98 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 98+ 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.