Cursor IDE (Beta)
Integrate Cursor IDE BYOK with Yaha Gateway via the dedicated /v1/cursor endpoint.
Beta: Cursor BYOK is unofficial on Cursor's side. Tab completions, Composer, and Agent mode may not route through your custom base URL. Use the dedicated
/v1/cursorendpoint for best compatibility.
Cursor supports custom OpenAI-compatible endpoints via Settings → Models → Override OpenAI Base URL. Yaha exposes a dedicated Cursor route (similar to OpenRouter's Cursor integration) that normalizes Cursor's Responses-shaped requests and bridges streaming tool calls.
Setup
-
Open Cursor Settings (gear icon or
Cmd/Ctrl + ,) -
Go to Models → expand API Keys
-
Toggle on OpenAI API Key and paste your Yaha project key (
yaha.*) -
Toggle on Override OpenAI Base URL and set:
https://gateway.yahagateway.io/v1/cursor -
Add your allowed model ID (must be on the project plan allowlist)
Copy-paste snippets are also available in the Yaha console under Integrations → Coding agents.
Why /v1/cursor?
| Base URL | Behavior |
|---|---|
https://gateway.yahagateway.io/v1/cursor | Recommended. Forces Cursor client profile; handles Responses payloads, tool-call bridging, and prompt compression. |
https://gateway.yahagateway.io/v1 | Legacy. Auto-detects Cursor via User-Agent or payload shape. |
Cursor sends Responses API bodies (input[], tools, reasoning) to POST /chat/completions. The gateway rewrites these to upstream /v1/responses and bridges SSE back to chat-completion chunks.
Supported features
| Feature | Behavior |
|---|---|
| Path rewrite | POST /v1/cursor/chat/completions → upstream /v1/responses |
| Streaming bridge | Responses SSE → chat.completion.chunk |
| Tool calls | ApplyPatch and function calls bridged to OpenAI format |
| Prompt compression | Preserves <user_query>; compacts MCP blocks |
MCP (Tool Bridge)
Enable Tool Bridge on the project:
- URL:
https://gateway.yahagateway.io/mcp/v1 - Authorization:
Bearer yaha.<your-project-key>
See MCP Tool Bridge.
Limitations
- Tab completions use Cursor's built-in models; BYOK does not apply.
- Composer / Agent mode may route through Cursor's backend.
- Only allowlisted models with upstream provider keys will work.
Common errors
| Symptom | Fix |
|---|---|
| Tool call failures | Use /v1/cursor base URL, not /v1 alone |
403 forbidden | Check yaha.* key and project membership |
model not allowed | Add model to project plan allowlist |