Skip to main content
ValarCode routes Cursor through Valar by pointing its OpenAI-compatible override at the gateway. Cursor keeps speaking the OpenAI Chat Completions API; the gateway maps whatever model it sends to the target your routing resolves to. See Set up ValarCode for the shared setup and the client-id model.

Prerequisites

  • Cursor installed and signed in, on a paid plan (Pro, Business, or Enterprise). valar cursor on fails on the free plan or when Cursor is not signed in.
  • A Valar coding key (vlrcode_…) and the valar CLI (install).

Enable routing

Quit Cursor first, or let valar do it for you. Cursor keeps its settings in memory and flushes them on exit, so a change written while it runs would be silently reverted. Run once per machine:
If Cursor is running, valar offers to quit it, apply the change, and relaunch it — pass --force to pre-answer that prompt, which scripts need since a non-interactive run fails rather than ask. If you quit Cursor yourself, restart it to pick up the change. Check the state any time:

What gets written

Cursor stores its settings in a SQLite database, state.vscdb. valar cursor on sets: Cursor appends /chat/completions to the base URL, so the endpoint is written with the /v1 suffix. Cursor’s built-in catalog is left as-is, but enabling adds a Valar-Coding-Auto entry to your model list, turns it on, and selects it as the active model — including in chats you already had open. Before the first change, the touched rows are snapshotted under ~/.valar/cursor/ (keyed by a hash of the state.vscdb path, so separate installs never collide), and off restores them.
Cursor cannot set custom request headers, so the client id rides as a token suffix (<coding-key>~<client-id>) rather than an X-Valar-Client-Id header. The gateway splits on the last ~, authenticates the base key, and routes on the id. By default the id is your OS username; use --user-id RANDOM for an opaque one. See per-engineer attribution.
Cursor keeps state.vscdb values as SQLite TEXT and silently discards any row whose value is a BLOB on launch. The CLI writes the values as TEXT for this reason; a raw byte write would be wiped on the next restart.

Turn off routing

Quit Cursor first (or pass --force), then:
This restores the pre-enable rows. Restart Cursor to pick up the change.

Next steps

Model routing

How cohorts and the split decide which model serves each request.

Models

The open-weight targets and the frontier Claude tiers.