API Reference
Log In
API Reference

Meter AI Audio Operation

Submit audio operation metadata (transcription, TTS, translation, real-time audio) for metering and billing purposes.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

AI audio operation metadata including duration, character count, and audio-specific attributes

The AI audio operation metadata

string | null

Unique identifier for this specific AI audio transaction. Used for deduplication, correlation with request/response pairs, and transaction lookup in Revenium analytics. If not provided, a UUID will be auto-generated. For best practices, generate a UUID in your application before making the AI call and use the same ID when submitting to Revenium. You can use either 'spanId' (recommended) or 'transactionId'.

string | null

Optional trace identifier to group multiple related AI audio calls that belong to the same overall user request or workflow. For example, if a single user query triggers multiple AI calls (e.g., transcription + translation), use the same traceId for all calls to analyze them together in Revenium's analytics. Leave null for standalone operations.

string
required

The AI model identifier used for this audio operation. Should match the exact model name from your AI provider (e.g., 'whisper-1', 'tts-1-hd', 'gpt-4o-realtime-preview'). This is used for cost calculation, performance analytics, and model comparison reporting in Revenium. Valid model names in Revenium for proper cost estimate can be verified using the sources/ai/models endpoint.

string
required

The underlying AI provider/vendor whose model is actually processing the request. This identifies which company's AI model is being used, regardless of how you're accessing it (direct API, proxy, or gateway).

Common values: 'OpenAI' (for Whisper, TTS), 'Anthropic', 'Google', 'AssemblyAI', 'ElevenLabs', 'Deepgram'.

Custom values are accepted but may affect analytics categorization. If using Revenium middleware, this is typically auto-populated from the AI provider's API response.

string
required

The timestamp when your application sent the request to the AI provider, in ISO 8601 format with UTC timezone (e.g., '2025-03-02T15:04:05Z'). This is used to calculate request duration and analyze usage patterns over time. Set this to the time immediately before calling the AI provider's API.

string
required

The timestamp when the AI audio operation finished, in ISO 8601 format with UTC timezone. For streaming requests, this is when the last data was received and the stream closed. For non-streaming requests, this is when the complete response was received. Used to calculate total request duration.

int64
required

The total duration of the AI audio request in milliseconds, from request start to completion. Calculated as (responseTime - requestTime). This includes network latency, AI processing time, and any mediation/gateway overhead. Used for performance analytics and SLA monitoring.

string | null
enum

The type of operation performed

string | null

Technical classification of the specific audio operation. Valid values: 'transcription', 'translation', 'synthesis', 'speech', 'tts', 'realtime'. Invalid values will be rejected with HTTP 400. Required for proper billing routing (determines per-second vs per-character vs per-token billing) - missing values are accepted with a warning.

double | null

The total cost in USD for this audio operation. Typically leave null to let Revenium automatically calculate the total based on duration/characters and current pricing. Only provide a value if you have custom pricing agreements or want to override Revenium's cost calculation. If provided, this will override Revenium's automatic calculation.

string
enum

The type of cost being tracked. Currently always 'AI' for AI audio costs. This field is used internally by Revenium to categorize different types of metered usage. You typically do not need to set this field as it defaults to 'AI'.

Allowed:
string | null

The name of the subscriber's organization from your system to allow Revenium to track usage & costs by company. i.e. AcmeCorp. If several subscriberIds have the same organizationName, Revenium's reporting will show usage for the entire organization broken down by subscriberId. This field is used for lookup and auto-creation of organizations in Revenium.

string | null

Unique identifier of the subscription from your own system that you wish to use to correlate usage between Revenium & your application.

string | null

The name of the product from your system that you wish to use to correlate usage between Revenium & your application. This field is used for lookup and auto-creation of products in Revenium.

string | null

The AI agent that is making the request

string | null

Deployment environment where this AI audio operation was executed. Used for filtering and analyzing usage patterns across different deployment stages. Common values: 'production', 'staging', 'development', 'test'. Leave null if not tracking by environment.

string | null

Cloud region or geographic location where this AI audio operation was processed. Used for analyzing latency patterns, compliance requirements, and regional cost differences. Examples: 'us-east-1', 'eu-west-1', 'ap-southeast-2'. Leave null if not tracking by region.

string | null

Parent transaction ID for hierarchical tracing. When an AI audio operation is part of a larger workflow or spawned by another AI call, this field references the parent's spanId/transactionId. Used to build transaction trees and understand call hierarchies in complex multi-step AI workflows. Leave null for root-level transactions. You can use either 'parentSpanId' (recommended) or 'parentTransactionId'.

string | null

Human-readable name for this transaction. Provides context about what this AI audio operation is doing in business terms. Examples: 'Transcribe Meeting', 'Generate Podcast Intro', 'Translate Customer Call'. Used in trace visualization for better readability. Falls back to taskType if not provided.

int32 | null

Retry attempt number for this AI audio operation. 0 indicates the first attempt (no retry), 1 indicates first retry, 2 indicates second retry, etc. Used for analyzing failure rates and retry patterns. Each retry attempt should be a separate transaction with incrementing retryNumber and the same traceId. Leave null or set to 0 for first attempts.

string | null

Categorical identifier for grouping similar workflows (e.g., 'meeting_transcription', 'podcast_generation'). Enables trace-level analytics and anomaly detection within workflow cohorts. Must contain only alphanumeric characters, hyphens, and underscores. Max 128 characters. Defaults to 'uncategorized' if not provided or invalid. All transactions in the same trace must have the same traceType.

string | null

Human-readable label for individual trace instances (e.g., 'Weekly Standup - Week 42'). Enables finding specific workflow executions. Can contain any UTF-8 string. Max 256 characters. All transactions in the same trace must have the same traceName.

