Use TokenSense in n8n workflows

Once installed, you have three node types available. This page covers when to use each, plus features that make TokenSense more than a simple proxy.

TokenSense Chat Model

When to use it:Any time you're building an AI Agent workflow and need a language model. Drop it in as the "Language Model" sub-node.

  • Supports streaming responses
  • Supports tool calling (function calling)
  • Works with n8n's built-in memory nodes
  • All requests are tracked with full attribution (workflow, step, execution)

TokenSense AI

When to use it: General-purpose AI calls outside of the Agent pattern — batch processing, one-shot completions, image generation, embeddings, audio transcription.

Five resource types:

  • Chat — Chat Completion, Native Anthropic, Native Gemini
  • Image — Image Generation (DALL-E, etc.)
  • Embedding — Text Embedding
  • Audio — Text-to-Speech, Speech-to-Text
  • Model — List available models

TokenSense AI Tool

When to use it:Multi-agent orchestration. When one AI Agent needs to invoke another AI model as a "tool" — for example, a planning agent that delegates to a coding agent.

The AI Tool node is auto-generated from the TokenSense AI node and shares its parameters. Attach it as a Tool sub-node on your Agent.

Project tagging

Every TokenSense node has a Project field. Setting it tags all requests from that node to a specific project in your dashboard. This is how you keep costs organized when you have multiple clients or teams.

  • Set the same project tag on all nodes in a client's workflow
  • Use consistent naming (e.g., client-acme) across workflows
  • View per-project spend in the dashboard under Projects

Provider Override

When to use it: A/B test providers without rewriting your workflow. Change the model in one field and compare cost/quality/latency.

Example: test the same prompt across three providers:

  • OpenAI gpt-4o
  • Anthropic claude-sonnet-4-20250514 (via Native Anthropic)
  • Google gemini-2.0-flash (via Native Gemini)

Each run logs cost, latency, and token count. Compare them side-by-side in the dashboard under Usage & Costs.

Cost in the execution view

Every TokenSense response includes cost data in the output JSON. In n8n's execution view, you can see the cost of each step without leaving the workflow editor.

For aggregated views across time, projects, and workflows — use the TokenSense dashboard.

Related