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

# Cursor

> How to connect the Cursor AI editor to RuAPI by overriding the OpenAI Base URL — your own key, no subscription

[Cursor](https://cursor.com) is an AI code editor built on VS Code. You can point its chat and inline edits at RuAPI by overriding the **OpenAI Base URL** — Claude, GPT, Gemini and other models plug in by their IDs.

<Note>
  Overriding the base URL affects **chat and inline commands**. Cursor's signature features (Tab autocomplete, the agentic Composer) rely on Cursor's own models and may not work through a third-party endpoint — that's expected.
</Note>

## Prerequisites

<Steps>
  <Step title="RuAPI account and API key">
    Console → **Tokens** → create an `sk-...` key. The balance tops up in USDT — see [Top-up](/en/topup).
  </Step>
</Steps>

## Setup

<Steps>
  <Step title="Open model settings">
    **Cursor Settings** (the gear icon top-right, or `Cmd/Ctrl + Shift + J`) → the **Models** section.
  </Step>

  <Step title="Enter the key and address">
    | Field                        | Value                                       |
    | ---------------------------- | ------------------------------------------- |
    | **OpenAI API Key**           | `sk-your-key`                               |
    | **Override OpenAI Base URL** | `https://www.ruapi.ai/v1`  — **with** `/v1` |

    Turn on the **Override OpenAI Base URL** toggle and paste the address.
  </Step>

  <Step title="Add models">
    In the model list, turn off the defaults and click **+ Add model** — enter exact model IDs (from the [pricing page](https://www.ruapi.ai/pricing)). The ID must match verbatim.
  </Step>

  <Step title="Verify the key">
    Click **Verify** (or save). Once it passes, you're set.
  </Step>
</Steps>

## First request

Open chat (`Cmd/Ctrl + L`), pick your added model at the top, and send:

```
Explain what this file does.
```

A reply plus an entry in RuAPI Console → **Logs** means it's working.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Verify fails / 401">
    * The key must be a RuAPI token (`sk-...`), not an OpenAI key.
    * Check that the Override Base URL toggle is on and the address is `https://www.ruapi.ai/v1` with `/v1`.
    * Remove stray spaces when pasting.
  </Accordion>

  <Accordion title="Model not found">
    The model ID must match RuAPI verbatim. Exact names are on the [pricing page](https://www.ruapi.ai/pricing).
  </Accordion>

  <Accordion title="Tab and Composer don't work with my models">
    That's normal: those features use Cursor's own models. Chat and inline edits work reliably through a third-party Base URL.
  </Accordion>
</AccordionGroup>
