# Cursor

Cursor accepts custom OpenAI-compatible providers for its chat. Set the base URL to The Grid, paste your consumption key, and add instrument names like `text-prime` or `code-prime` as custom models.

For the full instrument catalog, see [Current instruments](/docs/instrument-specifications/current-instruments.md).

{% hint style="info" %}
Cursor's Tab autocomplete and proprietary agent features run on Cursor's own models and do not go through the custom OpenAI endpoint. The custom-provider setup below replaces the chat model only.
{% endhint %}

## Prerequisites

* Cursor installed ([cursor.com](https://cursor.com))
* A Grid account at [app.thegrid.ai](https://app.thegrid.ai) with funded credits
* A Grid consumption API key from your dashboard

## Setup

### 1. Open Cursor settings

Open Settings with `Cmd ,` (Mac) or `Ctrl ,` (Windows / Linux), then go to the **Models** tab.

### 2. Override the OpenAI base URL

* Toggle **Override OpenAI Base URL** on
* Paste `https://api.thegrid.ai/v1` into the URL field
* Click **Verify** to confirm Cursor can reach the endpoint

### 3. Set your Grid key

* In the **OpenAI API Key** field, paste your Grid consumption API key
* Click **Verify**

### 4. Add Grid instruments as custom models

Use the **Add Model** button to register the instruments you want available in chat:

* `text-prime` (production default)
* `text-max` (frontier reasoning)
* `text-standard` (high-volume, low-latency)
* `code-prime` (default for coding work)
* `code-max` (whole-codebase changes)
* `code-standard` (autocomplete and batch edits)

Add only the instruments you intend to use. You can add or remove them at any time.

### 5. Pick the active model

In the chat composer, open the model picker and select one of your registered Grid instruments (for example, `code-prime`).

## Verify

Open Cursor chat. Run a small prompt against `text-prime` or `code-prime`:

```
Reply with the word OK only.
```

A normal response confirms the integration. If you see an authentication error, re-verify the API key in step 3. If the request reaches Cursor but fails downstream, check your credit balance at [app.thegrid.ai](https://app.thegrid.ai).

## Troubleshooting

* **`401 Unauthorized`.** The Grid did not accept the key. Confirm it is a consumption key (not a trading key) and that you pasted it without surrounding whitespace.
* **`402 Payment Required`.** Credits are empty. Top up at [app.thegrid.ai](https://app.thegrid.ai). Auto-Reload tops your credit balance up automatically when configured in the dashboard.
* **`404 Not Found` on a model name.** Cursor sent a model string The Grid does not recognize. Make sure the custom model name matches a Grid instrument exactly (e.g., `text-prime`, not `Text Prime`).
* **Tab and Compose still use Cursor's models.** That's by design. The custom-provider override applies to chat. To change Tab or Compose backends, look for separate options in the Models tab if your Cursor version exposes them.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://thegrid.ai/docs/integrations-and-best-practices/integrations/cursor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
