Skip to main content
Cursor supports custom OpenAI-compatible API keys and Base URLs in its chat model flow. After the following steps, you can try HaiToken models inside Cursor chat.

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 to https://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

  1. Prepare your HaiToken API key and confirm the target model is available in HaiToken.
  2. Open Cursor and go to Settings > Cursor Settings > Models.
  3. Enter your HaiToken API key in OpenAI API Key.
  4. Enable Override OpenAI Base URL and enter https://api.haitoken.ai/v1.
  5. 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.
  6. 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.
  7. Save the settings and switch to the model you want to use.

Verification

  1. Open any project in Cursor.
  2. Open the AI chat panel.
  3. Select the model you want to use, either an existing Cursor model or a custom model you just added.
  4. Send a simple prompt such as Explain what this file does.
  5. 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.
Cursor’s clearly documented support for custom API keys mainly applies to the chat model path. Other features such as Tab completion may still use Cursor-managed models, so do not assume that all AI features have already switched to HaiToken.
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.
The value you need here is the model ID from the HaiToken homepage or model list, such as gpt-5.4, not the display name shown to users. Copying the display name usually causes model not found.

FAQ

Next