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.
Prerequisites
Section titled “Prerequisites”- Cursor installed and signed in. The override lives in Cursor’s own settings, not in a
settings.jsonfile.
- 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.
Pick a model id
Section titled “Pick a model id”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.
curl https://llm.grafilab.ai/v1/models \ -H "Authorization: Bearer $GRAFILAB_API_KEY" | jq -r '.data[].id'from openai import OpenAI
client = OpenAI(api_key="sk-grafilab-...", base_url="https://llm.grafilab.ai/v1")for model in client.models.list(): print(model.id)import OpenAI from "openai";
const client = new OpenAI({ apiKey: "sk-grafilab-...", baseURL: "https://llm.grafilab.ai/v1" });for await (const model of client.models.list()) { console.log(model.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.
Connect Cursor to Grafilab
Section titled “Connect Cursor to Grafilab”-
Open Cursor Settings with
Ctrl+Shift+J(Windows and Linux) orCmd+Shift+J(macOS), then select Models in the sidebar. The page lists the model providers Cursor knows about. -
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.
-
Turn on Override OpenAI Base URL and enter the base URL exactly:
https://llm.grafilab.ai/v1Do not add
/chat/completions— Cursor appends the path itself. -
Select Verify (or Save, depending on your Cursor version). Cursor calls
GET /v1/modelsagainst the base URL you entered; a green confirmation means the URL and key both work. -
Select Add model, type your Grafilab model id exactly as
GET /v1/modelsreturned it, and confirm. Repeat for every model you want in the picker. -
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 with404. -
Open the chat panel with
Ctrl+L/Cmd+Land choose your Grafilab model from the model picker.
Verify
Section titled “Verify”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.
What still runs on Cursor’s models
Section titled “What still runs on Cursor’s models”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.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
| Verify fails with an invalid-key or connection error | The base URL is missing /v1, or has a trailing slash or a path suffix | Set it to exactly https://llm.grafilab.ai/v1 |
404 when you send a message | The model id does not match a catalog entry, or a built-in OpenAI model is still selected | Re-list with GET /v1/models, retype the id, and disable the built-in models |
401 on every request | The key has stray whitespace, or it was rotated in the console | Paste the key again from API; a rotated key stops working within about 20 seconds |
429 with a quota message | Your Grafilab credit balance is empty — this is not a throughput limit | Top up in the console |
| Chat works but Tab suggestions look unchanged | Expected: Tab does not use the override | Nothing to fix |

