AcademyWorkflowsData and reporting

Track AI Agent token usage and estimate costs in Google Sheets

  • Recommendedour rating
  • 1,818views on n8n
Open on n8n.io ↗

Paste it straight onto an n8n canvas with Ctrl+V or Cmd+V.

track-ai-agent-token-usage-and-estimate-costs-in-google-sheets.json

Loading the file...

AI automation

Want this workflow running in your company?

A template is the start. We adapt automations like this to your tools, handle the exceptions, and test and monitor them so they hold up under real load.

  • Free 20-minute call to look at your process
  • Connected to the tools you already use
  • Tested, monitored and documented

We have not written a full description for this item yet. The text below comes from its authors.

This n8n template demonstrates how to obtain token usage from AI Agents and places the data into a spreadsheet that calculates the estimated cost of the execution. Obtaining the token usage from AI Agents is tricky, because it doesn't provide all the data from tool calls. This workflow taps into the workflow execution metadata to extract token usage information. Works well with OpenAI, Google and

Connects

Google Sheets · AI Agent · Anthropic Chat Model · OpenAI Chat Model · Google Gemini Chat Model · Think Tool