Getting Started · 3 min · Updated 2026-09-13

Quick start guide

Install the wrapper and start tracking in under two minutes

Install the wrapper

pip install tokeven

Wrap 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 through the wrapper - only usage metadata such as token counts, model and provider IDs and latency is sent. A few opt-in tools do process text you explicitly submit: Prompt Revision in the dashboard sends the text you paste to Anthropic through Tokeven's server, advisor.improve() sends the prompt to Anthropic directly using your own API key, and the dashboard AI assistant sends your messages to Google Gemini through Tokeven's server. See Privacy Policy §2.4.

View your data

Log in to the dashboard to see your first tracked call. Data appears within seconds.

Track your real costs

Calculators estimate. The dashboard shows what you actually spend and where you can save.