Skip to main content

Compare LLM token costs across 350+ models with OpenRouter

Workflow preview

Workflow preview
100%
Compare LLM token costs across 350+ models with OpenRouter preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This n8n template lets you run prompts against 350+ LLM models and see exactly what each request costs with real time pricing from OpenRouter Use cases are many: Compare costs across different mode...

Best for

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

Tools used

@n8n/n8n-nodes-langchain.chattrigger, n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.code, n8n-nodes-base.filter, n8n-nodes-base.form, n8n-nodes-base.splitout, 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 Philflow.

Original n8n.io source

1.1 Workflow description

Title
Compare LLM token costs across 350+ models with OpenRouter
Workflow name
Compare LLM token costs across 350+ models with OpenRouter

This n8n template lets you run prompts against 350+ LLM models and see exactly what each request costs with real-time pricing from OpenRouter

Use cases are many: Compare costs across different models, plan your AI budget, optimize prompts for cost efficiency, or track expenses for client billing!

Good to know

  • OpenRouter charges a platform fee on top of model costs. See OpenRouter Pricing for details.
  • You need an OpenRouter account with API credits. Free signup available with some free models included.
  • Pricing data is fetched live from OpenRouter's API, so costs are always up-to-date.

How it works

  1. All available models are fetched from OpenRouter's API when you start.
  2. You select a model and enter your prompt via the form (or just use the chat).
  3. The prompt is sent to OpenRouter and the response is captured.
  4. Token usage (input/output) is extracted from the response using a LangChain Code node.
  5. Real-time pricing for your selected model is fetched from OpenRouter.
  6. The exact cost is calculated and displayed alongside your AI response.

How to use

  • Chat interface: Quick testing - just type a prompt and get the response with costs.
  • Form interface: Select from all available models via dropdown, enter your prompt, and get a detailed cost breakdown.
  • Click "Show Details" on the result form to see the full breakdown (input tokens, output tokens, cost per type).

Requirements

Customising this workflow

  • Add a database node to log all requests and costs over time
  • Connect to Google Sheets for cost tracking and reporting
  • Extend with LLM-as-Judge evaluation to also check response quality

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 chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.4

Block 2 - When Executed by Another Workflow

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

Block 3 - Code in JavaScript

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

Block 4 - LangChain Code

Type / Role
@n8n/n8n-nodes-langchain.code - code
Config choices
Version 1

Block 5 - Filter

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

Block 6 - Code in JavaScript1

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

Block 7 - Form

Type / Role
n8n-nodes-base.form - form
Config choices
Version 2.3

Block 8 - Form1

Type / Role
n8n-nodes-base.form - form
Config choices
Version 2.3

Block 9 - Split Out

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

Block 10 - Split Out1

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

Block 11 - Sticky Note1

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

Block 12 - Respond to Chat

Type / Role
@n8n/n8n-nodes-langchain.chat - chat
Config choices
Version 1

Block 13 - Sticky Note2

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

Block 14 - On form submission

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.3

Block 15 - Sticky Note

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

Block 16 - OpenRouter

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 17 - Backend

Type / Role
n8n-nodes-base.executeWorkflow - executeWorkflow
Config choices
Version 1.3

Block 18 - Backend1

Type / Role
n8n-nodes-base.executeWorkflow - executeWorkflow
Config choices
Version 1.3

Block 19 - Get Openrouter models

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 20 - Get Openrouter models1

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 21 - Sticky Note3

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

3. Summary Table

Workflow Compare LLM token costs across 350+ models with OpenRouter
Complexity advanced
Nodes 21
Categories Engineering, AI Chatbot
Author Philflow
Published 24 Dec 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/12100/12100.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 Compare LLM token costs across 350+ models with OpenRouter do?

This n8n template lets you run prompts against 350+ LLM models and see exactly what each request costs with real time pricing from OpenRouter Use cases are many: Compare costs across different mode...

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 Chatbot use case.