n8n Integration

Know what every
n8n workflow costs.

TokenSense is a drop-in AI gateway for n8n. Change one URL in your credentials, and every AI call gets logged with its exact cost, token count, and the workflow that made it. Works with OpenAI, Anthropic, and Gemini nodes.

No credit card · 10k requests/mo free · 5-min setup

my-instance.n8n.cloud
Webhook
🤖
AI Agent
🛡
TokenSense
gateway
OpenAI
$0.024 · 1,847 tokens

Your n8n AI costs are a black box.
The meter is always running.

$412
burned overnight

A workflow looped on GPT-4. No caps, no alerts, no kill switch. Just a bill you found on Monday.

$0
cost visibility

OpenAI shows one number. Anthropic another. No breakdown by workflow or project.

1 key
all your workflows

One key shared across every n8n workflow. One rate limit takes everything down.

???
cost per workflow

Your CFO asks what the Lead Qualifier costs to run. You don't know. Nobody does.

One URL change. Full visibility.

Before
n8n workflow
OpenAI / Anthropic
  • No per-workflow costs
  • No budget caps
  • No usage logs
  • One shared API key
After
n8n workflow
TokenSense
OpenAI / Anthropic
  • Cost per workflow, per model
  • Budget caps that block spend
  • Every request logged
  • Per-project API keys

Running in five minutes.

Name your workspace and we'll generate the exact URL to paste into your n8n credentials.

1Your workspace name
2Which n8n credential type?
3Paste this into your n8n credential “Base URL” field
https://api.tokensense.io/v1

In n8n: Credentials → OpenAI → Base URL

n8n appends /chat/completions automatically — use /v1 as the base.

Three steps, zero friction

1

Sign up & grab your endpoint

Create a free TokenSense workspace. You get your endpoint URL and API key instantly — no approval, no waitlist.

2

Add your provider keys

Paste your OpenAI, Anthropic, or Gemini keys into TokenSense Settings. Encrypted with AES-256-GCM — only used to forward your requests.

3

Swap the URL in n8n

In your n8n credential settings, change the base URL to your TokenSense endpoint. That's it — your workflows run exactly the same.

Full visibility, zero code

Per-workflow cost tracking

See exactly what each workflow spends on AI calls. No tagging, no custom headers — automatic attribution.

Budget caps that enforce

Set monthly or daily limits per workspace or project. When the cap is hit, requests stop — not just an alert.

Multi-provider routing

Route to OpenAI, Anthropic, Gemini, Mistral, and xAI through a single endpoint. Switch providers without changing workflows.

Real-time usage logs

Every AI call logged with tokens, cost, model, latency, and status. Filter by workflow, project, model, or time range.

Under 50ms overhead

Parallel enforcement checks and async logging. Your workflows stay fast — TokenSense adds minimal overhead.

Smart alerts

Budget thresholds, error spikes, latency degradation, and spend anomalies. Get notified before the bill surprises you.

Works with the nodes you already use

Any n8n node that lets you set a custom base URL is compatible. Here are the most common ones.

OpenAI Chat Model
AI Agent sub-node
Anthropic Chat Model
AI Agent sub-node
Google Gemini Chat Model
AI Agent sub-node
OpenAI
Standalone node
HTTP Request
Any AI API call

Common questions

TokenSense is a drop-in AI gateway. You change the base URL in your n8n AI credentials to point at TokenSense instead of the provider directly. TokenSense forwards requests, logs everything, enforces budgets, and sends responses back. Your workflows run exactly the same — they just gain full cost visibility.

TokenSense works with n8n's built-in OpenAI, Anthropic (Claude), and Google Gemini nodes, plus the AI Agent Chat Model sub-nodes. It also works with HTTP Request nodes making AI API calls. Any node that lets you set a custom base URL is compatible.

Minimal — typically under 50ms per request. Enforcement checks (auth, quota, budget) run in parallel, and logging happens asynchronously after the response is returned to your workflow.

Yes. You add your own OpenAI, Anthropic, or Gemini keys to TokenSense. They're encrypted with AES-256-GCM and only used to forward your requests. You can also set up per-project keys if you manage multiple clients.

No. The base setup only requires changing a URL and API key in your existing n8n credentials. We also offer an optional community node (n8n-nodes-tokensense) with extra features like dynamic model dropdowns and metadata injection, but it's not required.

Yes. The Starter plan is free and includes 10,000 AI requests per month, full cost tracking, and budget caps. No credit card required.

See what your n8n workflows actually cost.

Free to start. 10,000 requests/month on the Starter plan. No credit card required.

No credit card required · 5-minute setup