Skip to main content

Tracking Credit Consumption

Updated over a week ago

Understanding how credits are consumed at various levels is key to monitoring usage, optimizing billing, and managing your customer activity. Our API provides all the metadata you need to track usage within your own application or business intelligence (BI) environment.

This guide explains how to implement user-level credit tracking and aggregate consumption across users or tenants.

Overview

Every transcript, fact, and document created through the API returns metadata that includes credit usage details. By storing and analyzing this data, you can calculate credit consumption for individual users, tenants, or time periods.

You can track usage at multiple levels by:

  • Storing the unique interaction ID returned by the API

  • Using that ID to tie usage back to your internal user records

  • Pulling all related records (interactions, transcripts, facts, and documents)

  • Aggregating the creditsConsumed field to calculate total usage

  • Storing and visualizing results in your own reporting or BI system


Step 1: Store the Interaction ID Returned from the API

When you create an interaction, the API response includes a unique interactionId.
Store this value in your database and associate it with the relevant user ID or customerID from your application.

Example response (simplified):

{   "interactionId": "int_abc123",   "assignedUserId": "user_12345",   "createdAt": "2025-10-23T10:15:30Z" }

Best Practice:

  • Use your internal userId or tenantId fields to map interactionId values to users.

  • This mapping allows you to aggregate all downstream credit usage (e.g., transcripts, documents, or facts) associated with each interaction.


Step 2: Retrieve Usage Data

You can retrieve credit consumption data using the following API endpoints:

  • Returns all interactions per tenant.

  • Use the createdAt field to segment results by date or time period.

  • Each transcript response includes:

    • creditsConsumed: credits used for transcript and audio processing

    • createdAt: timestamp for time-based tracking

  • Each fact includes:

    • creditsConsumed: credits used for fact creation

    • createdAt: timestamp for time-based tracking

  • Each document includes:

    • creditsConsumed: credits used for document creation

    • createdAt: timestamp for time-based tracking


Step 3: Aggregate and Analyze Usage

Once you have collected all relevant records, aggregate the total creditsConsumed values to calculate:

  • Total usage per interaction

  • Total usage per user (using your internal mapping)

  • Total usage per tenant

  • Usage over a specific time window

Example (simplified):

Interaction ID

User ID

Tenant ID

Date

Credits Consumed

int_abc123

user_12345

tenant_A

2025-10-01

120

int_xyz987

user_67890

tenant_A

2025-10-01

75

int_qwe456

user_98765

tenant_B

2025-10-02

300

Aggregate results to show total usage by user or tenant in your reporting system.


Step 4: Store and Visualize in Your BI Tool

To make this data accessible and useful:

  1. Store all retrieved records (interactionId, userId, tenantId, creditsConsumed, and createdAt) in your own database.

  2. Connect that data to a BI tool or your platform’s native reporting interface.

  3. Use filters and visualizations to track:

    • Credit usage trends over time

    • High-usage users or customers

    • Billing or quota consumption reports

Example Workflow Summary

  1. Create Interactions → Capture and store interactionId with your user and customer mapping

  2. Retrieve Records → Use List endpoints for Interactions, Transcripts, Facts, and Documents

  3. Extract Credits → Use creditsConsumed and createdAt

  4. Aggregate Data → Sum credits by interaction, user, tenant, or date range

  5. Store & Visualize → Save to your database or BI tool for analysis


Have a question for our team?

Click Support in the bottom-left corner of the console to submit a ticket or reach out via email at [email protected] and we'll be happy to assist you.

Did this answer your question?