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.

Quickstart

  1. Sign in with Google or email.
  2. Open Console → API keys and create a key (starts with rbp-).
  3. 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

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:

FieldNotes
modelRequired. Any id from GET /v1/models.
messagesRequired. System / user / assistant roles.
streamtrue for SSE chunks ending with data: [DONE].
max_tokensClamped to 32–4096. Default 2048.
temperature, top_pPassed through to the model.
tools / tool_choiceForwarded 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:

LimitFree accountsWith credit balance
Output tokens, lifetime500,000 free, then billed from creditBilled from balance
Request bodyUp to 32MB per request. The API forwards your full conversation (no trimming); the console chat sends only the newest ~72,000 characters
API requests60/min, 4 parallel300/min, 8 parallel
Console chat20/min, 2 parallel100/min, 6 parallel
Shared-pool models20–30 requests/day per model group → model_daily_limit_reachedNo daily cap

Errors

Errors use the OpenAI error shape: { "error": { "message": "...", "type": "...", "code": "..." } }.

StatusCodeMeaning
400invalid_request_errorMalformed JSON or missing fields.
401invalid_api_keyMissing or invalid key.
402free_limit_reachedThe 500K free output-token allowance is used and your credit balance is empty. Top up to continue.
404model_not_foundUnknown model id (see GET /v1/models).
429rate_limited / rate_limit_exceededPer-minute or per-model daily cap reached.
429model_daily_limit_reachedDaily cap for a shared-pool model; try another model.
502upstream_errorThe upstream model failed or rejected the request; retry.
503server_busyGlobal concurrency limit; retry in a few seconds.
504queue_timeoutCommunity model queue too long; try again later.

Pricing & credits

Console & chat

The console contains:

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

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.