Moonshot Integration
Prerequisites
- Bytedesk has been deployed
- You have created a Moonshot Kimi API key
- You understand the parameter constraints of the selected model, especially
kimi-k2.6
Configuration Steps
1. Create an API Key
- Visit the Moonshot Platform
- Sign in to your Moonshot account
- Create an API key in the console
- Save the generated key for Bytedesk admin or config-file based setup
2. Configure It in Bytedesk Admin
- Sign in to the Bytedesk admin console
- Open the AI provider configuration page
- Add or edit a Moonshot provider entry
- Fill in the core values below:
baseUrl:https://api.moonshot.cnapiKey: the API key created in Moonshotmodel: recommendedkimi-k2.6
Screenshots will be added later.
3. Select the Model
- Open the AI model configuration page
- Choose Moonshot as the default model, or bind it to a specific bot
- Save the configuration
Recommended model:
kimi-k2.6: the current default Kimi model used in this repository
Screenshots will be added later.
4. Get the Chat Embed Code
- Find the "Get Chat Code" entry in the admin console
- Copy the generated code snippet
- Embed it into your website
Screenshots will be added later.
Result
After setup, Bytedesk can use Moonshot Kimi for visitor chat and bot conversations.
Chat effect screenshots will be added later.
Optional Configuration
Docker Deployment
# Moonshot API settings
SPRING_AI_MOONSHOT_BASE_URL: https://api.moonshot.cn
SPRING_AI_MOONSHOT_API_KEY: 'sk-xxx' # Replace with your Moonshot API key
SPRING_AI_MOONSHOT_CHAT_ENABLED: true # Enable Moonshot chat
# Model settings
SPRING_AI_MOONSHOT_CHAT_OPTIONS_MODEL: kimi-k2.6 # Recommended model
SPRING_AI_MOONSHOT_CHAT_OPTIONS_TEMPERATURE: 1 # Recommended fixed value for kimi-k2.6
# Notes
# For kimi-k2.6, the service currently normalizes temperature=1 and top_p=0.95
# Dynamic bot maxTokens will be mapped to max_completion_tokens
Source Deployment
# Moonshot API settings
spring.ai.moonshot.base-url=https://api.moonshot.cn
spring.ai.moonshot.api-key=sk-xxx # Replace with your Moonshot API key
spring.ai.moonshot.chat.enabled=true # Enable Moonshot chat
# Model settings
spring.ai.moonshot.chat.options.model=kimi-k2.6 # Recommended model
spring.ai.moonshot.chat.options.temperature=1 # Recommended fixed value for kimi-k2.6
# You can also inject the API key via environment variable
# export SPRING_AI_MOONSHOT_API_KEY=<INSERT KEY HERE>
Parameter Notes
The Moonshot integration in this repository already includes compatibility handling for kimi-k2.6:
temperatureis normalized to1top_pis normalized to0.95- Bot-level
maxTokensis mapped tomax_completion_tokens kimi-k2.*models supportthinking, which is toggled from bot configuration
Notes
- Replace
sk-xxxwith your real API key - Prefer
kimi-k2.6unless you have a clear reason to switch - If Moonshot is configured per bot, Bytedesk will handle part of the model-specific compatibility automatically
Common Issues
-
Invalid API key
- Verify the key was copied correctly
- Confirm the key is active
- Check whether the key has permission to call the target model
-
400 invalid parameter errors
- Confirm the model is
kimi-k2.6 - Avoid forcing incompatible sampling values manually
- The current known requirement for this model is
temperature=1andtop_p=0.95
- Confirm the model is
-
Slow or failed responses
- Check network connectivity and Moonshot platform availability
- Inspect Bytedesk server logs for the actual response body
- Verify
baseUrl,apiKey, and model name in admin or config files
-
Configured but not taking effect
- Check whether
spring.ai.moonshot.chat.enabledis enabled - Confirm the current bot or default model is actually bound to Moonshot
- For source deployment, make sure the Moonshot properties are not still commented out in the active profile
- Check whether