Yaha AI Gateway
Integrations

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/cursor endpoint 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

  1. Open Cursor Settings (gear icon or Cmd/Ctrl + ,)

  2. Go to Models → expand API Keys

  3. Toggle on OpenAI API Key and paste your Yaha project key (yaha.*)

  4. Toggle on Override OpenAI Base URL and set:

    https://gateway.yahagateway.io/v1/cursor
  5. 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 URLBehavior
https://gateway.yahagateway.io/v1/cursorRecommended. Forces Cursor client profile; handles Responses payloads, tool-call bridging, and prompt compression.
https://gateway.yahagateway.io/v1Legacy. 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

FeatureBehavior
Path rewritePOST /v1/cursor/chat/completions → upstream /v1/responses
Streaming bridgeResponses SSE → chat.completion.chunk
Tool callsApplyPatch and function calls bridged to OpenAI format
Prompt compressionPreserves <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

SymptomFix
Tool call failuresUse /v1/cursor base URL, not /v1 alone
403 forbiddenCheck yaha.* key and project membership
model not allowedAdd model to project plan allowlist

See also

On this page