For the complete documentation index, see llms.txt. This page is also available as Markdown.

5-Minute Quickstart

Get your AI API calls metered, monitored, and analyzed in minutes. Revenium acts as a zero-latency middleware—just install the SDK, set your keys, and wrap your client.


Prerequisites

Before you begin, you need a Revenium account to route your telemetry.

Sign in or Register

Then navigate to Integrations to get your API key


1. Install the SDK

pip install "revenium-python-sdk[openai]"

2. Set Environment Variables

Revenium automatically intercepts these variables from your environment to route your telemetry securely.

# Your Revenium Routing & Auth
# Metering key (rev_mk_*): metering-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

Drop this into your existing logic. Revenium intercepts the call, calculates the exact token usage and cost, and forwards the request to OpenAI with zero added latency.

traceId is the field you plan around. transactionId is auto-generated by the SDK (from the OpenAI response id) or by Revenium (if you omit it on a direct API call). What you control is traceId — use it to group multiple AI calls that belong to one user request, conversation, or workflow. Plan the traceId scheme that maps to your application's session / conversation / job ID.


Next Step: Take Control of Your AI Economics

Seeing a single request on your dashboard is just the beginning. Now that Revenium is connected, choose your next objective to move from basic observability to true economic control:

  • Attribute Your Usage: Raw token counts are useless if you don't know what generated them. Learn how to inject organizationName, productName, agent, and traceId so you can track profit margins per customer and monitor exact agent execution paths.

  • Set Budgets & Alerts: Don't wake up to a massive provider bill. Set hard caps based on your tags and get pinged in Slack the second a customer or agent spikes your spend.

  • Monetize Your Apps: Ready to turn compute costs into revenue? Use your new telemetry data to build automated, usage-based billing for your users.

  • Integrate AI Assistants: AI coding assistants have become a significant and often poorly tracked line item for teams. Seats get purchased, adoption is assumed. Revenium provides visibility of who's using what, how intensively, and whether the subscription is providing value.

Last updated

Was this helpful?