API Reference
Log In
API Reference

Meter AI Video Operation

Submit video generation/editing metadata for metering and billing purposes.

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

AI video operation metadata including duration, credits, and video-specific attributes

The AI video operation metadata

string | null

Unique identifier for this specific AI video 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 video calls that belong to the same overall user request or workflow. For example, if a single user query triggers multiple AI calls (e.g., generation + upscale), 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 video operation. Should match the exact model name from your AI provider (e.g., 'gen-3', 'gen-2', 'pika-1.0', 'sora'). 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: 'RunwayML' (for Gen-2/Gen-3), 'Pika', 'OpenAI' (for Sora), 'Luma AI', 'Stability AI'.

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 video operation finished, in ISO 8601 format with UTC timezone. For async/queued jobs, this is when the video was ready for download. For sync requests, this is when the complete response was received. Used to calculate total request duration.

int64
required

The total duration of the AI video 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 video operation. Valid values: 'generation', 'upscale', 'extend', 'edit'. Invalid values will be rejected with HTTP 400. Important for billing: upscale is typically much cheaper than generation - missing values are accepted with a warning.

double | null

The total cost in USD for this video operation. Typically leave null to let Revenium automatically calculate the total based on duration, credits, 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 video 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 video 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 video 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 video 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 video operation is doing in business terms. Examples: 'Generate Product Video', 'Create Marketing Clip', 'Upscale User Content'. Used in trace visualization for better readability. Falls back to taskType if not provided.

int32 | null

Retry attempt number for this AI video 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., 'marketing_video_generation', 'product_demos'). 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., 'Marketing Video Q4 2025'). 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 video operation failed. Include this field when the AI provider returns an error (e.g., content policy violation, rate limit exceeded, job failed). 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, 504). 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 video metadata. This field is AUTOMATICALLY SET by Revenium's middleware packages (e.g., 'revenium-runway-python', 'revenium-pika-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: 'video-generation', 'marketing-videos', 'product-demos', 'social-content'. This is freeform text - choose values that match your use cases.

double
required

Video duration in seconds. Required for all video operations.

int32 | null

Frames per second.

string | null

Video resolution (e.g., '1920x1080', '4K', 'HD').

double | null

Credits consumed (for credit-based pricing like RunwayML).

string | null

Async video job identifier for batch/queued processing. Named videoJobId to distinguish from other async job types (e.g., batch completions, image generation).

double | null

Requested video duration in seconds (what user asked for). Required for per-second billing (Google Veo). Used for analytics and partial billing scenarios.

double | null

USD conversion rate for credit-based billing (e.g., RunwayML $0.01/credit).

boolean | null

Whether this is an async/long-running operation (e.g., Veo video generation).

string | null
enum

Completion status for async operations.

Allowed:
string | null

Links this operation to a source transaction (e.g., upscale links to original generation).

string | null

Input prompts/messages for this video generation. 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., generated video URLs, dimensions). 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 video: PER_SECOND (Google Veo) or CREDITS (RunwayML). Routes cost calculation in backend. Defaults to PER_SECOND if not specified.

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.

string | null

Google priority tier: 'best_effort' (-30%), 'on_demand' (base), 'committed' (-20%).

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
*/*