TokenLab

Coding Tools

Cursor

Configure TokenLab for supported Cursor chat models, verify the connection, and add MCP or Skills separately

What this connection does

Use TokenLab for supported chat requests in the Cursor desktop editor on macOS, Windows, or Linux. Cursor documents OpenAI BYOK support for standard, non-reasoning chat models; Tab completion still uses Cursor's models. An OpenAI Base URL override does not turn Cursor into a client for every TokenLab model or protocol. See Cursor's API-key limits.

If you only need TokenLab image, video, or other API tools, keep your current chat provider and add MCP instead. A Skill teaches the agent how to use the APIs; it does not change the chat provider.

Give this task to your agent

Read https://tokenlab.sh/docs/en/integrations/cursor and check my installed version and operating system.
Confirm whether I need TokenLab as the main model, MCP tools, or API Skills.
Preserve existing accounts, provider configuration, and permissions; explain how to restore changed settings.
Keep API keys local; do not ask me to paste them into chat. I will enter the key locally and perform required UI steps.
Explain the cost of a small verification request. Only after I explicitly choose that test, help run it and match the TokenLab request record.

Open the correct settings

  1. Install or update the desktop editor from Cursor Downloads. This guide does not configure Cursor CLI or Cloud Agents.
  2. Open Cursor Settings from the command palette, or press Cmd/Ctrl + Shift + J. Cmd/Ctrl + , opens the general editor settings instead.
  3. Open Models and note your existing OpenAI key and Base URL configuration so you can restore it. Keep other provider settings intact.
  4. In OpenAI API Key, enter your TokenLab key locally and save it. Do not paste the key into an agent conversation or commit it to a project.
  5. Enable Override OpenAI Base URL and enter:
https://api.tokenlab.sh/v1

Cursor sends BYOK requests through its backend for prompt assembly; this is not a direct connection from your editor to TokenLab.

Select a supported model

Copy the exact model ID from the current TokenLab catalog, and check that Cursor accepts it through its OpenAI BYOK path. A model being listed as chat on TokenLab does not establish Cursor compatibility.

For an initial text check, gpt-4.1-mini is an example of a non-reasoning OpenAI chat model; confirm it is still available before using it. Enable the existing entry in Models, or use Add model if it is absent, then select that exact model in the chat picker. Do not duplicate a built-in model under a different spelling, and do not assume Claude or Gemini entries use the OpenAI override. Cursor's custom-model guidance explains these routing limits.

Verify one small request

Start a new chat with the selected model and send:

Reply only with TOKENLAB_CONNECTION_OK. Do not use tools or modify files.

This is a billable model request. Check both the reply and the matching model, time, and status in TokenLab Requests. A saved key, a visible model, or a reply without a matching TokenLab request does not confirm this route.

If it fails

  • The model is missing or rejected: check the exact ID and Cursor's current BYOK support. Use an existing built-in entry when available; restarting alone cannot make an unsupported model compatible.
  • Authentication fails: re-enter the TokenLab key in the OpenAI field and check the Base URL. A balance or quota error is separate from an invalid key; follow the returned error and the corresponding TokenLab request.
  • No TokenLab request appears: confirm the selected model and override, then inspect Cursor's error. Tab completion and other Cursor-managed features are not a connection test.
  • Another provider stops working: restore the previous OpenAI settings or disable the override, then start a new chat. Avoid changing unrelated provider keys to repair this route.

Add tools or instructions separately

TokenLab MCP adds callable tools. Configure it through Cursor's MCP settings or .cursor/mcp.json; first check tool discovery, then deliberately run any billable generation you need. Installing MCP does not replace the main chat model.

TokenLab Skills supply API instructions. For a project-local installation, keep the complete skill directory at .cursor/skills/tokenlab-api-integration/, including SKILL.md and its referenced files. Check Customize → Skills for discovery. Skills do not supply a key or install an MCP server. See the official MCP and Skills guides for your Cursor version.

On this page