DEV Community

Cover image for I built a one-API-key gateway to 62 coding models — and you can pay in Taka
Md Badsha for Tokens

Posted on

I built a one-API-key gateway to 62 coding models — and you can pay in Taka

If you're a developer in Bangladesh, you already know the drill. You want to use Claude Code or Codex CLI with a good model, and the first wall you hit isn't technical — it's payments. No PayPal. International cards with dollar limits. Every top-up becomes paperwork.

I got tired of that wall, so I built Tokens: an AI model gateway where one API key unlocks 62 coding models from 10 providers, and you pay in USD or Bangladeshi Taka — no international card required.

What it actually is

Tokens sits between your tools and the model providers. You point your existing setup at it and swap the key — no new SDK, no code changes. It speaks both OpenAI-compatible and Anthropic-compatible API formats on the same key, so Claude Code, Codex CLI, OpenCode, Cursor, Cline, Continue, Zed, and anything else that accepts a custom base URL just works.

# one command connects your agents (backs up your configs first)
tokens setup
Enter fullscreen mode Exit fullscreen mode

Or manually — it's a base URL and a key:

from openai import OpenAI

client = OpenAI(
    base_url="https://tokens.bd/v1",
    api_key="tok_live_...",
)
resp = client.chat.completions.create(
    model="deepseek/deepseek-v4.1-flash",
    messages=[{"role": "user", "content": "Explain this codebase"}],
)
Enter fullscreen mode Exit fullscreen mode

Switch models by changing one ID. That's the whole migration story: change the base URL and the key, and you're running on 62 models — Claude Sonnet 5.5, GPT-5.6 Luna, DeepSeek V4.1 Flash, Gemini 3.8 Flash, Kimi K3, GLM-5.2, and the rest, with up to 1.1M context on some of them.

The parts I built for how agents actually burn money

Coding agents don't send a few requests a day — they send thousands. So the boring infrastructure mattered more than the model list:

  • Per-key spend caps. Give each API key a monthly cap and an allow-list of models. A runaway agent loop stops at the cap instead of draining your wallet. Email alerts at 50%, 75%, and 90%.
  • Pay in Taka. Top up with invoice, get a receipt for every payment. Weekly plan at ৳25/week, monthly at ৳490/month, or pay-as-you-go from a prepaid wallet. Prices are listed separately in ৳ and $.
  • Private by default. Billing needs model, tokens, cost, and latency — that's what's kept. Prompts and responses are never stored.
  • Automatic failover. If the provider serving a model stalls, the request moves to the next one before it reaches you.

How it's different from OpenRouter

OpenRouter has the bigger catalog and charges in USD by card or crypto. Tokens is narrower on purpose — coding models — and adds what developers here actually need: Taka payments, spend caps per key, a one-command agent setup, and support in the dashboard. I wrote up an honest side-by-side, including where OpenRouter is the better choice, on the site.

Why I'm posting this here

Two reasons. First, if the payment wall has ever stopped you from using the tools you want, this removes it — your first request is about five minutes away. Second, I'm building in the open and I want this community's criticism. The model catalog, the pricing page, the docs — all public. Tell me what's missing.

What's next on my roadmap: more providers, team workspaces, and deeper usage analytics. If there's a model or feature you need, the fastest way to get it built is to ask.

— Md Badsha, building Tokens in Dhaka 🇧🇩

Top comments (0)