cursor-byok is an open-source desktop gateway that runs locally and is used to use your own configured model APIs in Cursor or to connect to models of existing services through account plugins. The project is maintained by bargino, based on the archived leookun/cursor-byok community branch. The core project uses the MIT License, and each account plugin retains the corresponding third-party license and attribution.
Purpose It converts model requests sent by Cursor into API requests to the configured service provider, and then passes streaming output and tool calls back to Cursor, thereby allowing users to use custom OpenAI / Anthropic compatible services in Cursor, or to connect to existing services through account plugins.
Main capabilities
- Custom model channels: configure API addresses, keys, model IDs, and parameters, and support OpenAI Responses, Chat Completions, and Anthropic Messages compatible interfaces. Each model configuration is an independent upstream channel, and the service provider, protocol, credentials, and generation parameters can be set separately.
- Account pool management: save multiple accounts by real identity, rotate available accounts, and query service provider credits; failover only occurs before the response starts outputting.
- Agent protocol adaptation: support tool calls, Skills, MCP, and multi-turn conversations. Specific capabilities depend on the model and Cursor version.
- Call and usage visibility: view request records, Token usage, cache statistics, connection tests, and estimated value.
- Image generation models (new in 1.0.5): after configuring an image generation service compatible with the OpenAI Images API, you can list models in Cursor Agent, generate images by name, and save them to the current workspace.
- Account plugins: 1.0.5 includes WorkBuddy, Qoder, Kiro, and TeleAgent plugins, and the existing Codex, Google Antigravity, and Grok plugins also use unified account storage.
- Cross-platform desktop application: provides Windows, macOS Intel / Apple Silicon, and Linux builds.
Usage
- Download and install the version suitable for your system, open the Cursor configuration, and initialize the local CA as prompted.
- Choose the model access method:
- API Key: select the service provider in the model settingsservice provider and, enter the service address, API and model ID, save and run the test. Account: open the plugin, first initialize the runtime, enable the corresponding plugin and add an account; after completing authorization, enable the required models in account management; adding repeatedly can form an account pool.
- Keep Cursor BYOK, fully exit and restart Cursor, and open a new conversation.
- Manually configure the model in Cursor. Auto uses Cursor's official models and will not use custom channels. Image generation model configuration: In Cursor → Add Model → select Image Generation for the model, enter the display name, upstream model ID, API Key, and a service compatible with the OpenAI Images API. The base address will automatically have /v1/generations appended; use it as is. You can verify the configuration via "Test Image Generation"; each test requests one image from the model, and the upstream service may charge per request. TAB completion settings: Cursor's Tab completion is handled by the TAB service and does not go through the model channel. In System Settings → TAB Settings, choose the public welfare service), direct connection to the official service, or a custom cursor-tab-server address. After changes, it is recommended to restart Cursor and open a new conversation.
Applicable scenarios
- Users who want to use their own API Key or third-party compatible service providers in Cursor.
- Users who need to manage multiple services and view credits, usage, and call records.
- Users who need to call image generation in Cursor Agent conversations.
- Users who want to use local model channels alongside Cursor's official services. Limitations and notes
- API Keys and account credentials are stored locally, but model requests are still sent to the selected service; this should not be taken to mean that code or prompts always stay local.
- Model permissions, quotas, and fees are subject to the service provider; account pools do not increase or multiply service provider quotas; the usage and estimated value shown in Cursor are not equal to the service provider's bill.
- Cursor BYOK is free and open source; model services may charge.
- This project is an independent community project and has no affiliation with or endorsement from Cursor or the listed service providers.
- The macOS package has not yet been notarized by Apple.
- Before switching from the original upstream, fully exit Cursor and Cursor BYOK, and back up the ~/.cursor-byok-v3/ data directory; this branch uses an independent update source and signature, and the first switch requires manual installation.
- Real account authorization, paid model calls, renewals, and actual balances still await verification with real accounts.
- Building from source requires the Rust toolchain and Cargo, Tauri 2 system build dependencies, and Docker when building the Docker image.