n8n-nodes-gh-copilot-lm
v1.0.1
Published
n8n chat model sub-node for GitHub Copilot API
Maintainers
Readme
n8n-nodes-gh-copilot-lm
n8n chat model node for GitHub Copilot API.
Use your existing GitHub Copilot subscription with n8n AI Agent workflows. Access GPT-4, Claude, Gemini, and other models through the Copilot API without additional per-token costs.
Prerequisites
- GitHub Copilot subscription (Individual, Business, or Enterprise)
- n8n instance (self-hosted or cloud)
- Node.js 18+ for running the authentication script
Installation
Install via n8n Community Nodes:
- Go to Settings > Community Nodes
- Select Install
- Enter
n8n-nodes-gh-copilot-lm - Accept the risk warning
- Click Install
Credential Setup
The GitHub Copilot API uses OAuth device code flow for authentication. You'll need to run a script to obtain the OAuth token, then enter it in n8n.
Step 1: Get OAuth Token
Clone this repository and run the authentication script:
git clone https://github.com/ssccio/n8n-nodes-gh-copilot.git
cd n8n-nodes-gh-copilot
npm install
npm run build
node test-auth.mjsThe script will display:
- A verification URL (https://github.com/login/device)
- A user code (e.g., XXXX-XXXX)
Open the URL in your browser, enter the code, and authorize the application. The script will output your OAuth token (starts with gho_).
Step 2: Configure n8n Credential
- In n8n, go to Credentials > Add Credential
- Search for "GitHub Copilot API"
- Enter your OAuth token in the OAuth Token field
- Leave API Endpoint empty (auto-discovered)
- Click Save
The credential will test automatically. A successful test confirms your Copilot subscription is active.
Usage
With AI Agent
- Add an AI Agent node to your workflow
- Connect a GitHub Copilot Chat Model node to the AI Agent's language model input
- Select your credentials and preferred model
- Configure temperature (0-2, default 0.7)
Available Models
The node dynamically fetches available models from your Copilot subscription. Common models include:
- GPT-4 family: gpt-4o, gpt-4o-mini, gpt-4.1, o1, o3-mini
- Claude family: claude-sonnet-4, claude-3.5-sonnet
- Gemini family: gemini-2.0-flash, gemini-2.5-pro
Models with premium request costs show multiplier badges (e.g., [3x], [0.33x]).
Troubleshooting
"401 Unauthorized" on credential test
Your OAuth token may have expired. GitHub tokens expire after a period of inactivity. Re-run test-auth.mjs to obtain a fresh token.
"403 Forbidden" on credential test
Your GitHub account may not have an active Copilot subscription. Verify your subscription at https://github.com/settings/copilot.
Node not appearing in n8n
- Restart n8n after installing the community node
- Check n8n logs for any loading errors
- Verify the package installed correctly in Settings > Community Nodes
License
MIT
