Quickstart
Install TokenID and capture your first AI API call in under five minutes.
1. Get your API key
Log in to token.audit.id/app → Settings → API Keys → New Key.
Your key starts with td_live_.
2. Install
```bash
pip install --extra-index-url https://tokenid:@pypi.token.audit.id/simple/ tokenid
```
Or add to `requirements.txt`:
```text
--extra-index-url https://tokenid:@pypi.token.audit.id/simple/
tokenid
```
Install with the `[proxy]` extra:
```bash
pip install --extra-index-url https://tokenid:@pypi.token.audit.id/simple/ "tokenid[proxy]"
```
Use this if you want zero code changes — the proxy intercepts calls at the network level.
3. Capture your first call
Swap your existing client for a journaled wrapper — one import change, everything else stays the same.
```python
export TOKENID_API_KEY=td_live_xxxx
```
```python
# Anthropic
from tokenid import JournaledAnthropic
client = JournaledAnthropic(api_key="sk-ant-…", session_id="my-session")
# OpenAI
from tokenid import JournaledOpenAI
client = JournaledOpenAI(api_key="sk-…", session_id="my-session")
# xAI / Grok
from tokenid import JournaledGrok
client = JournaledGrok(api_key="xai-…", session_id="my-session")
```
The wrapper passes all arguments through unchanged. If the ingest call fails, your API call still succeeds.
Start the proxy and point your client at it — no code changes required.
```bash
export TOKENID_API_KEY=td_live_xxxx
python -m tokenid.proxy
# → [tokenid-proxy] listening on http://127.0.0.1:9000
# Point any Anthropic client at the proxy
export ANTHROPIC_BASE_URL=http://127.0.0.1:9000
# Claude Code — zero code changes
ANTHROPIC_BASE_URL=http://127.0.0.1:9000 claude
```
To group calls under a session, pass `x-session-id` in the request header:
```bash
curl http://127.0.0.1:9000/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "x-session-id: my-session" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model": "claude-sonnet-4-6", "max_tokens": 256, "messages": [{"role": "user", "content": "Hello"}]}'
```
Your `ANTHROPIC_API_KEY` is forwarded upstream unchanged.
4. Check your dashboard
Open token.audit.id/app. The call appears under Events within seconds, with cost, token counts, model, and session ID.
✓ You're live. Every call you make is now captured and audited.