• MONEY
  • USAGE
  • BUDGET
  • HUMAN

How to track LLM token costs with your AI

Connect New Relic AI to your agent to turn raw telemetry into clear dollar amounts. You get immediate visibility into what your LLM calls are actually costing you.

Ask AI about this page

Short answer

How can I track my LLM token costs?

Your agent uses the query_llm_costs tool to pull real-time USD consumption data directly from your New Relic telemetry. You can ask for specific cost breakdowns by model, service, or time range to see exactly where your budget is going.

Cost visibility outcomes.

Where your spending lands.

The AI translates complex telemetry into actionable financial data.

MONEY

Real-time USD tracking

The agent pulls current spending data from your infrastructure. You see the actual dollar impact of your LLM usage immediately.

USAGE

Token consumption analysis

Get a breakdown of how many tokens are being burned across different models. This helps you spot inefficient prompts or runaway loops.

BUDGET

Threshold monitoring

Ask your agent to compare current spending against your set limits. It identifies when costs are trending toward a budget overrun.

HUMAN

Manual cost adjustments

The AI only reads and reports data. You remain responsible for setting budget limits and making changes in your New Relic dashboard.

The workflow

What your AI does when you ask about costs.

The agent bridges the gap between your New Relic logs and your chat interface.

  1. Fetch telemetry

    The agent reaches into your New Relic environment to find relevant LLM performance and cost metrics.

    query_llm_costs
  2. Calculate USD totals

    It processes the raw token counts and applies your specific pricing models to find the total dollar spend.

    query_llm_costs
  3. Filter by model

    The agent isolates costs for specific LLMs, such as those used in your production agents or testing environments.

    query_llm_costs
  4. Report findings

    The agent presents the final cost numbers in a clean, readable format within your chat window.

    query_llm_costs

Try it

Copy these to start.

Use these prompts to get immediate answers from your agent.

Starting points

Replace the bracketed text with your specific model names or timeframes.

New Relic AI Connector

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

Connector linkhttps://edge.vinkius.com/vk_preview_oqdaAroeFoXBv9yPI4WsHZZZZZuzqhwVoSn1YCyq/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 — New Relic AI capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "new-relic-ai-llm-observability-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_oqdaAroeFoXBv9yPI4WsHZZZZZuzqhwVoSn1YCyq/mcp"
    }
  }
}
Copy into chat04
  • How much did we spend on GPT-4o tokens in the last 24 hours?

  • Show me the total USD cost for all LLM calls made yesterday.

  • Which model is currently driving the highest token costs in our production environment?

  • Compare the token usage between our staging and production clusters for this week.

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

Start here

Connect New Relic AI once, then ask.

Just link your account once. Your credentials stay encrypted and secure, and you can start querying costs immediately in any compatible client.

Connect New Relic AI to your AI

FAQ

How this task behaves

  • 01

    Can the AI change my New Relic settings?

    No. The agent can only read cost and usage data. It cannot modify your New Relic configurations or alert settings.

  • 02

    Does the AI know my specific pricing per token?

    Yes, it uses the pricing data available in your New Relic telemetry to calculate the USD amounts.

  • 03

    Can the AI delete old telemetry data?

    No. The agent has no permission to delete or alter any data within your New Relic account.

  • 04

    Can I ask for costs by specific API keys?

    Yes, if your New Relic telemetry includes those attributes, the agent can filter by them.

  • 05

    Will the AI automatically stop my services if I go over budget?

    No. The agent only reports on the costs. You must set up your own automated scaling or shutdown policies in your infrastructure.

  • More questions about New Relic AI? The Connector page answers them. See everything the New Relic AI Connector can do

Connect New Relic AI to Claude, Cursor, ChatGPT & more