n8n-nodes-kimi-k2
v0.1.1
Published
Kimi K2 Chat Model for n8n - Direct Moonshot AI integration
Maintainers
Readme
n8n-nodes-kimi-k2
Official Kimi K2 Chat Model node for n8n. Integrate Moonshot AI's powerful Kimi K2 models directly into your workflows.
Features
- Direct API Integration: Connect to Moonshot AI API without intermediaries
- Multiple Models: Support for Kimi K2 variants (preview, stable, reasoning)
- Full Parameter Control: Temperature, max tokens, and top-p sampling
- Native n8n Experience: Works seamlessly with AI Agent and other n8n AI tools
- Secure Credential Management: API keys stored safely in n8n credentials
Prerequisites
- n8n version 1.0.0 or higher
- Node.js 18.10+
- Moonshot AI API key from platform.moonshot.cn
Installation
n8n Cloud
- Go to Settings → Community Nodes
- Click Install
- Enter package name:
n8n-nodes-kimi-k2 - Restart n8n when prompted
Self-Hosted n8n
cd ~/.n8n
npm install n8n-nodes-kimi-k2
# Restart your n8n instance
Docker Installation
bash
Copy
docker exec -it n8n_container_id sh
cd /home/node/.n8n
npm install n8n-nodes-kimi-k2
# Restart container
docker restart n8n_container_id
Configuration
1. Get Your API Key
Visit platform.moonshot.cn
Sign in or create an account
Navigate to API Key Management
Create a new key and copy it (starts with sk-)
2. Create Credential in n8n
In n8n, go to Credentials
Click Add Credential
Search for "Kimi K2 API"
Enter your API key
Click Save
3. Use the Node
Add an AI Agent or Chat Trigger node to your workflow
In the agent settings, select "Kimi K2 Chat Model" as the language model
Choose your credential
Configure model parameters
Available Models
Table
Copy
Model Name Description Max Tokens
kimi-k2-0905-preview Latest version with best performance 256,000
kimi-k2-0905 Stable release, proven reliability 128,000
kimi-k2-thinking Optimized for reasoning and analysis 128,000
Node Parameters
Model
Select the Kimi K2 model variant to use.
Options
Temperature (0-2): Controls randomness (default: 0.7)
Maximum Tokens (-1 to 256000): Maximum output length (-1 = unlimited)
Top P (0-1): Nucleus sampling parameter
Usage Example
Workflow: Email Summarization
JSON
Copy
{
"nodes": [
{
"id": "trigger",
"name": "IMAP Email Trigger",
"type": "n8n-nodes-base.emailReadImap",
"position": [250, 300]
},
{
"id": "ai-agent",
"name": "AI Agent",
"type": "n8n-nodes-base.aiAgent",
"position": [450, 300],
"parameters": {
"model": "lmChatKimiK2",
"prompt": "Summarize this email in 3 bullet points:\n\nSubject: {{$json.subject}}\nBody: {{$json.body}}"
}
},
{
"id": "slack",
"name": "Send to Slack",
"type": "n8n-nodes-base.slack",
"position": [650, 300]
}
]
}
Error Handling
Common Errors
401 Unauthorized
API key is invalid or missing
Solution: Re-create credential with correct key
429 Rate Limit
Too many requests
Solution: Reduce workflow frequency or upgrade Moonshot AI tier
403 Forbidden
Insufficient account balance
Solution: Top up your Moonshot AI account
Model Not Found
Selected model doesn't exist
Solution: Choose a model from the dropdown list
Pricing
Node: Free and open source
API Usage: Pay-as-you-go via Moonshot AI
~$0.50 per million tokens
New users receive a $5 credit
Support
Moonshot AI Docs: platform.moonshot.cn/docs
n8n Documentation: docs.n8n.io
Issues: GitHub Issues
Community Forum: community.n8n.io
Development
bash
Copy
# Clone repo
git clone https://github.com/yourusername/n8n-nodes-kimi-k2.git
cd n8n-nodes-kimi-k2
# Install dependencies
npm install
# Run tests
npm test
# Build
npm run build
Contributing
Pull requests welcome! Please ensure:
Code passes ESLint
All tests pass
README is updated for new features
License
MIT License - see LICENSE file for details.
Changelog
0.1.0
Initial release
Support for Kimi K2 models
Basic parameter controls
Credential management