Top Billing
Toolkit

Everything on one bench.

Eight tools, one account. Pick one to see what it does and where it lives.

    • POST/v1/chat/completionsOpenAI-compatible chat
    • POST/v1/responsesOpenAI-compatible Responses (Codex)
    • POST/v1/messagesAnthropic-compatible messages
    • POST/v1/embeddingsOpenAI-compatible embeddings
    • GET/v1/modelsModels your key can use
    API reference
API
  • POST/v1/chat/completionsOpenAI-compatible chat
  • POST/v1/responsesOpenAI-compatible Responses (Codex)
  • POST/v1/messagesAnthropic-compatible messages
  • POST/v1/embeddingsOpenAI-compatible embeddings
  • GET/v1/modelsModels your key can use
API reference
Quickstart

Four steps to the first request.

  1. Step 01

    Create your API key.

    Sign up, create a project, add credits (top up or redeem a promo code) and create a key. New accounts start with zero credit.

    Create an account
  2. Step 02

    Install your SDK.

    The official OpenAI client works as-is. Nothing Top Billing-specific to install.

    terminal
    pip install openai
    # or
    npm install openai
    
  3. Step 03

    Change your base URL.

    Point the client at Top Billing and use your key.

    .env
    TB_API_KEY=tb_live_...
    TB_BASE_URL=https://api.topbilling.in/v1
    
  4. Step 04

    Make your first request.

    Send it, then open Usage in the dashboard to see its tokens and charge next to its request ID.

    Full quickstart
Code

The same request, four ways.

Your language choice follows you across the site and the docs.

POST /v1/chat/completions
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["TB_API_KEY"],
    base_url="https://api.topbilling.in/v1",
)

response = client.chat.completions.create(
    model="<model-id>",
    messages=[{"role": "user", "content": "Summarise this ticket in one line."}],
)
print(response.choices[0].message.content)
Replace <model-id> with an ID from Model Square.Run it in the Playground
OpenAI SDK compatibility

Three lines change.
Nothing else does.

app.py− before+ after
 import os
 from openai import OpenAI
 
-client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
+client = OpenAI(
+    api_key=os.environ["TB_API_KEY"],
+    base_url="https://api.topbilling.in/v1",
+)
 
 response = client.chat.completions.create(
-    model="<your-current-model>",
+    model="<top-billing-model-id>",
     messages=messages,
 )
Changes
base_url, the API key and the model ID.
Stays the same
The SDK, the request and response shapes, streaming, tool calls and the SDK’s error classes.
Documented, not assumed
Parameters a model cannot honour — n > 1, logprobs, seed and others — return a clear 400 instead of being ignored.
Playground

Try it before
you write it.

The Playground sends a real request through the gateway with your project’s key: the same route, price, limits and ledger. You see the output as it streams, then its usage, latency and exact charge — and the snippet that reproduces it.

Open Playground
Modeltb-…OpenAIAnthropicIllustration
Prompt
Summarise this ticket in one line.
Run request
Response
Refund issued for the duplicate charge; ticket closed.
Tokens
18 → 12
Latency
640 ms
Charge
₹0.0009
SDKs

What to install, honestly.

ClientStatusEndpointsGuide
OpenAI-compatible clientofficial openai SDKs for Python and Node.jsSupported/v1/chat/completions · /v1/responses · /v1/embeddings · /v1/modelsOpenAI SDK
Anthropic-compatible clientofficial anthropic SDKs and Claude CodeSupported/v1/messages · /v1/messages/count_tokensAnthropic SDK
Top Billing APIany HTTP client, cURL, fetchSupportedall /v1 endpointscURL
Official Top Billing SDKNot available—Use the clients above
Top Billing CLInpx @topbilling/cli — sets up Claude Code, Codex, OpenCode, Continue, Zed and AiderSupported—CLI
Community integrationsNone listed——