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-cloudflare-ai-gateway

v0.1.3

Published

n8n community node: Cloudflare AI Gateway as a Language Model for AI Agent/Chain nodes

Readme

n8n-nodes-cloudflare-ai-gateway

An n8n community node that exposes Cloudflare AI Gateway as a Language Model, so it can be attached to the AI Agent and other LangChain nodes in n8n that need an LLM.

It connects to Cloudflare's OpenAI-compatible endpoint and gives access to all models served through AI Gateway — Cloudflare Workers AI (@cf/...) and third-party providers (openai/..., anthropic/..., google/..., xai/..., …) — through a single credential.

Installation

In n8n: Settings → Community nodes → Install, then enter n8n-nodes-cloudflare-ai-gateway.

Or via npm:

npm install n8n-nodes-cloudflare-ai-gateway

Credential setup

Create a Cloudflare API token with these permissions (Account-scoped):

| Permission | Scope | Used for | |---|---|---| | AI Gateway - Run | Account | Inference (chat completions) | | AI Gateway - Read | Account | Read gateway config | | Workers AI - Read | Account | @cf/... models + model list |

Then in n8n create a Cloudflare AI Gateway API credential with:

  • Account ID — your Cloudflare Account ID (how to find it)
  • Gateway ID — your gateway name (default is created automatically)
  • API Token — the token above

Usage

  1. Add the Cloudflare AI Gateway node as a sub-node of an AI Agent (or any node that takes a Language Model).
  2. Model:
    • From List — Workers AI text-generation models, loaded live from the Cloudflare API.
    • ID — type any model the gateway serves, e.g. openai/gpt-4.1, anthropic/claude-sonnet-4, google/gemini-3-flash, or @cf/moonshotai/kimi-k2.6.

Billing

  • Workers AI models (@cf/...): billed per Workers AI pricing. Work out of the box.
  • Third-party models (openai/..., anthropic/..., …): require Unified Billing credits loaded on your account, or BYOK (stored keys). Without them you will get Insufficient balance (error 2021).

Under the hood

The node wraps LangChain's ChatOpenAI pointed at Cloudflare's OpenAI-compatible endpoint:

POST https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/v1/chat/completions
Authorization: Bearer {CF_TOKEN}
cf-aig-gateway-id: {gateway_id}

This keeps it compatible with tool calling (agents) and standard chat-completion parameters.

Development

This node was developed using OpenCode as an AI coding copilot, powered by the GLM-5.2 language model.

License

MIT