Package Information
Downloads: 170 weekly / 170 monthly
Latest Version: 0.1.1
Author: qiyu
Available Nodes
Documentation
n8n-nodes-newapi
This is an n8n community node for NewAPI - an OpenAI compatible API service.
Features
- Chat Completions: Send messages to AI models and get responses
- Model List: Query available models
- OpenAI Compatible: Works with GPT-4, Claude, and other models
Installation
For Docker deployments
Add the following to your docker-compose.yml:
environment:
- N8N_CUSTOM_EXTENSIONS=/home/node/.n8n/custom
volumes:
- ./custom:/home/node/.n8n/custom
Then copy the built package to the custom folder:
cp -r dist /path/to/custom/n8n-nodes-newapi
For npm installations
# In your n8n installation directory
cd ~/.n8n
npm install /path/to/n8n-nodes-newapi
For local development
# Build the package
cd ~/Documents/n8n-development/n8n-nodes-newapi
npm run build
# Link the package
npm link
# In n8n custom directory
cd ~/.n8n
npm link n8n-nodes-newapi
# Start n8n
n8n start
Configuration
- In n8n, go to Credentials and create a new NewAPI Credentials
- Enter your API Key (starts with
sk-) - Optionally modify the Base URL (default:
https://newapi.lvis.lol)
Usage
Chat Completion
- Add a NewAPI node to your workflow
- Select Chat as the resource
- Select Complete as the operation
- Enter the model name (e.g.,
gpt-4o-mini,claude-3-5-sonnet) - Enter your message
- Optionally add a system message and adjust parameters
List Models
- Add a NewAPI node to your workflow
- Select Model as the resource
- Select List as the operation
Parameters
| Parameter | Description |
|---|---|
| Model | The AI model to use (e.g., gpt-4o, gpt-4o-mini, claude-3-5-sonnet) |
| User Message | The message to send to the model |
| System Message | Optional system prompt to set behavior |
| Max Tokens | Maximum tokens in the response (default: 1024) |
| Temperature | Randomness control 0-2 (default: 0.7) |
| Top P | Nucleus sampling 0-1 (default: 1) |
Output
The node returns the API response with an additional message field containing the extracted response text for easy access.
{
"id": "chatcmpl-xxx",
"choices": [...],
"message": "The extracted response text"
}
Project Location
This project is located at:
~/Documents/n8n-development/n8n-nodes-newapi
License
MIT
Author
qiyu