Requirements
- •Python 3.11+
- •An existing Anthropic, OpenAI, or Google AI SDK installation
- •A Tokeven ingest token (create one in Settings > Tokens)
Install via pip
pip install tokevenConfiguration
The wrapper reads your ingest token from the environment or accepts it directly:
# Option 1: Environment variables
export TOKEVEN_INGEST_TOKEN="tkv_ing_..."
export TOKEVEN_BASE_URL="https://api.tokeven.com"# Option 2: Pass directly
tracked = TokevenAnthropic(client, ingest_token="tkv_ing_...", base_url="https://api.tokeven.com")base_url matters: unset, it defaults to http://localhost:8000 and every event is queued locally forever with no error raised.
Supported providers
- •Anthropic SDK - full support (v0.1), via
TokevenAnthropic - •OpenAI SDK - full support (v0.1), via
TokevenOpenAI - •Google AI SDK - full support (v0.1), via
TokevenGemini - •xAI/Grok - full support (v0.1), via
TokevenXAI(the OpenAI SDK pointed atapi.x.ai)
wrap(client, ...) picks the right one for you by inspecting the client you pass.
Verifying the installation
After wrapping your client, make a test call and check the dashboard. You should see the call appear within seconds.