Cursor

Use Cases

Suitable for existing Cursor users who want to route Chat, Composer, or Agent model requests through MaiToken.
Cursor's Tab completion, Auto mode, and certain built-in capabilities may continue to use Cursor's own services. This section primarily explains how to configure an OpenAI API Key and Base URL.

Configuration Steps

  1. Open Cursor Settings: Start Cursor and press Cmd/Ctrl + ,, or open Cursor Settings directly.

  2. Open the Models Page: Find Models, Models & API Keys, or API Keys.

  3. Enter the OpenAI API Key: Paste your MaiToken Key into the OpenAI API Key field.

  4. Override the Base URL: Enable Override OpenAI Base URL (when using key), and enter https://api.maitoken.com/v1 .

  5. Verify the Configuration: Click Verify. If verification fails but the API connectivity test succeeds, check whether Cursor is automatically using a default model that is not included in the current API Key's permissions.

  6. Add a Model: If the page provides an Add Custom Model option, enter <Model ID> in the Model ID field. If this option is unavailable, you can only select models that Cursor currently allows you to associate with a custom OpenAI API Key.

  7. Select the Model: Return to Chat or Composer, disable Auto, and select the newly configured model from the model selector.

Field Value
OpenAI API Key <your MaiToken Key>
Override Base URL https://api.maitoken.com/v1
Model <Model ID>, subject to the models that the current Cursor interface allows you to add or select

Test the Configuration

  1. Test a Basic Conversation: Enter “Reply with OK only” in the chat box. If you receive a valid response, the API Key, API address, and Model ID are configured correctly.

  2. Test Project Reading: Open a test project and enter “Read the current project directory and list only the files at the first level. Do not modify any files.”

  3. Test Agent Capabilities: Ask the model to create a file named test-maitoken.txt and write hello into it. Confirm that the file was created successfully. Do not use a real production project for testing.

Common Issues

Issue Solution
Verify fails Confirm that the Base URL ends at /v1, and check whether the model Cursor uses for verification is included in the API Key's model restriction list.
Chat works but Agent does not The model may not support tool_calls, or Cursor may restrict Agent capabilities for that custom model.
Cursor continues to charge for usage Check whether Auto or a built-in Cursor model is still selected. A custom API Key does not replace all Cursor features.