newapi

n8n community node for NewAPI - Access AI models through OpenAI compatible API

Package Information

Downloads: 170 weekly / 170 monthly
Latest Version: 0.1.1
Author: qiyu

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

  1. In n8n, go to Credentials and create a new NewAPI Credentials
  2. Enter your API Key (starts with sk-)
  3. Optionally modify the Base URL (default: https://newapi.lvis.lol)

Usage

Chat Completion

  1. Add a NewAPI node to your workflow
  2. Select Chat as the resource
  3. Select Complete as the operation
  4. Enter the model name (e.g., gpt-4o-mini, claude-3-5-sonnet)
  5. Enter your message
  6. Optionally add a system message and adjust parameters

List Models

  1. Add a NewAPI node to your workflow
  2. Select Model as the resource
  3. 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

Discussion