Skip to main content

Track LLM costs and usage across OpenAI, Anthropic, Google and more

Workflow preview

Workflow preview
100%
Track LLM costs and usage across OpenAI, Anthropic, Google and more preview
Open on n8n.io

1. Workflow Overview

Installation Steps 1. Go to Settings → n8n API and create an API key 2. Add it as credential for the Get Execution Data node 3. Review model mappings in Standardize Names node 4. Review pricing in ...

Best for

  • Engineering automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.code, n8n-nodes-base.set, n8n-nodes-base.n8n, n8n-nodes-base.if, n8n-nodes-base.merge, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Aldayel.

Original n8n.io source

1.1 Workflow description

Title
Track LLM costs and usage across OpenAI, Anthropic, Google and more
Workflow name
Track LLM costs and usage across OpenAI, Anthropic, Google and more

Installation Steps

  1. Go to Settings → n8n API and create an API key
  2. Add it as credential for the Get Execution Data node
  3. Review model mappings in Standardize Names node
  4. Review pricing in Model Prices node

To Monitor a Workflow

  1. Add Execute Workflow node at the end of your target workflow
  2. Select this monitoring workflow
  3. Turn OFF "Wait For Sub-Workflow Completion"
  4. Pass { "executionId": "{{ $execution.id }}" } as input

Prerequisites

Enable "Return Intermediate Steps" in your AI Agent settings for best results.

Supported Providers

OpenAI · Anthropic · Google · DeepSeek · Meta · Mistral · xAI · Cohere · Alibaba Qwen · Moonshot Kimi

120+ Model Variations Mapped

Includes all versioned variants (e.g., gpt-4o-2024-08-06 → gpt-4o)

Prices sourced from official provider pages (March 2026)

Output Data

Per LLM Call

  • Cost Breakdown (prompt, completion, total USD)
  • Token Metrics (prompt, completion, total)
  • Performance (execution time, finish reason)
  • Content Preview (first 100 chars I/O)
  • Model Parameters (temp, max tokens, timeout)
  • Execution Context (workflow, node, status)
  • Flow Tracking (previous nodes chain)

Summary Statistics

  • Total executions and costs
  • Breakdown by model type
  • Breakdown by node
  • Average cost per call
  • Total execution time

💡 You can do anything with this data!

  • Store in a database for historical tracking
  • Send to Teams as a cost alert
  • Build dashboards with the summary data
  • Set budget thresholds and trigger warnings
  • Export to Google Sheets for reporting

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When Called By Another Workflow

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 2 - Test with Execution ID

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 3 - Extract Execution ID

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 4 - Get Execution Data

Type / Role
n8n-nodes-base.n8n - n8n
Config choices
Version 1

Block 5 - Extract Token Usage

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - Find Nodes with LLM Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Standardize Names

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - All Models Defined?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 9 - Stop and Error

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3

Block 11 - Model Prices

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Generate Summary

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Sticky Note - Setup

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note - Output

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note - User Config

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note - Providers

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note - Next Steps

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Track LLM costs and usage across OpenAI, Anthropic, Google and more
Complexity advanced
Nodes 17
Categories Engineering, AI Summarization
Author Aldayel
Published 31 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/14536/14536.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Track LLM costs and usage across OpenAI, Anthropic, Google and more do?

Installation Steps 1. Go to Settings → n8n API and create an API key 2. Add it as credential for the Get Execution Data node 3. Review model mappings in Standardize Names node 4. Review pricing in ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, AI Summarization use case.