Forums
Cursor BYOK: custom model APIs in Cursor, with multi-account management
I'm continuing maintenance of a community fork of Cursor BYOK, originally created by leookun. It's an open-source desktop gateway for using configured model APIs from Cursor while managing connections, accounts, and usage in one local app.
It supports OpenAI Responses, Chat Completions, and Anthropic Messages-compatible services. Model requests still go to the chosen provider, and provider access rules and billing still apply.
A recent fix may be useful to others building account pools: concurrent logins and refreshes could each read an old account list and overwrite another operation's changes. The fix covers the entire read/merge/write operation with one persistence lock, serializes credential operations per account, and rejects patches based on stale credentials after a newer login. Account retries stop once upstream events have started, avoiding a restart in the middle of an answer or tool call.
The 1.0.4 build adds WorkBuddy, Qoder China/Global, TeleAgent (China Telecom), and Kiro adapters with account pools and credit/quota interfaces. Automated tests, endpoint checks, and Windows/macOS/Linux builds passed; real-account authorization, paid calls, renewal, and actual balance queries still need live validation.