string | null

Identifier for multi-agent framework team or squad (e.g., ARK, CrewAI). Used to group AI operations by agent team for analytics and cost tracking. Free-form string, max 256 characters.

string | null

Human-readable name for the squad type (e.g., 'Loan Processing', 'Document Analysis'). Used for display in the UI and analytics grouping. If squadId is provided without squadName, squadId will be used as the display name.

string | null

The agent's role within this squad execution (e.g., 'Document Extractor', 'Credit Checker'). Used to identify the purpose of each agent's contribution to the squad workflow.

string | null
^(?!types$|conversion-funnel$)[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}$

Unique identifier for the agentic job instance. Used to correlate all AI operations within a single job execution. Should be unique per job run (e.g., UUID or meaningful ID like 'loan-123-processing').

string | null

Human-readable name for the agentic job. Used for display in the UI and analytics grouping. If agenticJobId is provided without agenticJobName, the ID will be used as the display name.

string | null

Category or type of the agentic job. Normalized to lowercase on ingest to prevent data fragmentation. Used for grouping jobs by type in analytics and ROI calculations.

string | null

Version identifier for the job definition. Used to track job evolution and compare performance across versions.

string | null

Error message or reason if the AI audio operation failed. Include this field when the AI provider returns an error (e.g., audio too long, unsupported format, rate limit exceeded, content policy violation). Used for error rate analytics and debugging. Leave null for successful operations.

int32 | null

HTTP error code if the operation failed (e.g., 429, 503, 500). Used with billingSkipped to determine no-charge scenarios.

subscriber
string | null

Identifier of the Revenium middleware package or SDK that captured and submitted this AI audio metadata. This field is AUTOMATICALLY SET by Revenium's middleware packages (e.g., 'revenium-openai-python', 'revenium-assemblyai-node'). You typically should NOT manually set this field. It is used for analytics to track which integration methods are being used and for debugging middleware-specific issues.

string | null

The routing or aggregation layer used to access the AI model. This identifies whether you're calling the AI provider directly or through an intermediary service.

Common values: 'DIRECT', 'LITELLM', 'OPENROUTER', 'PORTKEY', or provider names when calling directly.

Custom values are accepted for specialized routing layers or gateways. This field is used for integration tracking and analytics.

string | null

Optional category to group related AI tasks for cost and performance analysis. Use consistent values to compare metrics across different models or vendors performing the same type of work. Examples: 'transcription', 'tts', 'translation', 'voice-clone'. This is freeform text - choose values that match your use cases.

double | null

Audio duration in seconds. Required for transcription/translation operations (duration-based billing).

int64 | null

Number of input audio tokens (for real-time audio models like gpt-4o-realtime).

int64 | null

Number of output audio tokens (for real-time audio models).

int64 | null

Character count for TTS/speech operations. Required for per-character billing.

int32 | null

Audio sample rate in Hz.

string | null

Language code (ISO 639-1) for the audio content.

string | null

Response format for transcription (e.g., 'verbose_json', 'json', 'text', 'srt', 'vtt'). Note: 'verbose_json' is required to get duration from Whisper. Does not affect pricing.

string | null

TTS voice selection (e.g., 'alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'). Does not affect pricing.

double | null

TTS speed setting (0.25 to 4.0). Does not affect pricing.

string | null

Source language for translation operations.

string | null

Target language for translation operations. For Whisper translate, always 'english'.

string | null

Audio format (e.g., 'mp3', 'wav', 'flac', 'opus', 'aac'). Used for analytics and debugging. Does not affect pricing.

string | null

Quality setting for TTS (e.g., 'standard', 'hd'). HD quality (tts-1-hd) typically costs 2x standard (tts-1).

int64 | null

Number of input text tokens for real-time audio models. Realtime API has different rates: text at $5/1M vs audio at $100/1M.

int64 | null

Number of output text tokens for real-time audio models. Realtime API has different rates: text output at $20/1M vs audio at $200/1M.

string | null

Input prompts/messages for this audio operation. JSON-serialized array of messages in the same format as the LLM endpoint. Used for prompt analytics and cost attribution.

string | null

Output response content or metadata (e.g., transcription text, generated audio URLs). Used for analytics and audit trail.

boolean | null

Indicates if prompts were truncated due to size limits.

string
enum

How this operation should be billed. For audio: PER_SECOND (Whisper transcription/translation), PER_CHARACTER (TTS), or PER_TOKEN (realtime). Routes cost calculation in backend. Defaults to PER_SECOND if not specified. Use PER_MINUTE with custom pricing dimensions if needed.

Allowed:
boolean | null

If true, backend returns $0 cost. Set for free tier, rate-limited requests, or other no-charge scenarios.

string | null
enum

Reason why billing was skipped.

Allowed:
string | null
enum

Pricing tier for batch discounts. BATCH = 50% discount, STANDARD = normal pricing.

Allowed:
string | null

Service tier requested by user (e.g., 'priority', 'default', 'flex').

string | null

Actual service tier used for billing. May differ from requested if downgraded.

boolean

Whether this is a real-time/streaming audio operation (e.g., OpenAI Realtime API). Real-time operations have different pricing structures with separate audio and text token rates.

Headers
string
length between 1 and 255
^[!-~]+$

Optional Stripe-style retry-safety key. If present, the response (status + body) is cached keyed by (tenant, key). Identical retries replay the cached response; body mismatch returns 409 idempotency_key_mismatch; a concurrent in-flight call returns 409 idempotency_key_in_progress with Retry-After: 1. Must be 1-255 printable ASCII characters; UUID v4 recommended. See https://docs.revenium.io/integrations/idempotency for full behavior.

string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
*/*