⚒️ Compare LLM token costs across 350+ models with OpenRouter

118 views · ⚒️ Engineering

Description

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

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

Requirements

Customising this workflow

🔗 Nodes Used

HTTP Request, Execute Sub-workflow, Execute Workflow Trigger, Filter, LangChain Code, n8n Form Trigger

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup