> ## Documentation Index
> Fetch the complete documentation index at: https://doc.xbhuiz.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cursor API Key

> Configure Cursor with one XMAI API key and the OpenAI-compatible base URL.

Use XMAI in Cursor by enabling the OpenAI API key path, pasting your
XMAI token, and setting the override base URL to
`https://xmapi.site/v1`.

## Direct answer

In Cursor, open **Settings → Models → API Keys**:

| Field             | Value                                    |
| ----------------- | ---------------------------------------- |
| OpenAI API Key    | your XMAI API key                        |
| Override Base URL | `https://xmapi.site/v1`                  |
| Model ID          | a supported id such as `claude-opus-4-8` |

## Step 1: Create an XMAI key

Open the [API Keys dashboard](https://xbhuiz.com/dashboard/tokens), create a
key named something like `cursor-local`, and copy it.

## Step 2: Configure Cursor

In Cursor's model settings:

1. Enable the OpenAI API key option.
2. Paste your XMAI key.
3. Enable Override Base URL.
4. Set the base URL to `https://xmapi.site/v1`.

## Step 3: Add model ids

Use exact model ids from [Models](/en/models). Cursor can reach supported Claude,
GPT, Gemini, and Grok models through the OpenAI-compatible endpoint.

Examples:

* `claude-opus-4-8`
* `gpt-5.5`
* `gemini-3.1-pro-preview`
* `grok-4.5`

## FAQ

### What base URL should Cursor use?

Use `https://xmapi.site/v1`.

### Can Cursor use Claude through an OpenAI-compatible endpoint?

Yes. XMAI maps supported Claude ids through the OpenAI-compatible Chat
Completions endpoint, so Cursor can call Claude by model id.

### Should I use one key for every Cursor workspace?

You can, but separate keys per workspace are easier to revoke, cap, and audit.
