ArchitectureMCPOAuthSecurityapi0
Engineering Team
October 3, 2026
7 min

How api0 Works, End to End

When Claude calls one of your APIs through api0, what actually happens between the question and the answer?

api0 is a gateway between AI assistants and your systems. You register an API, and it becomes a set of MCP tools. People reach those tools from Claude, from our SDK and CLI, or straight from WhatsApp and Telegram. Every one of those calls passes through the same gateway, which settles three things before your application sees anything: who is calling, which credential your application should receive, and what the call costs.

Here is the whole platform on one page.

The map

webhooks MCP · API key or OAuth REST payments as user model sessions specs internal tool calls + credential OIDC · OAuth Messaging users WhatsApp · Telegram MCP clients Claude · Claude Code · SDK/CLI Dashboard web · desktop console Stripe credits · licenses Messaging bridge one loop, every channel account linking conversation memory Gateway the only public entry MCP · REST · OAuth 2.1 identity · credits · routing picks the application's credential Spec formatter API spec → tools Claude the bridge's model Language model spec formatting Store internal service Postgres, row-level security tenants · keys · tools Your applications any REST API or MCP server Identity Google · Entra any OIDC

Solid boxes are api0. Dashed boxes are someone else: your users' clients, your applications, Stripe, the identity providers and the models. The orange one is the gateway, and everything your applications receive passes through it.

1. The MCP tool call

This is the product. A client speaks JSON-RPC to a single MCP endpoint.

  1. initialize returns your tenant's instructions for the model.
  2. tools/list returns the tools of the caller's tenant, or of the provider whose connector they came through.
  3. tools/call looks the tool up by name.
  4. The gateway picks the credential your application expects (flow 3).
  5. For a paid tool, it checks the balance first. If the balance can't be read, the call does not run.
  6. It forwards the request with who it is for and your application's credential, deducts credits on success, and logs the call.

2. Who is calling

Every way in ends with a known person in a known tenant.

  • API keys for the SDK, the CLI, CI jobs and the messaging bridge.
  • Consumer keys for products built on api0: the provider names the end user, and credits come from that person.
  • Google sign-in for the dashboard and the desktop console.
  • OAuth 2.1 for MCP connectors such as Claude. PKCE (S256) is required, each authorization code is tied to the client, redirect and challenge it was issued for, and a code works once.
  • Your own identity provider, such as Entra ID or any OIDC provider, for teams that already sign in there.

3. What your application receives

Each tenant chooses how its applications are called. The connection test in the dashboard runs the same logic as a real call, so a passing test means a working setup.

  • No credential, a fixed bearer token, or custom headers
  • A Google identity token that proves the call came from api0
  • OAuth client credentials
  • Each person's own secret
  • Each person's own account, connected once through OAuth

4. Registering tools

  1. Upload an API spec from the dashboard.
  2. The spec formatter normalizes it with a language model.
  3. The result is stored as endpoint groups and MCP tools.
  4. Or define and edit tools by hand.
  5. A built-in test calls each tool before it counts as configured.

5. WhatsApp and Telegram

The bridge is just another MCP client, with Claude as its model. Both channels share one conversation loop. A new sender links their account once with a short code from the dashboard. From then on, Claude runs each turn and calls your tools through the gateway as that person, with that person's permissions.

6. Credits and licenses

Credits are bought in the dashboard and spent by paid tool calls. Licenses for the desktop app are settled by Stripe's webhook. A provider that bills on its own side can skip api0 credits entirely.

7. Tenants

A tenant owner names the tenant, invites members and sets their roles, creates and revokes API keys, reads usage and call logs, writes instructions for the model, configures application credentials and sign-in, and connects WhatsApp or Telegram.

The takeaway

The useful property of this shape is that there is exactly one place where identity, credentials and billing are decided. Claude, the CLI and a WhatsApp message all arrive at the same gateway, and your application gets the same answer to "who is this, and what may they do" whichever door they used. If you are connecting AI assistants to internal systems, that single decision point is the thing to look for.