πŸ› οΈIntegration Options for AI Metering

circle-info

Python SDK: pip install revenium-python-sdk β€” available on PyPIarrow-up-right with extras for each provider. Node.js SDKs: available on npmarrow-up-right. Go SDKs: available on GitHubarrow-up-right.

Overview

Revenium SDKs wrap your AI provider’s client library to automatically capture token usage, costs, latencies, and metadata β€” no changes to your API logic required. Data flows to the AI Analytics and Alerts dashboards in real time.


Python SDK

Install: pip install revenium-python-sdk

The unified Python SDK supports all major AI providers through optional extras. Install only the providers you need:

Provider
Install Command
Chat Completions
Embeddings

OpenAI

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

βœ…

βœ…

Azure OpenAI

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

βœ…

βœ…

Anthropic

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

βœ…

Anthropic has no embedding models

Anthropic via AWS Bedrock

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

βœ…

Anthropic has no embedding models

Google Gemini (AI SDK)

pip install "revenium-python-sdk[google-genai]"

βœ…

βœ…

Google Vertex AI (Enterprise)

pip install "revenium-python-sdk[google-vertex]"

βœ…

βœ…

LiteLLM

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

βœ…

βœ…

LiteLLM Proxy

pip install "revenium-python-sdk[litellm-proxy]"

βœ…

βœ…

Ollama

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

βœ…

βœ…

Perplexity (OpenAI-compatible)

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

βœ…

Perplexity does not currently support embeddings

Perplexity (Native)

pip install "revenium-python-sdk[perplexity-native]"

βœ…

Perplexity does not currently support embeddings

Fal.ai (image, video, audio metering)

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

–

–

LangChain

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

βœ…

βœ…

You can install multiple providers at once: pip install "revenium-python-sdk[openai,anthropic,langchain]"

circle-info

The Python SDK is available on PyPIarrow-up-right. Source code and examples are on GitHubarrow-up-right.


Node.js SDKs

Provider
Package
Chat Completions
Embeddings

OpenAI

βœ…

βœ…

Azure OpenAI

βœ…

βœ…

Anthropic

βœ…

Anthropic has no embedding models

Google Vertex AI (Enterprise)

βœ…

βœ…

Google AI SDK

βœ…

βœ…

Perplexity

βœ…

Perplexity does not currently support embeddings

LiteLLM

βœ…

βœ…

circle-info

All Node.js SDKs are available on npmarrow-up-right.


Go SDKs

Provider
Chat Completions
Embeddings
Image
Video
Audio

OpenAI

βœ…

βœ…

–

–

–

Azure OpenAI

βœ…

βœ…

–

–

–

Anthropic

βœ…

Anthropic has no embedding models

–

–

–

Google

βœ…

βœ…

–

–

–

Perplexity

βœ…

Perplexity does not currently support embeddings

–

–

–

Fal.ai

–

–

βœ…

βœ…

βœ…

Runway

–

–

–

βœ…

–

circle-info

Go SDKs are available on GitHubarrow-up-right.


LangChain

The wrap() function attaches a callback handler that reports usage data to Revenium's metering API. See the SDK READMEarrow-up-right for additional examples.

For LangChain apps already using OpenTelemetry, see OpenTelemetry Integration as an alternative path.


Other Framework Integrations

Framework / Platform
Language
Install

n8n – Chat Agent

Node.js

Griptape

Python

Via griptape driver

OpenTelemetry

Any


AI Coding Assistants

Revenium ingests telemetry from AI coding assistants via OpenTelemetry, tracking adoption and usage across your engineering team.

Tool
Status

Claude Code

βœ… Supported

Gemini CLI

βœ… Supported

Setup: configure the tool's OTLP exporter to point at Revenium β€” see OpenTelemetry Integration. Usage data appears in the AI Coding Dashboard.


Multimodal Cost Tracking

Revenium tracks costs across all AI modalities in a single view: Completionsarrow-up-right, Imagesarrow-up-right, Videoarrow-up-right, and Audioarrow-up-right.


Using a different SDK or framework? Revenium supports direct API calls and OpenTelemetry for any application. Contact [email protected] for integration assistance.

Using an AI agent? Revenium docs are available in Claude Code, Cursor, Windsurf, and other MCP-compatible agents via Context7. See For AI Agents.

Usage Metadata Reference

Each SDK accepts an optional usage_metadata object for billing, cost attribution, and alerting. The more fields you provide, the more granular your reporting.

Key fields: traceId, taskType, organizationId, subscriptionId, productId, agent, responseQualityScore, subscriber (with id, email, credential).

For field definitions, naming conventions, and examples, see each SDK's documentation on npmarrow-up-right or PyPIarrow-up-right. For OTEL-based attribution, see the revenium.* attributes in the OpenTelemetry Integration docs.


Direct API Integration

For complete customization, use the metering API directly:

triangle-exclamation
circle-info

Required field: stopReason β€” For completion metering, the stopReason field is required. Valid values: END, END_SEQUENCE, TOKEN_LIMIT, COST_LIMIT, COMPLETION_LIMIT, ERROR, TIMEOUT, CANCELLED. Omitting this field or sending an invalid value (e.g., MAX_TOKENS, CONTENT_FILTER, STOP) will result in a 400 Bad Request.

circle-exclamation

Last updated

Was this helpful?