Cursor¶
Put a Vidai key and the gateway's address into Cursor and the chat you have with your own models is governed: checked against your policies, charged to your team and recorded in Request logs. You can pick Claude or Gemini there as well as GPT, because the gateway answers Cursor in the OpenAI format it expects.
What it is¶
Cursor is an editor with AI built in. In its settings you can add your own OpenAI key and override the address it sends OpenAI requests to. Cursor builds the final prompt on its own servers, so every call to the gateway comes from Cursor's servers, not from your laptop. Your gateway has to be reachable from the internet for this to work: a gateway that only answers inside your network or VPN can't be used from Cursor.
The two settings¶
In Cursor Settings › Models, under the OpenAI provider:
| Field in Cursor | Value |
|---|---|
| OpenAI API Key (turn its switch on) | Your Vidai key (starts vk_), never a provider's key |
| Override OpenAI Base URL (turn it on) | https://<your-gateway>/v1 |
A saved key isn't enough: the OpenAI API Key switch has to be on, and Cursor's forum reports that an update can
turn it off again. Then add the model names you want under the list of models and switch them on. The gateway's address is under
Connect your app on the Keys page and in System › Settings › Gateway. You get the key from Keys › Issue a key; its
secret is shown once. Cursor sends the key as Authorization: Bearer, which the gateway accepts.
A minimal call¶
- Fill in the two fields above and add a model name such as
gpt-4o-mini; press Verify if Cursor offers it. - Open a chat, choose that model in the model picker, and send "Reply with exactly: ok".
- A short answer means the address and key are right.
The same works with gemini-3.5-flash, for example: the gateway translates Cursor's OpenAI request for that
provider and the answer back into the OpenAI shape. Claude models work too, under a name that doesn't start with
claude: according to Cursor's forum staff, Cursor sends a name starting claude through its own Anthropic key
setting rather than the OpenAI override, so ask an admin for an alias (see Model names).
Streaming¶
Cursor streams its answers. A stream from Claude or Gemini reaches Cursor as OpenAI chunks; Vidai records the tokens and the cost whether or not Cursor asks for a usage chunk.
Tool calls¶
When a chat uses tools, they travel as OpenAI tool calls and work on every provider the gateway translates to.
Reading what the gateway did¶
Cursor doesn't show response headers. Look the call up in Request logs: filter on Key (the key you pasted),
Model or Path (/v1/chat/completions). The row shows which model answered, what it cost and what your
policies did.
Errors¶
Cursor shows the error message the gateway wrote. The most common ones while setting up:
| What you see | Usual cause |
|---|---|
401 with invalid_api_key or missing_api_key |
The key is mistyped, or it's a provider's key instead of a Vidai key |
403 with model_not_allowed |
Your key may not call that model; ask an admin, or pick one listed under Models |
404 with model_not_found |
The name isn't one your organisation set up; check the spelling |
429 with rate_limit_exceeded, token_limit_exceeded or concurrency_limit_exceeded |
A limit on the key or team was reached; wait a moment |
| Cursor can't connect at all | The gateway isn't reachable from the internet (see above) |
Every error carries an x-vidai-error-code and an x-vidai-request-id; you won't see them in Cursor, but the call is
in Request logs with the same code. See Headers and errors for the full list.
Model names¶
Use the names your organisation approved, as listed under Models in the Control room. Cursor won't add a custom
model named like one of its built-in models (the list then shows "No models available"), and a name starting claude
doesn't use the override (see above); ask an admin for an alias with a different name.
What goes through the gateway¶
| Cursor feature | Through the gateway |
|---|---|
| Chat with a model you added: Agent, Ask and Plan | Yes |
| Inline edit (Cmd/Ctrl+K) with a model you added | Yes, when that model is selected |
| Tab completion | No: always Cursor's own model |
| Cursor's own models, and anything you don't select explicitly | No: they stay on Cursor's infrastructure |
To keep as much as possible on the gateway, pick your own model in every model picker you use.
Check it works in a minute¶
Send "Reply with exactly: ok" in a chat with your model selected, then open Request logs a few seconds later and filter on your key: the call is there.
Good to know¶
- The base URL override is one setting for all of Cursor's OpenAI traffic: while it's on, every OpenAI model you use in Cursor goes to the gateway.
- While your own OpenAI key is on, Cursor's forum staff say its own models (Auto, Composer and its built-in Claude models) can't be used at the same time: it's one or the other. Switch the key off to go back to them.
- Your requests pass through Cursor's servers on their way to the gateway; Cursor's own data handling applies to that leg. Cursor's docs: API keys.
- Issue one key per developer so Request logs and cost reports show who used what.