@inductiv/node-red-openai-api 6.22.0
Enhance your Node-RED projects with advanced AI capabilities.
@inductiv/node-red-openai-api
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 APInode with method selection across major API families. - One
Service Hostconfig node for base URL, auth, and org settings. - Typed input support for key config fields:
str,env,msg,flow,global(pluscredfor 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
- Drop an
OpenAI APInode onto your flow. - In the node editor, use the
Service Hostfield to either select an existing config node or create one with the+button. - In that
Service Hostconfig, setAPI Base(default:https://api.openai.com/v1). - Set
API Key:credtype for a masked credential value, orenv/msg/flow/globaland provide a reference name.
- Back in the
OpenAI APInode, select your method (for examplecreate model response). - 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
credkeeps the value in Node-RED credentials (masked in the editor).env/msg/flow/globaltreats 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.0to6.22.0. - Added
responses.cancel. - Added
responses.compact. - Added
responses.input_tokenscounting 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 Headerconfiguration at request time.
Examples
Import-ready example flows are available in examples/:
examples/assistants.jsonexamples/audio.jsonexamples/chat.jsonexamples/embeddings.jsonexamples/files.jsonexamples/fine-tuning.jsonexamples/images.jsonexamples/messages.jsonexamples/models.jsonexamples/moderations.jsonexamples/runs.jsonexamples/threads.jsonexamples/responses/mcp.json
Development
npm install
npm run build
npm test
Build output files are generated from src/:
node.html(fromsrc/node.html)lib.js(fromsrc/lib.js)
Contributing
PRs are welcome. Please include:
- clear scope and rationale,
- tests for behavior changes,
- doc updates when user-facing behavior changes.