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

# Cursor | AI Gateway

> Route Cursor chat model calls through Orq.ai AI Gateway for unified observability, cost tracking, and model governance.

Route Cursor chat model calls through the [**Orq.ai AI Gateway**](/docs/ai-gateway/get-started/quickstart) by overriding the OpenAI base URL in Cursor Settings. Requests appear in [Traces](/docs/ai-gateway/traces) automatically.

<Warning>
  **Three limitations to know before starting:**

  * Only the **chat/plan panel** (<kbd><Icon icon="command" /></kbd>+<kbd>L</kbd> / <kbd>Ctrl</kbd>+<kbd>L</kbd>) routes through the custom endpoint. Composer, inline edit (<kbd><Icon icon="command" /></kbd>+<kbd>K</kbd> / <kbd>Ctrl</kbd>+<kbd>K</kbd>), and tab completion remain on Cursor's backend.
  * Setting a custom base URL disables Cursor's default model list. Add models manually using provider-prefixed IDs (see **Add a model** below) or remove the base URL override to restore the defaults.
  * Custom API key and base URL override require **Cursor Pro or higher**.
</Warning>

## Prerequisites

* Cursor Pro or higher
* Active **Orq.ai** account with **AI Gateway** access
* [Orq.ai API key](/docs/ai-gateway/configuration/api-keys)
* Model enabled in [**AI Gateway** → **Supported Models**](/docs/ai-gateway/supported-models)

## Setup

<Steps>
  <Step title="Open Cursor Settings and navigate to Models">
    Open **Cursor Settings** (<kbd><Icon icon="command" /></kbd>+<kbd>,</kbd> / <kbd>Ctrl</kbd>+<kbd>,</kbd>) and select the **Models** tab.
  </Step>

  <Step title="Enter the API key">
    Enable the **OpenAI API Key** toggle and paste the **Orq.ai** API key in the field. Cursor sends this key to whatever base URL is configured below. It does not have to be an OpenAI key.
  </Step>

  <Step title="Set the base URL">
    In **Override OpenAI Base URL**, enter:

    ```
    https://api.orq.ai/v3/router
    ```

    If the field is not visible, expand the advanced options under the OpenAI API Key toggle.
  </Step>

  <Step title="Add a model">
    In the **Model Names** field, enter a provider-prefixed model ID (e.g. `openai/gpt-5.4` or `anthropic/claude-sonnet-4-6`), then click **Verify**. A green checkmark confirms the model is reachable. Click **Save**.

    Repeat for each model to add.
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Verify fails with authentication error">
    Confirm the API key is a valid **Orq.ai** API key and that the model ID is enabled in [**AI Gateway** → **Supported Models**](/docs/ai-gateway/supported-models).
  </Accordion>

  <Accordion title="Model not found or 404 error">
    The model must use the provider-prefixed format (e.g. `openai/gpt-5.4`, not `gpt-4o`) and must be enabled in [**AI Gateway** → **Supported Models**](/docs/ai-gateway/supported-models).
  </Accordion>

  <Accordion title="No Traces appearing in Orq.ai">
    Confirm the base URL is set to `https://api.orq.ai/v3/router` and the request is sent from the **chat panel** (<kbd><Icon icon="command" /></kbd>+<kbd>L</kbd> / <kbd>Ctrl</kbd>+<kbd>L</kbd>). Inline edit and tab completion bypass the custom endpoint.
  </Accordion>

  <Accordion title="Default Cursor models stopped working">
    Setting a custom base URL disables the default Cursor model list. Remove the base URL override in **Cursor Settings → Models** to restore default behavior, or add the required models manually using provider-prefixed IDs.
  </Accordion>
</AccordionGroup>

## Verification

Send a message in the **chat panel** (<kbd><Icon icon="command" /></kbd>+<kbd>L</kbd> / <kbd>Ctrl</kbd>+<kbd>L</kbd>). The response appears in Cursor and the trace appears in [**Orq.ai** Traces](/docs/ai-gateway/traces) with the model identifier (e.g. `openai/gpt-5.4`).
