Documentation

Integrate in one minute

ONBF is a verbatim passthrough proxy. There are just two tiny swaps to learn: (1) prefix your provider's base URL with the ONBF proxy, and (2) replace your provider key with your ONBF Virtual key — sent the same way your tool already sends it. Keep your existing SDK, auth method and request payload exactly as-is; we swap the real provider key in behind the scenes.

The one concept

Two swaps, that's it. First, take your provider's normal base URL and prefix it with https://proxy.onbf.ai/. Second, swap your provider key for your ONBF Virtual key. That's the entire integration.

Before
https://api.openai.com/v1
After
https://proxy.onbf.ai/https://api.openai.com/v1
Auth — swap your provider key for your ONBF Virtual key, sent the same way your tool already does
Authorization: Bearer onbf_sk_YOUR_KEY
x-api-key: onbf_sk_YOUR_KEY
?key=onbf_sk_YOUR_KEY

Bearer (OpenAI / OpenRouter), x-api-key (Anthropic) and ?key= / x-goog-api-key (Gemini) all work — pick whatever your tool already uses.

Quickstart

01

Create your key

Spin up a project and issue a Virtual key. It works across every supported provider — no provider keys to manage.

02

Set the base URL

Prefix your provider's base URL with the ONBF proxy. Your SDK and payload stay exactly the same.

03

Send your key

Put your Virtual key wherever your tool expects the provider key — Bearer, x-api-key or ?key=. We swap the real key in and meter every token.

Platform guides

Pick your tool. Every example is real, copy-paste ready, and uses the same base-URL swap.

Claude Code

Claude Code

Export the Anthropic base URL and your Virtual key as the auth token in your shell profile. Blank out ANTHROPIC_API_KEY (a real key conflicts), /logout of any cached Anthropic session, then restart your terminal.

bash
# Route Claude Code through ONBF — add these to your shell profile
# (~/.zshrc or ~/.bashrc), NOT a project .env (Claude Code doesn't read .env):
export ANTHROPIC_BASE_URL="https://proxy.onbf.ai/https://api.anthropic.com"
export ANTHROPIC_AUTH_TOKEN="onbf_sk_YOUR_KEY"
export ANTHROPIC_API_KEY=""   # ⚠️ Must be EMPTY. A real Anthropic key here
                              #    overrides the token above and causes auth
                              #    conflicts / "model not found" errors.

# If you previously logged into Claude Code with an Anthropic account, run
# /logout once inside Claude Code to clear the cached session — it conflicts
# with the token above. Then restart your terminal so the exports take effect.
claude
Codex

Codex

Add an ONBF model provider in ~/.codex/config.toml pointing at the proxy, then export your Virtual key.

toml
# 1. Export your virtual key FIRST (env_key reads it from your shell):
export ONBF_API_KEY="onbf_sk_YOUR_KEY"

# 2. Add the following to ~/.codex/config.toml
# ⚠️ Keep `model` and `model_provider` at the TOP LEVEL — place them ABOVE any
#    [projects."..."] or other [section] blocks. If they sit under a section,
#    Codex treats them as scoped config and ignores them globally.
model = "gpt-4o-mini"
model_provider = "onbf"

[model_providers.onbf]
name = "ONBF"
base_url = "https://proxy.onbf.ai/https://api.openai.com/v1"
env_key = "ONBF_API_KEY"

# 3. Restart Codex so it picks up the new config, then run it as usual.
OpenClaw

OpenClaw

OpenClaw treats ONBF as an OpenAI-compatible provider — add it in ~/.openclaw/openclaw.json with your Virtual key, then apply.

json
// ~/.openclaw/openclaw.json — add ONBF as an OpenAI-compatible provider.
{
  "models": {
    "mode": "merge",
    "providers": {
      "onbf": {
        "baseUrl": "https://proxy.onbf.ai/https://api.openai.com/v1",
        "apiKey": "onbf_sk_YOUR_KEY",
        "api": "openai-completions",
        "models": [{ "id": "gpt-4o-mini", "name": "ONBF · gpt-4o-mini" }]
      }
    }
  },
  "agents": { "defaults": { "models": { "onbf/gpt-4o-mini": {} } } }
}
// Apply it:  openclaw gateway config.apply --file ~/.openclaw/openclaw.json

cURL

Hit the chat-completions endpoint directly — note the proxy prefix in front of the full OpenAI URL.

bash
curl "https://proxy.onbf.ai/https://api.openai.com/v1/chat/completions" \
  -H "Authorization: Bearer onbf_sk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
     "messages": [{ "role": "user", "content": "Hello from ONBF!" }]
  }'
OpenAI

OpenAI SDK

Set baseURL to the proxy + OpenAI's URL and pass your Virtual key as apiKey. Nothing else changes.

typescript
import OpenAI from "openai";

const client = new OpenAI({
  // Point the SDK's baseURL at ONBF + the real OpenAI URL.
  baseURL: "https://proxy.onbf.ai/https://api.openai.com/v1",
  apiKey: "onbf_sk_YOUR_KEY",
});

