Key configuration (click to copy)
Base URL
https://api.moonshot.cn/v1
Model
moonshot-v1-128k
Authentication
Bearer <API_KEY>
Connecting Cursor to the Kimi Long-Context API
Who it's for
- Developers who need whole-codebase understanding and cross-file analysis in large repositories
- Those who want to keep the Cursor editing experience while leveraging an ultra-long context window
- Anyone who frequently processes large amounts of code context in a single pass
Prerequisites
- A registered Cursor account
- A Moonshot AI open platform account with an API Key
- Knowledge of the Kimi API model IDs
Key configuration
- Base URL:
https://api.moonshot.cn/v1 - Model:
moonshot-v1-128k(choose the 8k/32k/128k version based on your needs) - Authentication:
Bearer <API_KEY>
Setup steps
- Open the OpenAI-compatible configuration entry in Cursor Settings.
- Point the Base URL to the Moonshot AI API endpoint.
- Enter your API Key and set the default model to
moonshot-v1-128k. - Test cross-file Q&A and code comprehension on a medium-sized repository.
Troubleshooting
- If responses are slow, try a shorter-context version (
moonshot-v1-32k) to reduce cost. - If you hit token limit errors, check whether you are sending an overly large code context.
- If compatibility errors appear, confirm your Cursor version supports custom OpenAI-compatible endpoints.
Cost note
Because of its long context, the Kimi API costs slightly more per call than ordinary APIs. Use it primarily for large-codebase scenarios that need whole-codebase understanding, and pair it with another low-cost option for daily completion. Monthly costs typically run ¥80-150/month.
配置完成?Setup complete?
前往官方平台开通服务,开始使用 AI 编程。Head to the official site to activate the service and start AI coding.
官方入口暂不可用,请核对教程中的官方来源。The official website link is currently unavailable. Please check the official sources in this guide.
浏览方案库Browse solutions