whatisgithub

What is tollgate-sdk?

tollgateai/tollgate-sdk — explained in plain English

Analysis updated 2026-05-18

0TypeScriptAudience · developerComplexity · 2/5LicenseSetup · easy

In one sentence

SDKs that wrap your existing Anthropic, OpenAI, Bedrock, or Gemini client to automatically report live per customer gross margin to the Tollgate service.

Mindmap

A visual breakdown will appear here once this repo is fully enriched.

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Wrap an existing Anthropic client to auto-report token usage per customer.

USE CASE 2

Track gross margin per agent and per run across multiple AI providers.

USE CASE 3

Attribute AI usage costs to individual customers with a single customerId field.

USE CASE 4

Instrument streaming and non-streaming calls to OpenAI, Bedrock, or Gemini.

What is it built with?

TypeScriptPythonNode.js

How does it compare?

tollgateai/tollgate-sdk0xradioac7iv/tempfs7vignesh/pgpulse
Stars000
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderatemoderate
Complexity2/53/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires a Tollgate API key and an existing client for one of the four supported AI providers.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

So what is it?

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.

Copy-paste prompts

Prompt 1
Help me install the Tollgate TypeScript SDK and wrap my existing Anthropic client with it.
Prompt 2
Explain how Tollgate combines provider token cost with my own pricing plan to compute gross margin.
Prompt 3
Walk me through instrumenting a streaming OpenAI call with the Tollgate Python SDK.
Prompt 4
What does the customerId parameter do when wrapping a client with Tollgate?

Frequently asked questions

What is tollgate-sdk?

SDKs that wrap your existing Anthropic, OpenAI, Bedrock, or Gemini client to automatically report live per customer gross margin to the Tollgate service.

What language is tollgate-sdk written in?

Mainly TypeScript. The stack also includes TypeScript, Python, Node.js.

What license does tollgate-sdk use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is tollgate-sdk to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is tollgate-sdk for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.