TemprTempr
Docs
Guides

Cursor

Last updated

Cursor's model picker only shows what Cursor itself has integrated and priced. Override its OpenAI base URL to point at Tempr Gateway instead, and the AI panel can run any model on your own gateway allowlist, including ones Cursor doesn't offer at all, billed through your own BYOK keys instead of Cursor's managed plans.

  1. Create a virtual key

    In the Portal, create a Gateway virtual key. Keys are prefixed tvk_ and shown once at creation.

  2. Add a provider key

    Gateway is BYOK: add a key for at least one provider from the supported list.

  3. Configure Cursor

    Open Settings → Cursor Settings → Models. Enable Override OpenAI Base URL and set it to https://api.temprhq.io/v1. Click Add OpenAI API Key and paste your virtual key.

Scope

Tab autocomplete and inline edit (Cmd/Ctrl + K) stay on Cursor's own backend regardless of this setting; it's a Cursor architecture detail, not a Tempr limitation. Only the AI panel (chat and agent mode) routes through the custom base URL.

Model ids

Use the fully-qualified provider/model form (e.g. anthropic/claude-sonnet-4-5, openai/gpt-5), the same ids GET /v1/models returns.

Each needs a key for its provider in the Portal: anthropic/claude-sonnet-4-5 an Anthropic key, openai/gpt-5 an OpenAI key. Or use any model from GET /v1/models, which lists only what your keys can call.

On a coding plan

Tempr serves each coding plan only to the tools its vendor allows, and recognises a tool by the identity it sends. Cursor's requests come from Cursor's servers, not from your machine, so Tempr can't tell it from a script, and a plan limited to the tools its vendor names, or to coding tools Tempr recognises (Z.AI, Kimi, Alibaba, Tencent, KUAE and others), refuses it with a plan_tool_not_allowed error. Cursor can use the plans that accept any tool: MiniMax, StepFun, Synthetic, Ollama Cloud, NanoGPT, Fire Pass and ClinePass. Name the model by the plan: minimax-plan/MiniMax-M3.1-Flash-Preview. Tempr can get the plan's key two ways:

  • Stored in Tempr. Add the plan's key under Provider keys in the Portal, and keep Cursor's settings as they are, with your virtual key.
  • Sent with each request isn't possible from Cursor: it has no setting for an extra header, so store the plan's key in Tempr.

Cursor's requests reach Tempr from Cursor's own servers rather than from your computer, and some plans refuse tools they don't support, so a plan may refuse requests from Cursor. Check which tools each plan supports before you subscribe.

Ask Cursor about your Gateway

Cursor's agent can also read your Gateway through the Gateway's own MCP server: usage and cost, request logs and one request's routing, keys, plan, and providers cooling down. Ask it "why did my last few requests fail?" or "which key spent the most this week?" while you work. It comes with the Gateway Pro, Scale and Enterprise plans.

The quickest way is to sign in. Add the server to ~/.cursor/mcp.json; under Customize, Cursor marks it as needing sign-in, and Authenticate opens Tempr's sign-in in the browser:

{
  "mcpServers": {
    "tempr-gateway": {
      "url": "https://api.temprhq.io/mcp/admin"
    }
  }
}

Signed in this way, Cursor reads your own Gateway, or your organization's if you're an owner or admin. To let it make changes too, tick Also let it make changes on Tempr's consent page.

To give it a management key instead:

  1. Create a management key

    In the Portal, under Gateway → Keys → Management keys (or Organization → Org keys for an organization's Gateway). A management key reads and manages the Gateway but can't call models, so it's separate from the tvk_ virtual key Cursor uses for its model. Tick what Cursor may do: Read usage, Read request logs and List keys to read; Create, change and revoke keys as well if it may change keys.

  2. Send the key from an environment variable

    Put the key in TEMPR_MANAGEMENT_KEY and send it as a bearer token. Cursor fills in ${env:…} when it starts the server, so the same file can go in a project's .cursor/mcp.json for your team, each person with their own key:

{
  "mcpServers": {
    "tempr-gateway": {
      "url": "https://api.temprhq.io/mcp/admin",
      "headers": { "Authorization": "Bearer ${env:TEMPR_MANAGEMENT_KEY}" }
    }
  }
}
  • The key's permissions decide the tools. Without Read request logs, Cursor gets the usage, plan and key tools but not the logs. Customize lists what it has.
  • Changes also need the account to allow them: turn on Changes by AI agents on the Portal's MCP connectors page. Cursor can then make changes that only tighten, such as creating a key that expires within 90 days or revoking one, and propose any that would loosen, such as a higher budget, for you to approve in the Portal, and asks you first unless you've let it run tools without asking. A new key's secret never reaches it: it gets a one-time Portal link for you to copy the key from.

What's next