Docs / Integrations / Cursor
Cursor with RelayRouter
Cursor lets you replace its OpenAI endpoint with your own OpenAI-compatible base URL. Point it at RelayRouter and the chat panel can use any model in your key's group, including Claude and Gemini models, billed per token from your RelayRouter balance.
#Setup
| Step | Where | Value |
|---|---|---|
1 | Cursor Settings → Models → OpenAI API Key | Paste a RelayRouter key created for an OpenAI-protocol group |
2 | Override OpenAI Base URL | https://relayrouter.io/v1 |
3 | Add model | Type the exact model id, for example gpt-6-astra or claude-opus-5-5, then enable it |
4 | Verify | Click Verify next to the key; then pick the model in the chat model selector |
Use a key whose group speaks the OpenAI protocol (the GPT and Codex groups, or any group marked OpenAI on the models page). Cursor sends OpenAI-style requests, so a key bound to an Anthropic-protocol group will return 404 for the model.
#What works and what does not
Chat, inline edits and agent conversations that use your selected model go through RelayRouter. Features that Cursor runs on its own servers, such as Tab completions and some indexing, are not routed through a custom base URL. Streaming works; keep long tasks under the timeout you set in Cursor.
#Verify the key outside Cursor
terminalbash
curl https://relayrouter.io/v1/chat/completions \
-H "Authorization: Bearer sk-your-relayrouter-key" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-6-astra","messages":[{"role":"user","content":"ping"}]}'#Troubleshooting
| Symptom | Fix |
|---|---|
Verify fails with 401 | Key typo, disabled key or empty balance; check the console |
Model shows but replies 404 | The id is not in the key's group; use the id exactly as listed and the right group |
Responses stop mid-way | Raise Cursor's request timeout or pick a faster group |