Documentation
Everything about the rbug provider API — endpoints, limits, errors, pricing and SDK setup. No hidden details: every cap and behavior is documented below.
Overview
rbug provider is an AI gateway behind one API key. It exposes
OpenAI-compatible and Anthropic-compatible endpoints and routes
requests to a catalogue of 40+ models, with 500,000 free output tokens on every account and pay-as-you-go billing after that.
Point any OpenAI or Anthropic SDK at https://rbug.tech/api/v1 and it works.
- Streaming (SSE), system prompts, tool calling and reasoning fields are supported (model-dependent).
- An API key + a
base_urlswap is all most apps need. - A built-in chat playground lives in the console.
Quickstart
- Sign in with Google or email.
- Open Console → API keys and create a key (starts with
rbp-). - Make your first request:
# curl
curl https://rbug.tech/api/v1/chat/completions \
-H "Authorization: Bearer rbp-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash",
"messages": [{"role": "user", "content": "Hello!"}]
}'
# Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(base_url="https://rbug.tech/api/v1", api_key="rbp-your-key")
reply = client.chat.completions.create(
model="deepseek-v4.1-flash",
messages=[{"role": "user", "content": "Hello!"}],
)
print(reply.choices[0].message.content)
// Node.js (openai package)
const client = new OpenAI({ baseURL: "https://rbug.tech/api/v1", apiKey: "rbp-your-key" });
const reply = await client.chat.completions.create({ model: "deepseek-v4.1-flash", messages: [{ role: "user", content: "Hello!" }] });
Authentication
Send your key either way — both are accepted:
Authorization: Bearer rbp-your-key
# or
x-api-key: rbp-your-key
- Keys are created, rotated and revoked in Console → API keys. Only a hash is stored server-side; the full key is shown once at creation.
GET /v1/modelsandGET /v1/models/{id}are public — no key needed, so SDKs can discover models.- All chat endpoints require a valid key. Invalid keys return
401withinvalid_api_key.
List models
GET/v1/modelspublic
Returns an OpenAI-style list object. 40+ models at the time of writing (upstreams rotate models, so always check live).
curl https://rbug.tech/api/v1/models
{
"object": "list",
"data": [
{ "id": "deepseek-v4.1-flash", "object": "model", "owned_by": "workbuddy", "free": true },
...
]
}
GET/v1/models/{id}public
Returns a single model object, or 404 model_not_found.
Chat completions
POST/v1/chat/completions
Standard OpenAI chat completions schema. Supported fields:
| Field | Notes |
|---|---|
model | Required. Any id from GET /v1/models. |
messages | Required. System / user / assistant roles. |
stream | true for SSE chunks ending with data: [DONE]. |
max_tokens | Clamped to 32–4096. Default 2048. |
temperature, top_p | Passed through to the model. |
tools / tool_choice | Forwarded where the model supports tool calling. |
Non-streaming responses are complete chat.completion objects with a usage block
(prompt_tokens, completion_tokens, total_tokens) and a unique id.
# Streaming
curl https://rbug.tech/api/v1/chat/completions \
-H "Authorization: Bearer rbp-your-key" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v4.1-flash","stream":true,"messages":[{"role":"user","content":"Hello"}]}'
data: {"object":"chat.completion.chunk","model":"deepseek-v4.1-flash","choices":[{"index":0,"delta":{"content":"Hi"}}]}
...
data: [DONE]
Legacy completions
POST/v1/completions
For older tools and SDKs that still use the text-completions API (SillyTavern, legacy libraries). The
prompt is converted into a chat message and the reply is returned in the classic
text_completion shape — streaming included (data: chunks + [DONE]).
A base-URL health check is also available: GET /v1 returns a small info object listing all endpoints.
Anthropic messages
POST/v1/messages
Anthropic-compatible endpoint for the Anthropic SDK and tools like Claude Code. Supports system,
max_tokens, stream and returns Anthropic-shaped responses (type: "message",
content blocks, usage.input_tokens/output_tokens).
export ANTHROPIC_BASE_URL=https://rbug.tech/api/v1
export ANTHROPIC_API_KEY=rbp-your-key
# any Anthropic SDK or Claude-compatible tool now routes through rbug
# (both https://rbug.tech/api and https://rbug.tech/api/v1 work - the gateway
# normalizes the duplicated /v1 that SDKs append)
Verified with the official Anthropic SDK: messages.create, streaming (messages.stream) and system prompts all work.
Count tokens
POST/v1/messages/count_tokens
Returns an estimated token count for the request:
{ "input_tokens": 7 }
Estimation is character-based (~4 characters per token). Treat it as an approximation, not an exact tokenizer.
Limits
Every limit, stated plainly:
| Limit | Free accounts | With credit balance |
|---|---|---|
| Output tokens, lifetime | 500,000 free, then billed from credit | Billed from balance |
| Request body | Up to 32MB per request. The API forwards your full conversation (no trimming); the console chat sends only the newest ~72,000 characters | |
| API requests | 60/min, 4 parallel | 300/min, 8 parallel |
| Console chat | 20/min, 2 parallel | 100/min, 6 parallel |
| Shared-pool models | 20–30 requests/day per model group → model_daily_limit_reached | No daily cap |
- Global concurrency: the server serves up to 25 chats at once across all users; beyond that you get
503 server_busy— retry in a few seconds. - Input size: API requests are forwarded without trimming — the only limits are the 32MB request body and the model's own context window. The console chat sends only the newest ~72,000 characters of conversation.
- Context window:
GET /v1/modelsreports acontext_lengthfor every model — at least 1,000,000 tokens, and larger where the model truly supports it (for exampleauto-freeat 2,000,000). Because requests are forwarded untrimmed, the practical ceiling is the upstream model's own window; a request past it comes back as anupstream_error. - Output size:
max_tokensis clamped to 32–4096. - Best-effort upstreams: the free models run on shared capacity. Occasional
502,504or429under load is normal — retry or switch model.
Errors
Errors use the OpenAI error shape: { "error": { "message": "...", "type": "...", "code": "..." } }.
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request_error | Malformed JSON or missing fields. |
| 401 | invalid_api_key | Missing or invalid key. |
| 402 | free_limit_reached | The 500K free output-token allowance is used and your credit balance is empty. Top up to continue. |
| 404 | model_not_found | Unknown model id (see GET /v1/models). |
| 429 | rate_limited / rate_limit_exceeded | Per-minute or per-model daily cap reached. |
| 429 | model_daily_limit_reached | Daily cap for a shared-pool model; try another model. |
| 502 | upstream_error | The upstream model failed or rejected the request; retry. |
| 503 | server_busy | Global concurrency limit; retry in a few seconds. |
| 504 | queue_timeout | Community model queue too long; try again later. |
Pricing & credits
- Every account includes 500,000 free output tokens — no card, no signup friction.
- After the free allowance, usage is billed from your credit balance at $0.165 per 1M input tokens and $0.66 per 1M output tokens. Fractions of a cent are accumulated and whole cents are deducted as you go.
- With a positive balance you also get the raised rate limits shown above. When the balance reaches zero, requests return
402 free_limit_reacheduntil you top up. - Top-ups are crypto-only: USDT (Tron network), BTC, LTC, ETH — shown on the Credits page with the exact addresses. Orders are reviewed and credited manually after confirmation.
- No subscriptions, no auto-billing, no expiration on credit.
Console & chat
The console contains:
- Chat — a full ChatGPT-style playground: multiple conversations with search and rename, edit & resend, regeneration history (◀ 2/3 ▶), thumbs feedback, export as Markdown, voice input (where the browser supports it), keyboard shortcuts (
Ctrl/Cmd+Knew chat,/focus input,Escstop). The+menu enables look-up tools: web search, Wikipedia and GitHub — these only fetch public pages (600 KB text cap, no code execution). - API keys — create, list and revoke
rbp-keys. - Credits — deposit addresses and payment status.
- Usage — output-token counter against your allowance.
- Orders — credit top-up history.
- Support — contact the team.
SDK setup
OpenAI SDKs
# Python
client = OpenAI(base_url="https://rbug.tech/api/v1", api_key="rbp-your-key")
// JavaScript
const client = new OpenAI({ baseURL: "https://rbug.tech/api/v1", apiKey: "rbp-your-key" });
Anthropic SDK / Claude Code
export ANTHROPIC_BASE_URL=https://rbug.tech/api/v1
export ANTHROPIC_API_KEY=rbp-your-key
opencode (CLI)
Add to ~/.config/opencode/opencode.jsonc (set model to a tool-capable model — opencode needs function calling):
{
"$schema": "https://opencode.ai/config.json",
"model": "rbug/deepseek-v4.1-flash",
"provider": {
"rbug": {
"npm": "@ai-sdk/openai-compatible",
"name": "rbug provider",
"options": { "baseURL": "https://rbug.tech/api/v1" },
"models": {
"deepseek-v4.1-flash": { "name": "DeepSeek V4.1 Flash" },
"north-mini-code": { "name": "North Mini Code" },
"GLM-5.3-Flash": { "name": "GLM-5.3 Flash" }
}
}
}
}
Then run opencode auth login → Other → provider id rbug → paste your key, and restart opencode. Verified with the same ai SDK opencode uses: generateText, streamText and multi-step tool calls all pass.
Data & privacy
- Message content is not stored server-side. API requests are proxied in memory; the console chat is saved in your browser's local storage.
- We store: your account (name/email from sign-in), hashed API keys, and per-account usage counters (token totals) used for the free-tier limit.
- Requests are forwarded to the model hosts that serve each model, under their own policies.
- Keys are shown once at creation and stored only as SHA-256 hashes.
FAQ
Is it really free?
Yes — every listed model is free for your first 500,000 output tokens. After that, usage is billed from your credit balance at $0.165/1M input and $0.66/1M output tokens; a positive balance also raises your rate limits.
Why did a request fail with 429/502/504?
Free models run on shared capacity. 429 means a rate or daily cap; 502/504 mean the upstream was briefly unavailable or queued. Retry, or pick another model — the catalogue has 40+.
Do tool calls / function calling work?
Yes — on these models (verified live with the OpenAI SDK): big-pickle, deepseek-v4.1-flash, hy3, hy4-preview-f, GLM-5.3-Flash, gpt-oss-120b, Qwen3.5-397B-A17B, nemotron-3-super-120b, north-mini-code, laguna-s-2.1, free-router.
Some chat-first models (MiMo, Step, LongCat, Space Bunny) reply with text instead of tool calls. Tools are forwarded in the OpenAI schema (both non-streaming and streaming).
Can I use it from the browser?
Yes — all /v1 endpoints send CORS headers (Access-Control-Allow-Origin: *) and handle preflight. Don't embed keys in public web pages.
Which model should I start with?
For coding agents (opencode, Claude Code-style tools): big-pickle (verified tool calls), deepseek-v4.1-flash (verified multi-step loops), north-mini-code, GLM-5.3-Flash or Qwen3.5-397B-A17B. For plain chat: auto-free or free-router.
Where do I see my usage?
Console → Usage shows output tokens used against your allowance in real time.