Analysis updated 2026-05-18
Wrap an existing Anthropic client to auto-report token usage per customer.
Track gross margin per agent and per run across multiple AI providers.
Attribute AI usage costs to individual customers with a single customerId field.
Instrument streaming and non-streaming calls to OpenAI, Bedrock, or Gemini.
| tollgateai/tollgate-sdk | 0xradioac7iv/tempfs | 7vignesh/pgpulse | |
|---|---|---|---|
| Stars | 0 | 0 | 0 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | easy | moderate | moderate |
| Complexity | 2/5 | 3/5 | 4/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires a Tollgate API key and an existing client for one of the four supported AI providers.
Tollgate SDK is the official set of software libraries for a service called Tollgate, which tracks the gross margin of AI agents in real time. Gross margin here means the difference between what a company pays an AI provider for tokens and what it charges its own customers for that usage, tracked per customer, per agent, and per individual run. The idea is that a company running AI agents on behalf of customers usually knows what it charges customers but does not have an easy way to see, live, exactly how much of that revenue is being eaten up by the underlying token costs from providers like Anthropic, OpenAI, AWS Bedrock, or Google Gemini. Tollgate connects the cost side, which comes from the provider's own token usage, with the revenue side, which comes from the company's own pricing plan configuration, to show that margin as it happens. The SDK is available in TypeScript and Python, published on npm and PyPI respectively. Both versions work the same way: a developer wraps their existing AI provider client, such as an Anthropic or OpenAI client, with a Tollgate wrapper function, and every call made through that wrapped client automatically reports its usage to Tollgate. This works whether the underlying call is streaming or not, and across the four supported providers. Getting started involves installing the package for the chosen language, creating a Tollgate client with an API key, wrapping the existing AI provider client, and attaching a customer identifier to each call so usage can be attributed correctly. The project is released under the MIT license.
SDKs that wrap your existing Anthropic, OpenAI, Bedrock, or Gemini client to automatically report live per customer gross margin to the Tollgate service.
Mainly TypeScript. The stack also includes TypeScript, Python, Node.js.
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.