• USAGE
  • COST
  • AUDIT
  • HUMAN

How to track agent token costs with your AI

Connect AgentOps to your AI client once. From then on, you can ask your agent to pull exact usage data from any specific trace.

Ask AI about this page

Short answer

How can I see how many tokens my agent is using?

Ask your AI to retrieve metrics for a specific trace ID. It will pull the exact token counts and cost data from AgentOps. You'll get a clear breakdown of usage per trace.

The outcomes

What you get from your agent

Your AI uses AgentOps data to provide these specific insights.

USAGE

Token count breakdown

The AI pulls specific input and output token numbers for a trace. You see exactly how much each step costs.

COST

Direct cost analysis

Your agent calculates the monetary cost of a trace based on the retrieved metrics. This helps you spot expensive loops.

AUDIT

Trace-level visibility

The AI identifies which specific agent actions drove up your bill. You get a granular view of every execution.

HUMAN

Manual budget adjustments

The AI provides the data, but you decide how to change your prompt logic or model settings to save money.

The workflow

What your AI does when you ask for metrics.

The AI acts as a bridge between your chat interface and your AgentOps telemetry.

  1. Identify the trace

    Your agent looks for the specific trace ID you mentioned in your request.

    get_trace_metrics
  2. Fetch telemetry

    The AI calls the tool to pull the raw token and cost data for that trace.

    get_trace_metrics
  3. Calculate totals

    The agent sums up the input, output, and total costs from the retrieved data.

    get_trace_metrics
  4. Report findings

    The AI presents the cost breakdown in a readable format in your chat window.

    get_trace_metrics

Try it

Copy these to start.

Paste these prompts into your AI client to begin.

Starting points

Replace the trace IDs and agent names with your actual data from your AgentOps dashboard.

AgentOps Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_OCln8CM8I7G7rNCo6QKijZPwPeMGY7W7gj6qBqEG/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — AgentOps capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "agentops-agent-telemetry-and-monitoring-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_OCln8CM8I7G7rNCo6QKijZPwPeMGY7W7gj6qBqEG/mcp"
    }
  }
}
Copy into chat04
  • Get the token usage and total cost for trace ID 12345.

  • How many tokens did the agent use in trace abc-789?

  • Show me the cost breakdown for the last agent trace I ran.

  • Which trace in my recent history had the highest token consumption?

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect AgentOps once, then ask.

Just link your account once. Your credentials stay encrypted, and you can immediately start asking your AI about your telemetry.

Connect AgentOps to your AI

FAQ

Common questions

  • 01

    Can the AI change my AgentOps settings?

    No. The AI can only read metrics from existing traces. It cannot modify your AgentOps configuration or account settings.

  • 02

    Does the AI delete any traces?

    No. The AI only retrieves data. It has no capability to delete or overwrite your telemetry data.

  • 03

    Can I see costs for all agents at once?

    The current tool focuses on retrieving metrics for specific traces. You'll need to provide the trace ID for the data you want.

  • 04

    Do I need to provide the trace ID every time?

    Yes. To get accurate cost data, the AI needs to know which specific trace you are asking about.

  • 05

    Can the AI predict future costs?

    No. The AI only reports on the actual token usage and costs that have already occurred in recorded traces.

  • More questions about AgentOps? See everything the AgentOps Connector can do

Connect AgentOps to Claude, Cursor, ChatGPT & more