Hi Cursor team,
I’m building a headless app using @cursor/sdk (local runtime). Cursor.models.list() returns the full catalog (~30 models) with parameters and variants, but any explicitly named model fails at run time. Only default / auto completes successfully.
This happens with BYOK disabled and no custom API keys on the account, just a standard Cursor user API key from the dashboard.
| SDK | @cursor/[email protected] |
| BYOK | Disabled |
| Runtime | Local (local: { cwd, settingSources: }) |
| Custom provider keys | None on account |
| Auth | User API key (CURSOR_API_KEY from Cursor Dashboard → API Keys) |
| Node | v22.19.0 |
Minimal repro (no MCP, no custom tools, no project settings):
import { Agent, Cursor } from "@cursor/sdk";
const apiKey = process.env.CURSOR_API_KEY!;
// Step 1: catalog works — returns 30 models including composer-2.5, claude-sonnet-4-6, etc.
const models = await Cursor.models.list({ apiKey });
const composer = models.find((m) => m.id === "composer-2.5");
// composer.parameters includes { id: "fast", values: ["false", "true"] }
// composer.variants includes isDefault: true with params: [{ id: "fast", value: "true" }]
// Step 2: named model fails
const agent = await Agent.create({
apiKey,
model: {
id: "composer-2.5",
params: [{ id: "fast", value: "true" }], // catalog default variant
},
local: { cwd: process.cwd(), settingSources: [] },
});
const run = await agent.send("Reply with exactly: ok");
const result = await run.wait();
// result.status === "error"
Same failure with:
{ id: "composer-2.5" }(no params)- Default variant params from
variants.find(v => v.isDefault) - Other models:
claude-sonnet-4-6,gpt-5.4-mini,claude-opus-4-6 - Both minimal config (
settingSources: []) and full bot config (settingSources: ["project"], MCP, custom tools)
What works:
model: { id: "default" } // ✅ status: "finished"
model: { id: "auto" } // ✅ resolves to default, status: "finished"
What happens
-
Agent.create()succeeds — agent ID is assigned (e.g.agent-80704988-...). -
agent.send()succeeds — run ID andrequestIdare returned. -
Stream emits:
{"type":"status","status":"RUNNING"} {"type":"status","status":"ERROR"} -
run.wait()resolves with:{ "status": "error", "model": { "id": "composer-2.5", "params": [{ "id": "fast", "value": "true" }] }, "durationMs": 3076, "result": undefined } -
run.conversation()returns[](empty — no assistant text, no error detail). -
No exception is thrown — this is a run-level failure, not a
CursorAgentErrorstartup failure.
Error codes / identifiers
There is no HTTP status code or error message in the response. What we do get:
| Field | Example value |
|---|---|
run.status |
"error" |
Stream status |
"ERROR" (after "RUNNING") |
run.requestId |
f6ff0b72-9585-4278-9aa8-31b237362eb0 |
run.id |
run-b397e483-32eb-4c57-935a-c3a82282f107 |
agent.agentId |
agent-80704988-2991-41cd-957e-df710d01fa79 |
result.result |
undefined |
run.conversation() |
[] |
No CursorAgentError is thrown. No message like “model not available” or “unsupported model” appears in the stream or RunResult.
What I’ve ruled out
- Missing
model.params— docs say parameterized models need explicit params; I pass the catalog default variant (fast: truefor composer-2.5). Still fails. - BYOK / custom keys — disabled and confirmed none on account.
- Wrong model ID — IDs match
Cursor.models.list()exactly; aliases also tried. - Local config pollution — fails with
settingSources: [](no project/user settings loaded). - SDK version — reproduced on
@cursor/[email protected].
Has anyone else experienced this? If so, were you able to identify the cause or find a workaround?
Thanks!