Convex Agents Usage Tracking

Log LLM token usage and billing data for Convex Agents.

25|4|Updated Oct 18, 2025
One-click install
npx skills add https://github.com/Sstobo/convex-skills --skill convex-agents-usage-tracking-sstobo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Convex Agents Usage Tracking
Source: https://github.com/Sstobo/convex-skills/tree/main/convex-agents-usage-tracking
Command: npx skills add https://github.com/Sstobo/convex-skills --skill convex-agents-usage-tracking-sstobo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill logs LLM token usage and billing data for Convex Agents, enabling accurate cost tracking, invoicing, and performance optimization.

Core Features & Use Cases

  • Usage logging: Record token usage per user, thread, and agent to support billing and analytics.
  • Billing & Invoicing: Generate invoices and cost reports from collected usage data.
  • Analytics & Monitoring: Analyze usage by user, agent, and time period to optimize cost and efficiency.

Quick Start

Enable a usageHandler in your agent to log usage with internal.usage.recordUsage and review monthly invoices for your team.

Frequently Asked Questions about Convex Agents Usage Tracking

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I track LLM token usage for billing in Convex Agents?

To track LLM token usage for billing in Convex Agents, enable a usageHandler in your agent to log usage with internal.usage.recordUsage. This records token consumption per user and thread to support accurate cost tracking and invoicing workflows.

What is per-agent token billing and how does cost monitoring work?

Per-agent token billing records LLM token consumption and computes costs for individual agents and users. Cost monitoring works by logging usage data and exposing monthly and all-time analytics to help teams optimize operational efficiency.

Can I generate invoices and cost reports from Convex Agents usage data?

Yes, you can generate invoices and cost reports from Convex Agents usage data. The skill logs token usage per user, thread, and agent, allowing you to compute costs and extract billing data for team invoicing workflows.

Does Convex Agents usage tracking support per-user and team-level analytics?

Convex Agents usage tracking supports per-user and team-level analytics by recording token usage across users and threads. It exposes monthly and all-time analytics, enabling teams to analyze usage by agent and time period for cost optimization.

What's the best way to monitor token costs across multiple agents?

The best way to monitor token costs across multiple agents is to apply a usageHandler that logs usage with internal.usage.recordUsage. This captures per-agent billing data and exposes analytics to analyze usage by agent and time period.