Point Cursor at a custom OpenAI-compatible endpoint — and verify it works before you wire it in.
Cursor lets you override the OpenAI base URL to use your own gateway (Claude, GPT, Gemini, DeepSeek… behind one key). The hard part isn't the setting — it's knowing whether the endpoint will actually work (auth, exact model ids, and SSE streaming, which Cursor needs). This repo ships a tiny zero-dependency verifier that checks all three, then a precise, honest setup guide.
git clone https://github.com/seven7763/cursor-custom-openai-api
cd cursor-custom-openai-api
export OPENAI_BASE_URL="https://daoxe.com/v1" # any OpenAI-compatible gateway
export OPENAI_API_KEY="your_key"
node verify-openai-endpoint.mjs # auto-picks a model from /models
# or, curl-only (no Node):
OPENAI_BASE_URL="$OPENAI_BASE_URL" OPENAI_API_KEY="$OPENAI_API_KEY" ./verify.sh "exact-model-id"You'll get a PASS/FAIL checklist:
PASS GET /models — 42 models visible (180 ms)
PASS POST /chat/completions — HTTP 200 (410 ms, tokens: 12)
PASS POST /chat/completions (stream) — SSE chunks received (150 ms), clean [DONE]
Ready for Cursor. Set Base URL = https://daoxe.com/v1, add your model, then Verify.
Then follow docs/SETUP.md to add it in Cursor.
"It works in curl but not in Cursor" is almost always one of:
- auth / base-URL shape (
/v1root vs full path), - wrong model id (ids are account-scoped — use
GET /v1/models), - no streaming — Cursor relies on SSE; a gateway that 200s on a normal
request but breaks on
stream: truewill silently fail in the editor.
The verifier checks all three and prints latency + token usage — without ever printing or storing your API key, the prompt, or the response text.
- Zero dependencies (built-in Node.js
fetch), auditable in one file. - Reads the key only from the environment; never logs it.
- Only reports: model id, HTTP status, latency, token counts, coarse errors.
Cursor · Cline · Roo Code · Continue · Windsurf · LobeChat · any OpenAI SDK.
Claude Code uses the Anthropic protocol (ANTHROPIC_BASE_URL) — see the guides below.
- seven7763/DaoXE-AI — per-client setup for ~50 tools (Cursor, Claude Code, Cline, Continue…), Postman collection, multi-language docs.
- seven7763/llm-gateway-benchmark — reproducible latency / availability / price leaderboard for gateways.
Examples default to DaoXE, an OpenAI-compatible, multi-model, multi-protocol gateway (Chat Completions, Responses, and Anthropic Messages) at https://daoxe.com/v1. Any OpenAI-compatible endpoint works — set OPENAI_BASE_URL to its /v1 root. Free credit on signup: {{FREE_CREDIT}} (to be confirmed).
Disclosure: this repo's author operates DaoXE. The verifier and guide are gateway-agnostic; nothing here is an official Cursor integration.
Thanks to the LINUX DO community for discussion and feedback on testing OpenAI-compatible gateways with coding tools.
MIT