{"id":15175678,"url":"https://github.com/allanbunch/node-red-openai-api","last_synced_at":"2026-03-14T02:39:56.065Z","repository":{"id":207221515,"uuid":"716780823","full_name":"allanbunch/node-red-openai-api","owner":"allanbunch","description":"Build low-code, event-driven AI applications and workflows using **any** OpenAI API-compatible framework.","archived":false,"fork":false,"pushed_at":"2025-03-21T01:53:50.000Z","size":484,"stargazers_count":35,"open_issues_count":0,"forks_count":7,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-02T02:38:18.168Z","etag":null,"topics":["ai","artificial-intelligence","javascript","llm","low-code","node-red","node-red-contrib","nodejs","ollama","open-source","openai","openai-api","slm"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@inductiv/node-red-openai-api","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/allanbunch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-09T21:27:25.000Z","updated_at":"2025-03-23T20:50:02.000Z","dependencies_parsed_at":"2024-01-03T22:29:43.810Z","dependency_job_id":"74051f46-e3a4-4752-a210-386e2aec6167","html_url":"https://github.com/allanbunch/node-red-openai-api","commit_stats":{"total_commits":196,"total_committers":1,"mean_commits":196.0,"dds":0.0,"last_synced_commit":"125eb614a97f3c86adb04fe0b57f05e983d4a411"},"previous_names":["allanbunch/node-red-openai-api"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allanbunch%2Fnode-red-openai-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allanbunch%2Fnode-red-openai-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allanbunch%2Fnode-red-openai-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allanbunch%2Fnode-red-openai-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allanbunch","download_url":"https://codeload.github.com/allanbunch/node-red-openai-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994122,"owners_count":21030050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","artificial-intelligence","javascript","llm","low-code","node-red","node-red-contrib","nodejs","ollama","open-source","openai","openai-api","slm"],"created_at":"2024-09-27T12:39:54.928Z","updated_at":"2026-03-14T02:39:56.056Z","avatar_url":"https://github.com/allanbunch.png","language":"HTML","readme":"# @inductiv/node-red-openai-api\n\n![NPM Version](https://img.shields.io/npm/v/%40inductiv%2Fnode-red-openai-api)\n![GitHub Issues](https://img.shields.io/github/issues/allanbunch/node-red-openai-api)\n![GitHub Stars](https://img.shields.io/github/stars/allanbunch/node-red-openai-api)\n\nThis project brings the OpenAI API, and OpenAI-compatible APIs, into Node-RED as workflow-native building blocks.\n\nIt is not just a thin wrapper around text generation. The node exposes modern AI capabilities inside a runtime people can inspect, route, test, and operate: request and response workflows, tools, conversations, streaming, realtime interactions, webhooks, and related API families that matter in real systems.\n\nThat makes this repository relevant beyond Node-RED alone. It is a practical implementation of how contemporary AI capabilities can live inside an open workflow environment instead of being locked inside a single vendor surface or hidden behind a one-purpose abstraction.\n\nThis package currently targets the `openai` Node SDK `^6.29.0`.\n\n## Why This Exists\n\nModern AI work is no longer just \"send a prompt, get a string back.\"\n\nReal systems now involve:\n\n- tool use\n- multi-step workflows\n- structured payloads\n- streaming responses\n- realtime sessions\n- webhook verification\n- provider compatibility and auth routing\n\nNode-RED is already good at orchestration, automation, event handling, integration, and operational clarity. This project connects those strengths to the OpenAI API surface so teams can build AI workflows in an environment that stays visible and composable.\n\n## Core Model\n\nThe node model in this repository is intentionally simple:\n\n- one `OpenAI API` node handles the runtime method call\n- one `Service Host` config node handles API base URL, auth, and organization settings\n- the selected method determines which OpenAI API context is being called\n- request data is passed in through a configurable message property, `msg.payload` by default\n- method-specific details live in the editor help, example flows, and the underlying SDK contract\n\nIn practice, that means one node can cover a wide API surface without turning the flow itself into a maze of special-purpose nodes.\n\n## What It Enables\n\n### Request and Response Workflows\n\nUse the node for direct generation, structured Responses API work, chat-style interactions, moderation, embeddings, image work, audio tasks, and other request/response patterns.\n\nThat includes speech work with built-in voices or a saved custom voice id, depending on what the flow needs.\n\n### Video and Sora Workflows\n\nUse the node for OpenAI video work inside Node-RED, including current Sora video methods for generation, remix, edit, extend, character creation, and downloadable video assets. That lets video features live in the same visible, routable workflow environment as the rest of your AI system.\n\n### Tool-Enabled and Multi-Step AI Flows\n\nUse Responses tools, conversations, runs, messages, vector stores, files, skills, and related resources as part of larger control loops and operational workflows. Use ChatKit sessions and threads when a published Agent Builder workflow needs to be exposed cleanly inside a Node-RED flow.\n\n### Streaming and Realtime Work\n\nUse streamed Responses output, Realtime client-secret creation, SIP call operations, and persistent Responses websocket connections where a flow needs more than one-shot request handling.\n\n### Event-Driven Integrations\n\nUse webhook signature verification and payload unwrapping in Node-RED flows that react to upstream platform events.\n\n### OpenAI-Compatible Provider Support\n\nUse the `Service Host` config to target compatible API providers with custom base URLs, custom auth header names, query-string auth routing, and typed configuration values.\n\n## Requirements\n\n- Node.js `\u003e=18.0.0`\n- Node-RED `\u003e=3.0.0`\n\n## Install\n\n### Node-RED Palette Manager\n\n```text\n@inductiv/node-red-openai-api\n```\n\n### npm\n\n```bash\ncd $HOME/.node-red\nnpm i @inductiv/node-red-openai-api\n```\n\n## Quick Start\n\n1. Drop an `OpenAI API` node onto your flow.\n2. Create or select a `Service Host` config node.\n3. Set `API Base` to your provider endpoint. The default OpenAI value is `https://api.openai.com/v1`.\n4. Set `API Key` using either:\n   - `cred` for a stored credential value, or\n   - `env`, `msg`, `flow`, or `global` for a runtime reference\n5. Pick a method on the `OpenAI API` node, such as `create model response`.\n6. Send the request payload through `msg.payload`, or change the node's input property if your flow uses a different message shape.\n\nExample `msg.payload` for `create model response`:\n\n```json\n{\n  \"model\": \"gpt-5-nano\",\n  \"input\": \"Write a one-line status summary.\"\n}\n```\n\nThe node writes its output back to `msg.payload`.\n\n## Start Here\n\nIf you want to understand the shape of this node quickly, these example flows are the best entry points:\n\n- [`examples/chat.json`](examples/chat.json)\n  A straightforward API-call flow for getting oriented.\n- [`examples/chatkit/sessions-and-threads.json`](examples/chatkit/sessions-and-threads.json)\n  Shows how to create and cancel ChatKit sessions for a published Agent Builder workflow, then inspect the resulting threads and thread items.\n- [`examples/responses/phase.json`](examples/responses/phase.json)\n  A clean Responses example using newer payload features.\n- [`examples/responses/tool-search.json`](examples/responses/tool-search.json)\n  Shows tool-enabled Responses work in a practical flow.\n- [`examples/responses/computer-use.json`](examples/responses/computer-use.json)\n  Shows the request and follow-up contract for computer-use style workflows.\n- [`examples/responses/websocket.json`](examples/responses/websocket.json)\n  Shows explicit websocket lifecycle handling in one node instance.\n- [`examples/videos.json`](examples/videos.json)\n  Shows the current video flow surface, including create, character creation, edit, extend, remix, and asset download.\n- [`examples/realtime/client-secrets.json`](examples/realtime/client-secrets.json)\n  Shows the Realtime client-secret contract for browser or mobile handoff.\n\n## Current Alignment Highlights\n\nThis repository currently includes:\n\n- ChatKit / Agent Builder support, including session creation and cancellation, plus thread and thread-item inspection for published workflows\n- Responses API support, including `phase`, `prompt_cache_key`, `tool_search`, GA computer-use payloads, cancellation, compaction, input-token counting, and websocket mode\n- Realtime API support, including client-secret creation, SIP call operations, and current SDK-typed model ids such as `gpt-realtime-1.5` and `gpt-audio-1.5`\n- Audio speech support with built-in voices and saved custom voice ids\n- Videos / Sora support, including generation, remix, edit, extend, character creation, and downloadable assets\n- Conversations, Containers, Container Files, Evals, Skills, and Webhooks support\n- OpenAI-compatible auth routing through the `Service Host` config node\n\nSee the in-editor node help for exact method payloads and links to official API documentation.\n\n## API Surface\n\nThe method picker covers a wide range of OpenAI API families:\n\n- Assistants\n- Audio\n- Batch\n- Chat Completions\n- ChatKit\n- Container Files\n- Containers\n- Conversations\n- Embeddings\n- Evals\n- Files\n- Fine-tuning\n- Images\n- Messages\n- Models\n- Moderations\n- Realtime\n- Responses\n- Runs\n- Skills\n- Threads\n- Uploads\n- Vector Store File Batches\n- Vector Store Files\n- Vector Stores\n- Videos\n- Webhooks\n\n`Graders` are supported through Evals payloads via `testing_criteria`, in the same way the official SDK models them.\n\n## Example Index\n\nImport-ready example flows live under `examples/`:\n\n- [`examples/assistants.json`](examples/assistants.json)\n- [`examples/audio.json`](examples/audio.json)\n- [`examples/chat.json`](examples/chat.json)\n- [`examples/chatkit/sessions-and-threads.json`](examples/chatkit/sessions-and-threads.json)\n- [`examples/embeddings.json`](examples/embeddings.json)\n- [`examples/files.json`](examples/files.json)\n- [`examples/fine-tuning.json`](examples/fine-tuning.json)\n- [`examples/images.json`](examples/images.json)\n- [`examples/messages.json`](examples/messages.json)\n- [`examples/models.json`](examples/models.json)\n- [`examples/moderations.json`](examples/moderations.json)\n- [`examples/realtime/client-secrets.json`](examples/realtime/client-secrets.json)\n- [`examples/responses/computer-use.json`](examples/responses/computer-use.json)\n- [`examples/responses/mcp.json`](examples/responses/mcp.json)\n- [`examples/responses/phase.json`](examples/responses/phase.json)\n- [`examples/responses/tool-search.json`](examples/responses/tool-search.json)\n- [`examples/responses/websocket.json`](examples/responses/websocket.json)\n- [`examples/videos.json`](examples/videos.json)\n- [`examples/runs.json`](examples/runs.json)\n- [`examples/threads.json`](examples/threads.json)\n\n## Service Host Notes\n\nThe `Service Host` config node handles the provider-specific runtime boundary.\n\n- `API Key` supports `cred`, `env`, `msg`, `flow`, and `global`\n- `API Base` can point at OpenAI or a compatible provider\n- `Auth Header` defaults to `Authorization`, but can be changed for provider-specific auth conventions\n- auth can be sent either as a header or as a query-string parameter\n- `Organization ID` is optional and supports typed values like the other service fields\n\nThis is the piece that lets one runtime model work cleanly across both OpenAI and compatible API surfaces.\n\n## Repository Shape\n\nThis repository is structured so the runtime, editor, examples, and generated artifacts stay understandable:\n\n- [`node.js`](node.js)\n  Node-RED runtime entry point and `Service Host` config-node logic.\n- [`src/`](src)\n  Source modules for method implementations, editor templates, and help content.\n- [`src/lib.js`](src/lib.js)\n  Source entry for the bundled runtime method surface.\n- [`lib.js`](lib.js)\n  Generated runtime bundle built from `src/lib.js`.\n- [`src/node.html`](src/node.html)\n  Source editor template that includes the per-family fragments.\n- [`node.html`](node.html)\n  Generated editor asset built from `src/node.html`.\n- [`examples/`](examples)\n  Import-ready Node-RED flows.\n- [`test/`](test)\n  Node test coverage for editor behavior, auth routing, method mapping, and websocket lifecycle behavior.\n\n## Development\n\n```bash\nnpm install\nnpm run build\nnpm test\n```\n\nGenerated files are part of the project:\n\n- `node.html` is built from `src/node.html`\n- `lib.js` is built from `src/lib.js`\n\nIf you change source templates or runtime source files, rebuild before review or release.\n\n## Support\n\nThis project is maintained against the live OpenAI platform, which means real ongoing costs for API usage, testing, parity work, and release verification, especially when newer features and newer models need to be exercised properly.\n\nIf this package is useful to you or your team, support through [GitHub Sponsors](https://github.com/sponsors/allanbunch) helps keep that work moving.\n\n## Contributing\n\nContributions are welcome. Keep changes clear, intentional, and proven.\n\nPlease include:\n\n- a clear scope and rationale\n- tests for behavior changes\n- a short plain-language comment block at the top of each test file you add or touch\n- doc updates when user-facing behavior changes\n\n## License\n\n[MIT](./LICENSE)\n","funding_links":["https://github.com/sponsors/allanbunch"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallanbunch%2Fnode-red-openai-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallanbunch%2Fnode-red-openai-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallanbunch%2Fnode-red-openai-api/lists"}