TokensBill.AspNetCore
0.4.5
See the version list below for details.
dotnet add package TokensBill.AspNetCore --version 0.4.5
NuGet\Install-Package TokensBill.AspNetCore -Version 0.4.5
<PackageReference Include="TokensBill.AspNetCore" Version="0.4.5" />
<PackageVersion Include="TokensBill.AspNetCore" Version="0.4.5" />
<PackageReference Include="TokensBill.AspNetCore" />
paket add TokensBill.AspNetCore --version 0.4.5
#r "nuget: TokensBill.AspNetCore, 0.4.5"
#:package TokensBill.AspNetCore@0.4.5
#addin nuget:?package=TokensBill.AspNetCore&version=0.4.5
#tool nuget:?package=TokensBill.AspNetCore&version=0.4.5
TokensBill.AspNetCore
One line. Every AI token tracked. Automatically captures Anthropic / OpenAI / Gemini token usage from your app's outgoing AI calls and streams it to your TokensBill dashboard — so you can see exactly where your AI spend goes.
Install
dotnet add package TokensBill.AspNetCore
Use — one line at startup
builder.Services.AddTokensBill("tl_live_your_project_key");
Add it in Program.cs where you register services. That's it — every AI API call your app makes through HttpClient is now tracked automatically.
Get your project key from TokensBill → your project → Integration.
What it does
- Hooks the
HttpClientfactory pipeline via anIHttpMessageHandlerBuilderFilter. - Reads token counts and cost from the AI provider's response without altering your call.
- Sends the numbers to TokensBill from a background worker.
- Silent-fail by design — it never throws into, blocks, or slows your application. If TokensBill is unreachable, your app is completely unaffected.
Is the key safe to commit?
The tracking key is a label, not a password. It cannot access your AI provider account, read your prompts, or spend money — it only lets your app report usage numbers to your dashboard. You can regenerate it any time from the dashboard.
Options
builder.Services.AddTokensBill("tl_live_...", cfg =>
{
cfg.Environment = "production"; // production | staging | development
cfg.IngestBaseUrl = "https://tokensbill.aiappsjunction.com"; // override the endpoint
});
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.0 | 160 | 9/1/2026 |
| 1.0.1 | 128 | 8/20/2026 |
| 1.0.0 | 123 | 8/17/2026 |
| 0.8.1 | 124 | 8/12/2026 |
| 0.8.0 | 115 | 8/12/2026 |
| 0.6.0 | 114 | 8/9/2026 |
| 0.5.0 | 124 | 8/7/2026 |
| 0.4.9 | 124 | 7/30/2026 |
| 0.4.8 | 123 | 7/26/2026 |
| 0.4.7 | 120 | 7/23/2026 |
| 0.4.6 | 127 | 7/23/2026 |
| 0.4.5 | 124 | 7/22/2026 |
| 0.4.4 | 131 | 7/22/2026 |
| 0.4.3 | 121 | 7/20/2026 |
| 0.4.2 | 120 | 7/16/2026 |
| 0.4.1 | 121 | 7/12/2026 |
| 0.3.1 | 133 | 7/9/2026 |
| 0.2.1 | 134 | 7/2/2026 |
| 0.2.0 | 127 | 7/2/2026 |
| 0.1.0 | 124 | 7/1/2026 |
0.4.5 — New TokensBillTools functions: Deduplicate (time-windowed call dedup), RetryWithBudget (exponential backoff with cost ceiling), Summarize, ExtractJson, Classify, Chat (OpenAI chat wrappers), Embed (OpenAI embeddings). All static, never throw. No breaking changes.