एKRUTRIM EKAMAgent-identity control plane

Ekam blog · 30 June 2026

How BharatRouter runs on Ekam: agent identity for an AI gateway

BharatRoutergatewaysintegrationarchitecturecase study   6 min read · The Ekam team

Identity → inference → billing, one loop. Ekammints ES256 JWT BharatRouterverify offline · map owner→orgmeter · (later) bill model / API usage attributed to the owner · revoke kills it in seconds no shared keys · no hot-path call to Ekam · attribution end to end

An AI gateway sits in front of every model call an organisation makes. The usual way to authenticate that traffic is a long-lived API key, shared across every agent, script and service. It works until you ask three questions: which agent made this call, who is responsible for it, and how do I switch off just one agent without rotating the key for everyone? BharatRouter, an India-first AI gateway, answers all three by putting Ekam in front as its agent-identity layer.

The shape of the integration

Nothing about the request path gets slower. An agent presents an Ekam-issued, audience-bound token instead of a shared key; BharatRouter verifies it offline and maps it to the right account. Three moving parts:

  1. Ekam mints a short-lived ES256 JWT for the agent, bound to the audience https://api.bharatrouter.com and carrying the delegation chain back to a human owner.
  2. BharatRouter verifies the signature against Ekam's published JWKS (no network call to Ekam on the hot path) and checks issuer, audience and expiry.
  3. BharatRouter maps the token's owner (act.sub) to a billing org, enforces that org's budget and scopes, and meters the usage.

What the gateway actually checks

import { jwtVerify, createRemoteJWKSet } from "jose";
const JWKS = createRemoteJWKSet(new URL("https://ekam.olakrutrim.com/.well-known/jwks.json"));

const { payload } = await jwtVerify(token, JWKS, {
  issuer:   "https://ekam.olakrutrim.com",
  audience: "https://api.bharatrouter.com",   // RFC 8707: a token for another gateway won't pass
});
// payload.act.sub  -> the owner -> map to a BharatRouter org -> budget + metering
// payload.scope    -> "models:invoke models:chat" -> enforce per route

The JWKS is cached, so verification is local CPU work: tens of microseconds, about 18,000 verifications/second/core, p99 under 0.1 ms (measured on Ekam's reference hardware). Even under a model-gateway's request volume, identity adds no measurable latency.

What BharatRouter gains

Why it matters beyond one gateway

India is wiring agents into payments, logistics, support and government-facing workflows. "An agent did it" is not an acceptable audit answer when something goes wrong. The BharatRouter integration is a concrete proof of the pattern we think every Indian AI platform will need: the gateway decides what a request may do; Ekam decides who is making it and on whose authority. Clean separation, both sides standards-based, identity rooted in a human.

Build the same on your gateway

The verifier above is ~20 lines. Start from the verify recipe, read how offline verification works, and follow the docs. Any gateway, any language with a JOSE library.

Verify Ekam tokens How verification works For agents: llms-full.txt

Was this helpful?

More reading: The shared API key is over: agent identity for developer platforms Identity and billing in one plane: metering agents by the owner Why India needs its own agent-identity control plane How offline token verification works (and why it's fast) 10 things to build on Ekam this week

Krutrim Cloud · DR enabled · Open beta  ·  Home · Blog · Docs · Cookbook · Privacy · Terms · Report a bug