LiteLLM → QuantZK adapter
Record LiteLLM (or OpenAI-compatible) completion usage as QuantZK portable receipts.
Path: integrations/litellm-quantzk/
What it does
On each successful completion callback:
- Extracts
event_id, tenant/customer, token/unit counts, and unit price - Calls QuantZK
record()(sync or async) - Optionally writes a
.qzkfile or posts a webhook with the receipt
Python callback
python
# integrations/litellm-quantzk/quantzk_callback.py
from quantzk_callback import QuantZKSuccessCallback
# Configure env:
# QUANTZK_API_URL=https://api.quantzk.com
# QUANTZK_ATTEST_SECRET=...
# QUANTZK_ASYNC=true # optional high-QPS pathWire into LiteLLM custom callbacks per LiteLLM docs (success callback / logging callback).
Node callback
js
// integrations/litellm-quantzk/callback.mjs
import { createQuantZKCallback } from './callback.mjs';See integrations/litellm-quantzk/README.md for full env vars and examples.
Pilot expectations
- Prefer async (
QUANTZK_ASYNC=true) for high QPS; poll or webhook for.qzk - Store
event_idfor idempotent retries - Offline verify with
@quantzk/verify+ QZR-1 Standard when Phase-2 binding is enabled server-side
Full integration checklist
See the design partner kit.
See also
- SDK
- API billing pilot
- Adapter README:
integrations/litellm-quantzk/README.md
