Skip to content

Models

Cursor

Cursor can send its chat and agent requests to any OpenAI-compatible endpoint. Point it at Grafilab and the model picker gains your Grafilab models, billed to your Grafilab credit balance.

  • Cursor installed and signed in. The override lives in Cursor’s own settings, not in a settings.json file.
  • A Grafilab API key. In the console open API (https://app.grafilab.ai/api) and click Generate New Key — see API Keys.

Name the key cursor so the usage view shows what the editor costs you.

The model catalog is live, so list it rather than copying ids from a page. Every entry’s id is the exact string to use in any tool or SDK.

Terminal window
curl https://llm.grafilab.ai/v1/models \
-H "Authorization: Bearer $GRAFILAB_API_KEY" | jq -r '.data[].id'

The same ids appear as cards in the Playground, with context size and prices.

Cursor sends whatever string you type as the model field, so it must match a catalog id character for character.

  1. Open Cursor Settings with Ctrl+Shift+J (Windows and Linux) or Cmd+Shift+J (macOS), then select Models in the sidebar. The page lists the model providers Cursor knows about.

  2. Find OpenAI in the provider list and paste your Grafilab key into the OpenAI API Key field. Cursor uses this field for the overridden endpoint too, even though the key is not an OpenAI key.

  3. Turn on Override OpenAI Base URL and enter the base URL exactly:

    https://llm.grafilab.ai/v1

    Do not add /chat/completions — Cursor appends the path itself.

  4. Select Verify (or Save, depending on your Cursor version). Cursor calls GET /v1/models against the base URL you entered; a green confirmation means the URL and key both work.

  5. Select Add model, type your Grafilab model id exactly as GET /v1/models returned it, and confirm. Repeat for every model you want in the picker.

  6. Turn off the built-in OpenAI models in the same list. Your one custom key applies to every model Cursor treats as “OpenAI”, so leaving gpt-* entries enabled sends requests for models Grafilab does not serve and they fail with 404.

  7. Open the chat panel with Ctrl+L / Cmd+L and choose your Grafilab model from the model picker.

Send a short prompt in the chat panel — “reply with the word ok” is enough. A reply means the route works end to end.

Then confirm the traffic is really yours: open API in the console, select View Usage on the cursor key, and check that a request landed for today. Usage rollups can lag by up to about 30 minutes, so give it a moment before concluding anything.

Two things are worth knowing before you rely on this setup.

Your key travels through Cursor. Cursor builds the final prompt on its own servers, so every request — including the one carrying your Grafilab key — is routed through Cursor’s backend rather than going straight from your machine to llm.grafilab.ai. That is how the feature works by design, and it is a reason to use a dedicated key you can rotate on its own.

Not every feature follows the override. Tab autocomplete keeps using Cursor’s built-in models regardless of your key, and some agent and inline-edit paths do the same. Expect the chat panel to use Grafilab while parts of the editor keep billing Cursor.

SymptomCauseFix
Verify fails with an invalid-key or connection errorThe base URL is missing /v1, or has a trailing slash or a path suffixSet it to exactly https://llm.grafilab.ai/v1
404 when you send a messageThe model id does not match a catalog entry, or a built-in OpenAI model is still selectedRe-list with GET /v1/models, retype the id, and disable the built-in models
401 on every requestThe key has stray whitespace, or it was rotated in the consolePaste the key again from API; a rotated key stops working within about 20 seconds
429 with a quota messageYour Grafilab credit balance is empty — this is not a throughput limitTop up in the console
Chat works but Tab suggestions look unchangedExpected: Tab does not use the overrideNothing to fix