Install the wrapper
pip install tokevenWrap your client
from anthropic import Anthropic
from tokeven import TokevenAnthropic
client = Anthropic()
tracked = TokevenAnthropic(
client,
ingest_token="tkv_ing_...",
base_url="https://api.tokeven.com",
)Leave base_url out and the SDK falls back to http://localhost:8000, where nothing is listening. The emitter never raises on a failed push (instrumentation must not break the call it wraps), so events spool to disk and the dashboard stays empty with no error anywhere.
Make a call
Use tracked exactly like your normal client. Cost, tokens, model, and latency are captured automatically.
response = tracked.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}]
)Your prompt and completion content never reaches Tokeven - only metadata (token counts, model ID, latency, cost) is sent. (Two opt-in features - prompt revision and advisor.improve() - can send prompt text to Anthropic under your own API key; nothing prompt-related ever goes to Tokeven.)
View your data
Log in to the dashboard to see your first tracked call. Data appears within seconds.