5-Minute Quickstart
Prerequisites
1. Install the SDK
pip install "revenium-python-sdk[openai]"npm install @revenium/middlewarecurl -X POST "https://api.revenium.ai/meter/v2/ai/completions" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_REVENIUM_API_KEY" \
-d '{
"provider": "openai",
"model": "gpt-5.5-mini",
"operationType": "CHAT",
"inputTokenCount": 200,
"outputTokenCount": 500,
"totalTokenCount": 700,
"stopReason": "END",
"requestTime": "2026-05-12T00:00:00Z",
"completionStartTime": "2026-05-12T00:00:01Z",
"responseTime": "2026-05-12T00:00:02Z",
"organizationName": "acme_corp",
"agent": "support-agent",
"traceId": "conv-28a7e9d4"
}' 2. Set Environment Variables
# Your Revenium Routing & Auth
# Metering key (rev_mk_*): write-only scope used by the SDK + OTLP to emit metering events to Revenium.
export REVENIUM_METERING_API_KEY="your_revenium_api_key"
# Provider key: your standard provider API key used for the actual LLM call (swap for ANTHROPIC_API_KEY, etc. when using other providers).
export OPENAI_API_KEY="your_openai_api_key"3. Wrap Your Client
Next Step: Take Control of Your AI Economics
Last updated
Was this helpful?