Skip to main content

n8n Local Setup (Windows) with OpenAI-Compatible Gateway

Prerequisites

  • Node.js installed
  • n8n installed globally
npm install -g n8n
Verify installation:
n8n --version
Start n8n:
n8n start
n8n will be available at:
http://localhost:5678

Initial Account Setup

On first launch, n8n will prompt you to create an owner account. Fill in:
Email
First Name
Last Name
Password
Password requirements:
  • Minimum 8 characters
  • At least 1 uppercase letter
  • At least 1 number
The “I want to receive security and product updates” checkbox is optional. After completing registration, you’ll be redirected to the n8n dashboard.

Connecting n8n to an OpenAI-Compatible Gateway

This method works with:
  • ZnapAI
  • Any OpenAI-compatible endpoint

Step 1: Open Chat

From the left sidebar:
Chat

Step 2: Select a Model

Click:
Select a model
Choose:
OpenAI

Step 3: Create Credentials

When prompted, create a new credential. Enter:
API Key:
<your-api-key>

Base URL: https://api.znapai.com/v1
n8n Configuration

Step 4: Save Credential

Click:
Save
n8n will store the credential securely and make it available for future workflows and agents.

Step 5: Test the Connection

Send a message in the Chat interface. Example:
Explain event-driven architecture in one paragraph.
If configured correctly:
  • n8n sends the request to your gateway
  • The gateway routes the request to the selected model
  • The response appears in the chat

Verification

If using ZnapAI or any other Gateway Provider, monitor the gateway logs. You should see incoming requests from n8n whenever a chat message is sent. Example validation flow:
n8n Chat

OpenAI Credential

Gateway (ZnapAI)

Model Provider

Response
If requests appear in gateway logs, the integration is working correctly.

Next Steps

Once chat is working, you can build workflows and AI agents. Typical architecture:
Webhook / Trigger

AI Agent

OpenAI-Compatible Gateway

Tools

Actions
Examples:
  • GitHub Issue Summarizer
  • Slack AI Assistant
  • CRM Lead Qualification Agent
  • Customer Support Automation
  • RAG Knowledge Assistant
  • Email Classification and Routing
At this point, n8n is successfully configured to use your OpenAI-compatible gateway for both chat and workflow-based AI automation.