npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-tracked-openai

v0.2.0

Published

n8n community node: Vendor-agnostic AI Chat Model with automatic usage tracking via Tokora

Readme

Tracked OpenAI Chat Model for n8n

Know exactly what your AI workflows cost. Drop-in replacement for the built-in OpenAI Chat Model node that automatically tracks every token, every call, every workflow — so you always know where your money goes.

The problem

You're running AI workflows in n8n — agents, chains, automations — and your OpenAI bill keeps growing. But you have no idea which workflow, which model, or which customer is driving the cost. You're flying blind.

The solution

Swap the standard OpenAI Chat Model node for this one. Everything works exactly the same, but now every model call is tracked:

  • Token usage — prompt, completion, and total tokens per call
  • Model — which model was used (captured from the actual API response)
  • Workflow context — which workflow, which execution, which node
  • Cost attribution — optional document/customer ID to tie costs to specific entities

View it all in your Tokora dashboard — broken down by model, workflow, day, or customer.

Getting started

1. Create your Tokora account

Go to app.tokora.ai and sign up. Create a project and copy your Project API Key.

2. Install the node in n8n

Go to Settings → Community Nodes, enter n8n-nodes-tracked-openai, and click Install.

3. Set up credentials

You need two credentials in n8n:

OpenAI API (built-in — you may already have this):

  • API Key: your OpenAI API key

Usage Tracking API (new credential from this package):

  • Tracking Endpoint URL: the endpoint shown in your Tokora dashboard
  • Project API Key: the key from step 1

4. Use it

The node appears under AI → Language Models → Chat Models.

With AI Agent:

  1. Remove your existing OpenAI Chat Model
  2. Add Tracked OpenAI Chat Model
  3. Select your credentials
  4. Done — nothing else changes

With LLM Chain:

  1. Connect Tracked OpenAI Chat Model as the language model
  2. Select your credentials
  3. Done

That's it. Your usage data starts appearing in the Tokora dashboard immediately.

What you can track

| Dimension | Example | |-----------|---------| | Model | gpt-4o vs gpt-4o-mini — see where the expensive calls are | | Workflow | "Customer Support Agent" used 2M tokens this month | | Node | Which step in the workflow is burning tokens? | | Document / Customer | Attribute costs to specific customers or projects | | Time | Daily, weekly, monthly breakdowns |

Node parameters

| Parameter | Description | |-----------|-------------| | Model | Any OpenAI-compatible model name (free text — new models work immediately) | | Document ID | Optional. Tie costs to a specific document, customer, or entity. Supports n8n expressions. | | Options | Temperature, Max Tokens, Top P, Frequency Penalty, Presence Penalty, Timeout, Max Retries |

How it works

This node is a thin wrapper around the standard OpenAI Chat Model. It creates the exact same LangChain ChatOpenAI model that the built-in node uses, with one addition: a lightweight callback that fires after each model call to log token usage and workflow context.

  • Zero latency impact — logging is fire-and-forget with a 3-second timeout
  • Zero workflow risk — if logging fails for any reason, your workflow continues unaffected
  • Works everywhere — AI Agent, LLM Chain, or any other node that accepts a language model
  • All models supported — model name is free text, so new OpenAI models work on day one

FAQ

Does this slow down my workflows? No. Usage logging happens asynchronously after each model call. If the logging request takes longer than 3 seconds or fails entirely, it's silently dropped and your workflow continues normally.

Does this work with the AI Agent node? Yes. It's a drop-in replacement. Swap it in where you'd normally use the OpenAI Chat Model and everything works the same.

Which models are supported? Any model available through the OpenAI API — GPT-4o, GPT-4o-mini, o1, o3-mini, and any future models. The model field is free text, so you're never waiting for an update.

Can I use this with a custom OpenAI-compatible API? Yes. Set the Base URL in your OpenAI API credential to point to any OpenAI-compatible endpoint (Azure, local models, etc.).

Where is my data stored? Your usage data is stored securely in your Tokora account. Each organization's data is fully isolated — team members only see data for their own organization.

Support

License

MIT