π‘FAQ
Common questions and answers about integration with Revenium's middleware
This page addresses common technical questions developers may have when integrating Revenium for AI cost tracking, usage metering, and billing. If you're just getting started, we recommend reviewing the Quick Start Guide first.
π§ Setup & Middleware
Do I need to modify my API calls to use Revenium?
If you're using one of our middleware libraries, no changes to your API logic are needed beyond importing the Revenium wrapper and optionally passing usage metadata. This is generally a one-line integration to add basic tracking. Our middleware wraps the standard middleware from the AI provider to extract transactional metadata for storage and analysis.
For direct API integrations, you'll send usage events to Revenium via POST requests.
Which languages or frameworks are supported?
As this list is regularly evolving, please check the Integration Options page for details.
π Performance & Overhead
Will using Revenium middleware slow down my application?
No. Middleware calls are async and typically add <50ms per call. Usage data is queued and sent in the background.
Can I batch events instead of sending them per-request?
Yes, though batching is only supported in direct API integration mode, not via middleware. If you choose this integration model, you'll need to review the direct API integration process on the Integration Options page:
β
Validation & Troubleshooting
What happens if I send metadata incompatible with Revenium?
When using our middleware, the good news is, because our wrapping function is async / 'fire and forget', your call to the AI provider will continue unaffected, though usage to Revenium will not be tracked. Most middleware packages use standard logging to inform that this has occurred so you can be aware of the problem and fix whatever is causing the failure to Revenium's metering engine.
How can I test whether usage is being tracked?
Go to the AI Transactions log page in the Revenium UI to see usage, tokens, latency, and cost per call. You can also verify metadata like orgs and subscribers there.
π Usage Metadata
Which fields should I always include in usage_metadata
?
usage_metadata
?This varies by use case, but we generally recommend these as a solid starting point as they're broadly useful in internal & external use cases alike:
organizationId
β for customer-level groupingsubscriber.id
β for user-level reportingproductId
β for feature- or product-based cost attributiontaskType
β for purpose-based classification
See the full Metadata Reference for additional options.
Do I need to use snake_case or camelCase for metadata fields?
Use whatever is idiomatic for your environment. Middleware libraries utilize proper casing automatically. If you're using our direct API integration, read the instructions here.
Can I tag anonymous usage and update it later?
Yes. You can:
Use a temporary subscriberId or credential value for anonymous users
Later update the subscriber record with a real
id
oremail
This helps associate historic usage with real users once identified.
π° Billing & Cost Attribution
How does Revenium calculate AI cost per request?
If you're using middleware, Revenium automatically extracts:
Model name and vendor
Token counts
Pricing tier
We apply your vendor's pricing model (e.g., OpenAI) and update cost tracking automatically. You donβt need to calculate total cost, we'll do it for you. If you're an enterprise with custom pricing from the AI providers, we support custom pricing in our Enterprise plans.
What if Iβm using a model not yet supported by Revenium?
For custom fine-tined models, we support tracking costs related to these on our enterprise plans.
For public models, even brand new ones, this shoudn't happen in practice, but if necessary, you can request support for a new provider or model at [email protected]
Can I override the cost calculated by Revenium?
Yes, in the direct API integration mode you can send:
totalCost
inputTokenCount
/outputTokenCount
In this case, our pricing engine will override the normally calculated costs with a value you provide.
π£ Alerts & Monitoring
Can I receive alerts when usage or cost spikes?
Yes. Use Cost & Performance Alerts to:
Get notified via Slack or email
Set thresholds by org, user, model, or product
Monitor error rates and latency anomalies
How often does Revenium evaluate alert conditions?
You can set the evaluation period to as short as a minute. Cumulative alerts are used for recurring budget alerts and automatically reset on a calendar period (daily, weekly, monthly, quarterly, etc.).
π Privacy & Data Handling
Does Revenium have access to the content of prompts or model responses?
Revenium does not access, store, or analyze the raw input (prompts) or output (responses) of your AI calls.
Our middleware and APIs are designed to capture usage metadata only, such as:
Token counts (input and output)
Model type and latency
Subscriber, organization, and product identifiers
Optional quality or classification metrics
This enables precise cost tracking, performance alerts, and usage-based billing β without exposing any user-generated content.
What data does Revenium collect?
Revenium receives and stores:
Structured
usage_metadata
fields you explicitly provideToken usage and timing metadata returned by the AI model
Diagnostic and performance data to support analytics and alerting
Revenium does not:
Access or infer prompt or response content
Perform NLP, classification, or logging of raw payloads
If you're using our middleware, no model request or response content is sent to Revenium β only metadata derived from the API call is transmitted.
Where is data stored and processed?
All data is stored in secure cloud environments that comply with modern enterprise security standards. If you require region-specific storage or audit controls, please contact [email protected].
π§ Advanced Topics
What if I use multiple credentials for one user?
You can:
Send the same
subscriber.id
with differentcredential.value
Revenium will track usage per credential and roll it up by subscriber.
Useful for device-based segmentation where a user may wish to share a license among multiple parties, but still know how much each party uses the service.
How can I programmatically reconcile usage with my own systems?
Use our reporting APIs or export logs from:
AI Transactions
Cost breakdowns by org, subscriber, or product
Alerts and system logs
Contact [email protected] if you need a custom export format we don't already support. (this is an area of continued development for us, so we'd love to hear your requirements here)
π€ Direct API Integration
When should I use the direct API instead of middleware?
Use the direct API if:
You want full control over payloads and batching
Youβre instrumenting AI workloads outside of standard LLM clients
See Direct API Integration for an example.
Still have questions? Contact support β
Last updated
Was this helpful?