Protocol Note
Cursor’s custom API key path only supports the OpenAI-compatible mode; it does not support the Anthropic Messages protocol. This guide therefore only covers the OpenAI mode, with the Base URL fixed tohttps://api.haitoken.ai/v1.
This Cursor flow is mainly GUI-based, so the core steps are usually the same on Windows, macOS, and Linux. If menu placement, dialog layout, or button labels differ slightly across systems or versions, follow the current UI, but keep the same
API Key, Base URL, and Model ID values.Setup Steps
- Prepare your HaiToken API key and confirm the target model is available in HaiToken.
- Open Cursor and go to Settings > Cursor Settings > Models.
- Enter your HaiToken API key in OpenAI API Key.
- Enable Override OpenAI Base URL and enter
https://api.haitoken.ai/v1. - If the model you want is already in Cursor’s model list, select it directly in the chat panel or model picker. Once the Base URL is overridden, its chat requests also go through HaiToken.
- Only when the model is not in Cursor’s list, enter its HaiToken model ID in Add or search model (for example,
gpt-5.4) and click Add Custom Model. - Save the settings and switch to the model you want to use.
Verification
- Open any project in Cursor.
- Open the AI chat panel.
- Select the model you want to use, either an existing Cursor model or a custom model you just added.
- Send a simple prompt such as
Explain what this file does. - If you get a normal response, the Cursor chat model path is working through HaiToken.
Notes
The recommended Base URL is
https://api.haitoken.ai/v1. This means Cursor is using the OpenAI-compatible integration path rather than a single hardcoded endpoint.
After the Base URL override is active, chat requests from models already in Cursor’s list also go through HaiToken. Only add a model manually in Add or search model when the target model is not in that list.
FAQ
Next
- See Get API Key
- See OpenAI format API
- See List models