Download the PHP package fuseboxie/sdk without Composer
On this page you can find all versions of the php package fuseboxie/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fuseboxie/sdk
More information about fuseboxie/sdk
Files in fuseboxie/sdk
Package sdk
Short Description Fuseboxie PHP SDK for guarding AI calls and tracking token usage from backend applications.
License MIT
Homepage https://fuseboxie.com
Informations about the package sdk
Fuseboxie PHP SDK
Backend SDK for tracking AI usage and blocking AI calls when a Fuseboxie guard rule says no.
Install
Usage
Initialize the SDK once in your PHP backend:
On Windows PHP installs that do not have a default CA bundle configured, pass one explicitly:
Guard before the AI provider call:
Track after the provider returns:
Provider helpers:
trackOpenAI($response, $context)mapsusage.prompt_tokens,usage.completion_tokens,usage.total_tokens, and the newerusage.input_tokens/usage.output_tokensshape.trackAnthropic($response, $context)mapsusage.input_tokensandusage.output_tokens.trackGemini($response, $context)mapsusageMetadata.promptTokenCount,usageMetadata.candidatesTokenCount, andusageMetadata.totalTokenCount.
You can also call trackUsage() manually when you already have normalized token counts:
Laravel
The package auto-discovers a Laravel service provider and facade when installed in a Laravel app.
Publish the config file:
Set your server-side environment values:
Add the middleware to routes that make AI calls. It captures the signed-in Laravel user ID and optional customer/role/request headers, then reuses them for every Fuseboxie call in that request:
Use the facade in your controller:
If your app stores tenant/customer IDs somewhere else, pass them directly in the guard/tracking arrays or customize the middleware header names in config/fuseboxie.php.
Checks
The SDK has no runtime dependencies beyond PHP JSON support. It uses cURL when available and falls back to PHP streams.
All versions of sdk with dependencies
ext-json Version *