Build with Top Billing.

One API for chat, messages and embeddings — OpenAI- and Anthropic-compatible, prepaid in INR. Start with the quickstart, or jump to the reference.

Top Billing is an AI API gateway. You call models through endpoints that mirror the APIs most tooling already speaks:

  • POST https://api.topbilling.in/v1/chat/completions — OpenAI-compatible (Chat Completions). Works with the official openai SDKs.
  • POST https://api.topbilling.in/v1/messages — Anthropic-compatible (Messages). Works with the official anthropic SDKs and with Claude Code.
  • POST https://api.topbilling.in/v1/responses — OpenAI-compatible (Responses). Used by Codex.
  • POST https://api.topbilling.in/v1/embeddings — OpenAI-compatible embeddings.
  • GET https://api.topbilling.in/v1/models — the models your key can use, readable by both SDK families.

All endpoints share one account, one set of API keys and one prepaid balance in INR. A request costs the same whichever endpoint you use.

How it works

  1. Create a project, add credits (top up, or redeem a promo code), and create an API key (tb_live_…).
  2. Point your SDK at https://api.topbilling.in and send requests exactly as you would to the original API.
  3. Each request reserves an estimated amount of credits, runs, and settles on the tokens the model reported. You can see every request, its tokens and its charge in the dashboard.

What is different from the original APIs

  • Model IDs are Top Billing IDs (see Models); the upstream vendor is not exposed.
  • Parameters a model cannot honour are rejected with a clear 400 instead of being silently ignored (Errors).
  • Every response carries an x-request-id: tb_req_… header; quote it when you contact support.

Your first request

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)