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, choose a non-reasoning model: its details do not list the reasoning capability, and it accepts openai_chat_completions. grok-4.20-non-reasoning is one example; confirm it is still listed 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.

Generate images and video in the same agent

Cursor can also create images and short videos with the TokenLab MCP server. Each generation is paid from the same TokenLab balance. MCP does not replace the main chat model. Save this as ~/.cursor/mcp.json, or merge the tokenlab entry into your existing file:

{
  "mcpServers": {
    "tokenlab": {
      "command": "npx",
      "args": ["-y", "@tokenlabai/mcp-server@0.6.48"],
      "env": {
        "TOKENLAB_MCP_TOOL_PROFILE": "core",
        "TOKENLAB_API_KEY": "<TOKENLAB_API_KEY>"
      }
    }
  }
}

Replace <TOKENLAB_API_KEY> with your key on your own computer, and do not commit this file. Check that tokenlab is enabled in Cursor's MCP settings. Then try:

Call get_model_pricing for nano-banana-2, then use create_image with nano-banana-2 at 1k to make a photo of a matte black coffee mug on a white desk.

create_video returns a task ID. The agent calls get_task_status until the video is ready.

Add API instructions separately

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