PHPackages                             tokentifyai/usagemeter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tokentifyai/usagemeter

ActiveLibrary[API Development](/categories/api)

tokentifyai/usagemeter
======================

Out-of-band AI API usage metering SDK

v0.1.1(1mo ago)01MITPHPPHP &gt;=8.1

Since Jun 4Pushed 1mo agoCompare

[ Source](https://github.com/infinistackai/tokentify-sdk-php)[ Packagist](https://packagist.org/packages/tokentifyai/usagemeter)[ Docs](https://github.com/infinistackai/tokentify-sdk-php)[ RSS](/packages/tokentifyai-usagemeter/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Tokentify UsageMeter (PHP)
==========================

[](#tokentify-usagemeter-php)

Out-of-band AI API usage metering for PHP. After setup, call your provider’s HTTP API yourself, then record usage with `Meter::track()` (the PHP SDK does not auto-wrap HTTP clients).

Install
-------

[](#install)

```
composer require tokentifyai/usagemeter
```

Optional: load `.env` in development (recommended):

```
composer require vlucas/phpdotenv
```

Setup
-----

[](#setup)

### 1. Environment (API key is global)

[](#1-environment-api-key-is-global)

Copy `.env.example` to `.env`. The **API key lives only in `.env`** (or your deployment environment)—never in `init()` code.

```
cp .env.example .env
```

```
# .env — required
USAGEMETER_API_KEY=your_ingest_api_key
USAGEMETER_BUCKET=your_bucket_name
```

### 2. Initialize

[](#2-initialize)

```
