Cursor Integration
Call 1折AI's Claude models in Cursor using a custom OpenAI API key and Base URL, and which features do not use the custom API key.
Cursor allows you to enter your own API key in settings, and chat models use this API key to send requests. Below is how to connect to 1折AI, along with several limitations you must know first.
Understand these three points before you start:
- According to Cursor’s official documentation, custom API keys only apply to chat models; Tab completion always uses Cursor’s own models.
- Requests pass through Cursor’s servers first before being sent to the address you entered, so the Base URL must be publicly accessible (
https://1zheai.com/v1works fine; a locallocalhostproxy does not). - The “Override OpenAI Base URL” toggle is not in Cursor’s official documentation. The interface description below comes from the Cursor forum and community tutorials, and may change after Cursor updates.
Configuration
Section titled “Configuration”Open model settings
Cursor → Cursor Settings → Models, find the Keys section.
Enter OpenAI API Key and Base URL
text OpenAI API Key sk-你的Key(1折AI 的 Key)Override OpenAI Base URL https://1zheai.com/v1The Base URL must include
/v1.Add a model
Click Add model in the model list, enter the model ID, for example
claude-sonnet-5-5, then turn on its toggle. For model IDs, see supported models .Try it once in chat
Select the newly added model in the Chat panel and send a message. After the reply comes back normally, go to the console call logs to confirm this call.
Known Issues
Section titled “Known Issues”There is feedback on the Cursor forum: after setting Override OpenAI Base URL, models whose names start with claude- may be treated by Cursor as Anthropic models, handled by the Anthropic API key, or cause an error directly. When selecting Claude, the model ID starts with claude-. If you encounter this issue, first clear any Anthropic API key you have entered in Cursor and try again.
Reference: forum post 144899 , forum post 146998 .
Will Tab completion use 1折AI?
No. According to Cursor’s official documentation, Tab completion always uses Cursor’s built-in models and does not go through your API key.
Clicking Verify fails?
First confirm that the Base URL includes /v1. Community feedback indicates that the Verify button does not necessarily pass for non-OpenAI model names. You can send a message directly in Chat to test; the deciding factor is whether there is a record in the call logs.
Can I use Agent / Composer?
Community tutorials generally report that only Chat uses the custom API key; features such as Agent, Apply, and Inline Edit may still go through Cursor’s own backend. Rely on the records you actually see in the call logs.
Want to use Claude fully inside your editor?
If you mainly want to use Claude for writing code, Claude Code (command line or VS Code extension) and Cline have more complete support for custom addresses.