const res = await client.chat.completions.create({
  model: "gpt-4o-mini",
  messages: [{ role: "user", content: "Hello from ONBF!" }],
});
Anthropic

Anthropic SDK

The SDK sends your key via x-api-key — ONBF accepts it there. Just swap baseURL + apiKey; auth method stays the same.

typescript
import Anthropic from "@anthropic-ai/sdk";

// The Anthropic SDK sends your key via the x-api-key header — ONBF accepts
// it there natively. Just swap baseURL + apiKey; no auth changes needed.
const client = new Anthropic({
  baseURL: "https://proxy.onbf.ai/https://api.anthropic.com",
  apiKey: "onbf_sk_YOUR_KEY",
});

const res = await client.messages.create({
  model: "claude-3-5-sonnet-latest",
  max_tokens: 256,
  messages: [{ role: "user", content: "Hello from ONBF!" }],
});
Google Gemini

Gemini SDK

The SDK sends your key via ?key= / x-goog-api-key — both accepted. Point httpOptions.baseUrl at the proxy + Gemini's URL.

typescript
import { GoogleGenAI } from "@google/genai";

// The Gemini SDK sends your key via the ?key= query param / x-goog-api-key
// header — ONBF accepts both. Point it at the proxy + Gemini's base URL.
const ai = new GoogleGenAI({
  apiKey: "onbf_sk_YOUR_KEY",
  httpOptions: { baseUrl: "https://proxy.onbf.ai/https://generativelanguage.googleapis.com" },
});

const res = await ai.models.generateContent({
  model: "gemini-1.5-flash",
  contents: "Hello from ONBF!",
});
OpenRouter

OpenRouter

OpenRouter is OpenAI-compatible — point the SDK at the proxy + OpenRouter's URL and call any model by slug.

typescript
import OpenAI from "openai";

// OpenRouter is OpenAI-compatible — point the SDK at ONBF + OpenRouter's URL.
const client = new OpenAI({
  baseURL: "https://proxy.onbf.ai/https://openrouter.ai/api/v1",
  apiKey: "onbf_sk_YOUR_KEY",
});

// Call ANY OpenRouter model by slug — billed at OpenRouter's exact cost.
const res = await client.chat.completions.create({
  model: "openai/gpt-4o-mini",
  messages: [{ role: "user", content: "Hello from ONBF!" }],
});
Python

Python

Same swap as the Node SDK — set base_url to the proxy + OpenAI's URL and pass your Virtual key.

python
from openai import OpenAI

client = OpenAI(
    base_url="https://proxy.onbf.ai/https://api.openai.com/v1",
    api_key="onbf_sk_YOUR_KEY",
)

res = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello from ONBF!"}],
)

Reference

Proxy base URLhttps://proxy.onbf.ai/
What you doPrefix your provider's full base URL with the proxy base — e.g. https://proxy.onbf.ai/https://api.openai.com/v1.
AuthSend your Virtual key however your tool already does — Authorization: Bearer, x-api-key, x-goog-api-key or ?key=. We swap the real provider key in server-side.
ProvidersClaude (Anthropic), Gemini, OpenAI and OpenRouter today — OpenRouter alone unlocks hundreds of models by slug.
MeteredModel, token counts, cost, latency and status — live in your dashboard. Prompts & responses are never stored.
Spend ceilingHard limit at your funded wallet balance. When it hits zero, requests stop cleanly — never a surprise charge.

Your prompts and responses are never stored. ONBF is a verbatim passthrough — only usage metadata (model, token counts, cost, latency, status) is recorded to power your dashboard and enforce the hard wallet ceiling.

FAQ

Is it really just one base URL change?

Yes. ONBF is a verbatim passthrough — prefix your provider's base URL with the proxy, keep your existing SDK and request payload, and send your Virtual key as the auth token. No new SDK, no rewrite, no translation layer.

Do I need to change how my tool sends the API key?

No. Put your Virtual key exactly where the provider key normally goes and ONBF accepts it there — Authorization: Bearer (OpenAI, OpenRouter, cURL), x-api-key (Anthropic), or ?key= / x-goog-api-key (Gemini). Your SDK's auth method stays untouched.

Which providers and models are supported?

Claude, Gemini, OpenAI and OpenRouter today. OpenRouter alone unlocks hundreds of models (Llama, Mistral, DeepSeek and more) by slug, billed at its exact pass-through cost. New providers are a quick add on our side.

What data do you store?

Like any proper AI router, ONBF is a verbatim passthrough — your prompts and the model's responses flow through untouched and are never stored. We only record usage metadata: model, token counts, cost, latency and status.

What happens when the wallet runs out?

There's a hard ceiling. Spend always stays within what backers have funded — when the wallet hits zero, requests stop cleanly. Never a surprise charge.

Ready to ship? 🚀

Create a project, grab your Virtual key, and point your app at ONBF in under a minute.

Create your project
Docs · ONBF