Cursor: base URL override, and what it does not cover
Use your uttapen key in Cursor by overriding the OpenAI base URL: what works, why Tab and subagents do not, and when Agent mode returns an error.
Updated: 22 Sep 2026
Cursor lets you bring your own OpenAI key and override the base URL, which is how you reach uttapen. Of all the tools in this section, though, Cursor has the least stable support for a custom endpoint: the official docs no longer describe the override steps, and most details come from Cursor staff replies on their own forum. Read the limits before you invest time in it.
Setup
- Cursor Settings → Models.
- Put your
sk-up-…key in the OpenAI key field (Dashboard → API keys). - Turn on Override OpenAI Base URL and set it to
https://api.uttapen.ir/v1. - Under custom models, add the full model id, for example
anthropic/claude-sonnet-5oropenai/gpt-5. Ids containing/are accepted. - Turn Cursor's built-in models off on the same screen so nothing goes to them by accident.
The exact labels have changed between Cursor versions. If you don't see the option under that name, look for the base URL field just below the OpenAI key on the same Models screen.
Limits worth knowing first
These are Cursor's own limits, not uttapen's:
- Tab completion never uses your key; it always runs on Cursor's models. A custom key covers chat and Agent only.
- Every request goes through Cursor's servers, not straight from your machine, so your uttapen key passes through their service. If that doesn't suit you, every other tool in this section connects to us directly.
- While the override is on, requests for built-in OpenAI-family models are sent to your endpoint too. If behaviour gets strange, toggle the override off and on.
- User reports and Cursor staff replies say Agent mode sometimes builds the request body in Responses format. Such a request comes back as
400, because it has nomessagesfield. Ask mode is usually fine. We can't promise this is fixed in your build.
Keeping cost in check
Cursor has no setting for a maximum output-token count and doesn't document what max_tokens it sends, so the guardrails have to live on our side:
- Create a dedicated key for Cursor with a monthly cap (API keys). If the tool spends more than you expect, it stops there.
- Restrict that key's
allowed_modelsso stray requests can't reach an expensive model. - Watch the spend per key in Dashboard → Usage.
As a reminder: uttapen reserves the cost of the largest possible output before each request and charges only real usage afterwards (pricing). If your balance can't cover the whole ceiling, we lower it to what the balance allows (floor 1,024 tokens) and return the granted value in the X-Uttapen-Max-Tokens header, so a reply may end unfinished. 402 is only for the case where even that floor doesn't fit.
Troubleshooting
| Error | Likely cause | Fix |
|---|---|---|
401 invalid_api_key | The uttapen key isn't in the OpenAI key field, or it was revoked | Re-enter it under Settings → Models |
404 model_not_found | The custom model id is wrong | Copy the id from /en/models (the 404 also lists the closest ids it guessed, in uttapen.suggestions) |
400 invalid_request with no messages field | The body was built in Responses format (Agent mode) | Use Ask mode, or another tool from this section |
402 insufficient_balance | Balance below the required hold | Top up, and check the key's monthly cap |
429 | The key's rate limit (rate limits) | Raise rate_limit_rpm |
If you want a coding agent with full control over the model and the output ceiling, opencode, Cline and Kilo Code are the safer picks. The full list is in integrations.
Sign up with a phone number, top up your wallet from 100,000 toman and create a key. Free models work without a top-up — up to 50 requests a day. Create an API key →