@inductiv/node-red-openai-api 6.22.0

Enhance your Node-RED projects with advanced AI capabilities.

npm install @inductiv/node-red-openai-api

@inductiv/node-red-openai-api

NPM Version GitHub Issues GitHub Stars

Node-RED node for calling the OpenAI API (and OpenAI-compatible APIs) through a single configurable node.

This package currently targets openai Node SDK ^6.22.0.

What You Get

  • One OpenAI API node with method selection across major API families.
  • One Service Host config node for base URL, auth, and org settings.
  • Typed input support for key config fields: str, env, msg, flow, global (plus cred for API key).
  • Backward compatibility handling for older API key storage patterns.
  • Built-in examples for common flows.

Requirements

  • Node.js >=18.0.0
  • Node-RED >=3.0.0

Install

Node-RED Palette Manager

@inductiv/node-red-openai-api

npm

cd $HOME/.node-red
npm i @inductiv/node-red-openai-api

Quick Start

  1. Drop an OpenAI API node onto your flow.
  2. In the node editor, use the Service Host field to either select an existing config node or create one with the + button.
  3. In that Service Host config, set API Base (default: https://api.openai.com/v1).
  4. Set API Key:
    • cred type for a masked credential value, or
    • env/msg/flow/global and provide a reference name.
  5. Back in the OpenAI API node, select your method (for example create model response).
  6. Send request params in msg.payload (or change the input property on the node).

Example msg.payload for create model response:

{
  "model": "gpt-5-nano",
  "input": "Write a one-line status summary."
}

Node output is written to msg.payload.

Service Host Configuration

API Key

  • cred keeps the value in Node-RED credentials (masked in the editor).
  • env/msg/flow/global treats the field as a reference, not a literal key.
  • Existing flows with older key storage formats are still handled.

Auth Header

  • Default value is Authorization.
  • You can override it for OpenAI-compatible providers that use a different header name.

Organization ID

  • Optional.
  • Supports typed input (str/env/msg/flow/global) like other service fields.

Environment Variables

You can source values from:

  • OS-level environment variables.
  • Node-RED editor environment variables (User Settings -> Environment).

Supported API Families

The method dropdown includes operations across:

  • Assistants
  • Audio
  • Batch
  • Chat Completions
  • Container Files
  • Containers
  • Conversations
  • Embeddings
  • Evals
  • Files
  • Fine-tuning
  • Images
  • Messages
  • Models
  • Moderations
  • Realtime
  • Responses
  • Runs
  • Skills
  • Threads
  • Uploads
  • Vector Store File Batches
  • Vector Store Files
  • Vector Stores
  • Videos
  • Webhooks

Graders are supported through Evals payloads (testing_criteria) in the same way the official SDK models them.

See the in-editor node help for method-specific payload fields and links to official API docs.

Recent Additions

  • Added environment variable support for service host configuration values.
  • OpenAI Node SDK upgraded from 4.103.0 to 6.22.0.
  • Added responses.cancel.
  • Added responses.compact.
  • Added responses.input_tokens counting support.
  • Added Conversations API support:
    • create/retrieve/modify/delete conversation
    • create/retrieve/list/delete conversation items
  • Added Containers and Container Files support.
  • Added MCP tool use example flow at examples/responses/mcp.json.
  • Added Skills API support:
    • list/create/retrieve/modify/delete skills
    • retrieve skill content
    • list/create/retrieve/delete skill versions
    • retrieve skill version content
  • Added Evals API support:
    • list/create/retrieve/modify/delete evals
    • list/create/retrieve/cancel/delete eval runs
    • list/retrieve eval run output items
  • Added Realtime API support:
    • create client secret
    • accept/hangup/refer/reject SIP calls
  • Added Videos API support:
    • list/create/retrieve/delete videos
    • download video content
    • remix videos
  • Added Webhooks utility support:
    • unwrap signed webhook payloads
    • verify webhook signatures
  • Service Host auth routing now applies Auth Header configuration at request time.

Examples

Import-ready example flows are available in examples/:

Development

npm install
npm run build
npm test

Build output files are generated from src/:

  • node.html (from src/node.html)
  • lib.js (from src/lib.js)

Contributing

PRs are welcome. Please include:

  • clear scope and rationale,
  • tests for behavior changes,
  • doc updates when user-facing behavior changes.

License

MIT

Node Info

Version: 6.22.0
Updated 2 weeks, 5 days ago
License: MIT
Rating: 4.1 9

Categories

Actions

Rate:

Downloads

218 in the last week

Nodes

  • OpenAI API
  • Service Host

Keywords

  • node-red
  • aiot
  • openai
  • gpt-4o-audio-preview
  • ai
  • openai api
  • iot
  • node-red-contrib
  • automation
  • smart devices
  • node-red node
  • artificial intelligence
  • api integration
  • ai agent
  • low-code

Maintainers