If you run Agentforce in production, you already know the two questions your leadership keeps asking:
How much AI are we using?
What is it delivering?
The AI Agent Generative AI Usage Data Model helps answer that. It’s a single DMO in Data 360 — refreshed every five minutes — that captures every Agentforce and generative AI interaction, both metered and unmetered, with the fields you need to join it back to users, features, and CRM records. It’s the usage numerator every Agentforce deployment has been missing.
This post is for the people who actually have to build the usage visibility layer — Salesforce admins, Data 360 admins, and analytics teams. If that’s you, you’ll walk away knowing how to:
- Enable audit logging so the usage data starts flowing
- Query the DMO four different ways (Data 360 Query Editor, Data 360 Reports, Tableau Next, or CRMA)
- Convert token counts to a directional Flex Credit cost estimate
- Join usage data to business context — country, brand, cost center, or any variables you already track on Agent Sessions
- Set consumption threshold alerts so you get an early warning before overages hit
By the end, you’ll have the queries, the join patterns, and the checklist to help answer questions such as “is this saving us money?” and “which conversations are driving our usage?” from one place, in near real time.
Why this matters: The usage visibility gap
Across enterprises running Agentforce in production, the same structural problem repeats: Session data, cost data, quality signals, and business outcomes exist in separate systems with no native join. The result? The executive asks, “Is this saving us money?” and the ops team asks, “Which conversations are failing?” Neither can get an answer from one place.
The AI Agent Generative AI Usage Data Model — backed by the AiAgentGenerativeAiUsage_std__dlm DMO — is the cost numerator that every Agentforce deployment needs but has been missing. It tracks all Agentforce and generative AI consumption, both metered (Flex Credits) and unmetered, in near real time.
What the data model covers
The AiAgentGenerativeAiUsage DMO captures every generative AI interaction event processed through Salesforce’s AI Metering Service. Key attributes include:
| Field | What It Tells You |
|---|---|
| IsMeteredIndicator__c | Whether the usage consumed Flex Credits (true) or was unmetered (false) |
| GenAiGatewayFeatureName__c | Which feature generated the call (e.g., AgentforceCoworker) |
| PromptInputTokenCount__c | Tokens sent to the LLM as input |
| PromptCompletionTokenCount__c | Tokens returned in the model response |
| PromptTotalTokenCount__c | Total tokens (input + output) for cost modeling |
| UserId__c | The user ID associated with the interaction |
| Timestamp__c | When the interaction occurred |
| RequestIdentifier__c | Unique identifier for the specific gateway or runtime request |
Prerequisites: Enabling the data model
Before you can query AiAgentGenerativeAiUsage, you need:
- Data 360 (formerly Data Cloud) licensed and provisioned in your org
- Einstein Generative AI Audit & Feedback Data Collection toggled on:
- Go to Setup → search “audit”
- Open Einstein Audit, Analytics, and Monitoring Setup
- Enable Audit and Feedback (required)
- Enable Knowledge/RAG Quality Data and Metrics (recommended for future coverage)
Once enabled, the AiAgentGenerativeAiUsage_std__dlm DMO and several GenAI* DMOs will populate in your Data 360 data stream list after an initial indexing run.
Important: Audit logging captures only new events going forward. Historical usage before you enable the toggle is not backfilled. Enable this as early as possible in your deployment so you have a complete usage history.
Four ways to query and visualize your usage
Option 1: Data 360 Query Editor (fastest start)
Use the Data 360 Query Editor to explore usage directly. A basic starting query:
SQL
SELECT*
FROM “AiAgentGenerativeAiUsage_std__dlm”
LIMIT 100
To see total token consumption by feature over the past 30 days:
SQL
SELECT
GenAiGatewayFeatureName__c AS feature,
SUM(PromptTotalTokenCount__c) AS total_tokens,
COUNT(*) AS total_interactions
FROM “AiAgentGenerativeAiUsage_std__dlm”
WHERE Timestamp__c >= current_date – interval ’30’ day
GROUP BY GenAiGatewayFeatureName__c
ORDER BY total_tokens DESC
To separate metered from unmetered usage (critical for unmetered SKU customers who need to quantify the value of their Agentforce licenses):
SQL
SELECT
IsMeteredIndicator__c,
SUM(PromptTotalTokenCount__c) AS total_tokens,
COUNT(*) AS interaction_count
FROM “AiAgentGenerativeAiUsage_std__dlm”
GROUP BY IsMeteredIndicator__c
Option 2: Data 360 Reports
Build a native Data 360 report using the AI Agent Generative AI Usage report type. No SQL required. Filter by feature name and date range to produce a shareable consumption view for stakeholders. To add user names, you’ll need to join the DMO with ssot__User__dlm via a Data Transform (see Option 3).
Option 3: Tableau or Tableau Next (recommended for Dashboards)
Tableau Next is the recommended path for production dashboards. Join AiAgentGenerativeAiUsage_std__dlm with the standard User DMO on UserId__c = ssot__Id__c to surface usage by user name:
SQL
SELECT
usr.ssot__FullName__c AS user_name,
usg.GenAiGatewayFeatureName__c AS feature,
SUM(usg.PromptTotalTokenCount__c) AS total_tokens,
SUM(CASE WHEN usg.IsMeteredIndicator__c = true THEN usg.PromptTotalTokenCount__c ELSE 0 END) AS metered_tokens,
SUM(CASE WHEN usg.IsMeteredIndicator__c = false THEN usg.PromptTotalTokenCount__c ELSE 0 END) AS unmetered_tokens
FROM “AiAgentGenerativeAiUsage_std__dlm” usg
JOIN “ssot__User__dlm” usr
ON usg.UserId__c = usr.ssot__Id__c
GROUP BY usr.ssot__FullName__c, usg.GenAiGatewayFeatureName__c
ORDER BY total_tokens DESC
This produces a user-level consumption view that can feed leadership dashboards for chargebacks, spend visibility, and metered vs unmetered usage.
Option 4: CRM Analytics (CRMA)
For customers with CRMA, paste a Data 360 DMO query directly into CRMA’s query mode to build interactive visualizations. The same join pattern (usage DMO + User DMO) applies.
Converting tokens to Flex Credit cost
The DMO provides token counts, not Flex Credits directly. Token-to-credit conversion is a close approximation useful for trend analysis and relative comparisons — but the single source of truth for exact Flex Credit consumption is the Digital Wallet. Use the Digital Wallet for billing verification and contractual overage calculations; use the token-based formula below for near-real-time dashboards and directional cost visibility. For the full published rate card, see the Agentforce Flex Credit Rates page.
For non-agentic prompt template invocations (the most cost-effective path):
- Base includes 2,000 tokens (input + output combined) per invocation
- Standard Prompt (GPT-4o): 4 Flex Credits per 2,000-token block
- Every additional 2,000-token block adds another 4 Flex Credits
For Agentforce agent actions:
- Flat rate: 20 Flex Credits per action, regardless of token count
- Standard pricing: $500 per 100,000 Flex Credits ($0.005/credit)
Approximate cost formula for prompt-based usage:
Estimated Flex Credits ≈ CEIL(PromptTotalTokenCount / 2000) × credits_per_prompt_tier
Estimated USD ≈ Estimated Flex Credits × 0.005
SKU matters: A1E/A4X customers consume only Flex Credits for all AI usage. E1E/E4X customers on the split model have prompts consuming Einstein Requests instead of Flex Credits. Check with your AE if you’re unsure which model applies to your org.
Connecting usage data to business context
Token and credit counts are necessary but not sufficient — the real value is attributing AI cost to the business context that drove it. The AiAgentGenerativeAiUsage DMO can be joined to other DMOs for richer analysis. How you do this depends on whether the AI call originated from a direct LLM Gateway invocation (e.g., a Prompt Template called via Flow or Apex) or from an Agentforce agent / messaging session.
Case 1: Direct LLM Gateway usage (Prompt Templates via Flow or Apex)
When a Prompt Template is invoked directly — for example, via a Flow action or an Apex ConnectApi.EinsteinLLM call — the LLM Gateway records the call in GenAIGatewayRequest__dlm. This object carries a PromptTemplateDeveloperName__c field you can use to group cost by template, and a sessionId__c you can use to correlate calls within the same user session.
The join to bring in token cost data looks like this:
SQL
SELECT
req.PromptTemplateDeveloperName__c AS prompt_template,
req.model__c AS model,
SUM(usg.PromptTotalTokenCount__c) AS total_tokens,
COUNT(*) AS invocation_count
FROM “AiAgentGenerativeAiUsage_std__dlm” usg
JOIN “GenAIGatewayRequest__dlm” req
ON usg.RequestIdentifier__c = req.gatewayRequestId__c
GROUP BY req.promptTemplateDevName__c, req.model__c
ORDER BY total_tokens DESC
Case 2: Agentforce agent sessions
When the AI usage is associated with an Agentforce Agent, rows in AiAgentGenerativeAiUsage_std__dlm carry an AiAgentSessionId__c field, which joins directly to ssot__Id__c on ssot__AiAgentSession__dlm:
SQL
SELECT u.*, s.*
FROM AiAgentGenerativeAiUsage_std__dlm u
JOIN ssot__AiAgentSession__dlm s
ON u.AiAgentSessionId__c = s.ssot__Id__c
Once this join is in place, any business context attached to the Agent Session (country, brand, or other session-level attributes) can be linked to the raw AI usage records that occurred during that session. From there, usage metrics such as token counts can be grouped and rolled up by that business context, giving a path from raw model usage to business-level reporting.
Setting up Digital Wallet consumption alerts
The usage DMO gives you visibility, but you also need guardrails. Set up Flex Credit consumption threshold alerts in Digital Wallet via Salesforce Flow:
- Navigate to Setup → Flow
- Find and activate the “Consumption Threshold Alerts” flow template
- Configure recommended thresholds: 75%, 90%, and 100%
- Alerts are delivered via email and can trigger custom Flows for automated responses
Critical: Digital Wallet does not block execution when credits run out. Overages are billed at contracted rates. Alerts are your early warning system — configure them before going to production at scale.
With enablement, queries, dashboards, joins, and alerts all covered, here’s the same path condensed into an implementation checklist.
Quick-start checklist
Work through these steps in order. Each one builds on the previous step.
- Confirm Data Cloud / Data 360 is provisioned and licensed
- Enable Einstein Audit & Feedback in Setup
- Verify AiAgentGenerativeAiUsage_std__dlm appears in your Data 360 data stream list
- Run a baseline query to confirm data is flowing
- Build a usage-by-feature report in Data 360 Reports or Tableau
- Add the IsMeteredIndicator__c split to quantify metered vs unmetered usage
- Set up Flex Credit consumption threshold alerts
- Plan your Agent business context join strategy (Agent Session fields joining with usage DMO)
Once these steps are in place, you’ll have near-real-time usage data attributed to features, users, and business context — the visibility you need to answer both “what is our AI costing?” and “what is it delivering?”
Ready to close your own analytics gap? Take the first step from the list above.