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

# Cursor

> Use the Hostlinku model in Cursor by overriding the OpenAI base URL-chat, Cmd-K, and Agent-with your own API key

[Cursor](https://cursor.com) allows you to use your own API key with *Override OpenAI Base URL*. By pointing it to Hostlinku, chat, Cmd-K (inline edit), and Agent will use models from the Hostlinku catalog and be charged to your balance, not your Cursor quota.

### Open model settings

`Cursor Settings` (⌘/Ctrl + Shift + J) → **Models** tab.

### Enter the API key and base URL

In the **API Keys** section:

1. Enable the **OpenAI API Key** and paste your Hostlinku API key (`sk-…`).
2. Enable **Override OpenAI Base URL** and enter:

```text theme={null}
https://api.hostlinku.com/v1
```

![Cursor Settings → Models: The "Override OpenAI Base URL" field contains https://api.hostlinku.com/v1](https://mintcdn.com/hostlinku/wMpi8klIZneDqj3k/images/integrations/cursor-openai-base-url.jpg?fit=max\&auto=format\&n=wMpi8klIZneDqj3k\&q=85\&s=32051d6740b5914e48bca28fc993269e)

Don't add `/chat/completions` at the end-Cursor adds the path itself. Click **Save**, then **Verify** next to the API key field; Cursor sends a test request to the gateway.

### Add a Hostlinku model

Still on the **Models** → **Add Custom Model** tab, enter the exact slugs from the [catalog](https://docs.hostlinku.com/en/models.md), one by one:

```text theme={null}
claude-sonnet-4-6
gpt-5-5
deepseek-v4-flash
```

Disable any built-in models you don't want to use to keep the model list concise.

### Select a model in the chat

In the Chat/Agent panel, select the newly added model from the model dropdown. The first request will appear in the console → **Request Log**.

## What You Need to Know

Overrides are global

While **Override OpenAI Base URL** is enabled, all OpenAI family models in Cursor-including those managed by Cursor-are redirected to Hostlinku. Use a Hostlinku slug for all of them, or turn off the override toggle when you want to revert to Cursor’s default models.

* **The request is sent from the Cursor server**, not from your computer. Therefore, the base URL must be
  public - `https://api.hostlinku.com` meets this requirement (the `localhost` address is rejected by Cursor).
* **The Tab cursor (autocomplete) is not affected.** The Tab feature uses Cursor's specialized infrastructure and
  It cannot be transferred to any other provider. Hostlinku supports chat, Cmd-K, and Agent.
* **Agent mode** requires models with *tool calling* and *streaming* capabilities - all models that
  As recommended in the [Overview](https://docs.hostlinku.com/en/integrations.md), make sure to follow these instructions. If the Agent returns a *BAD\_MODEL\_NAME* error, double-check the slug and ensure the **OpenAI API Key** toggle is enabled.
* **Connection hangs / protocol error** - in the same settings, change *HTTP Compatibility*
  Mode\* to **HTTP/1.1**.

The Claude model via OpenAI

You do not need to fill in the *Anthropic API Key* field. The slug `claude-sonnet-4-6` is called via the same OpenAI Chat Completions endpoint; the gateway translates it to the Anthropic protocol.

## Troubleshooting

| Symptoms | Solutions |
| - | - |
| *Verify* failed `401` | The API key is incorrect or has been revoked, or a space was accidentally copied. |
| *Model not found* | Typo in the slug - copied from `GET /v1/models`. |
| Incomplete response | The model has a smaller output limit than what the cursor requested; try a different model or a different service mode. |
| Agent stopped midway with `429` | The agent is sending multiple parallel requests. See [Usage & Limits](https://docs.hostlinku.com/en/usage-and-limits.md). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.