Set up Cursor and other OpenAI-compatible tools
Updated 2026-10-18 · Three settings: base URL, API key and model name, with steps for Cursor.
Connection details
- Base URL (OpenAI compatible)
- https://api.aifans.fan/v1
- API key
- Create one in the console; it starts with sk- (no account yet? sign up)
- Recommended models
- deepseek-v4.1-flash, deepseek-v4-pro (all models and prices)
Any tool that accepts a custom OpenAI-compatible provider works with AIFans API. You need three things: the base URL, an API key and a model name.
- Base URL
- https://api.aifans.fan/v1
- API key
- Create one in the console; it starts with sk-
- Model
- For example deepseek-v4.1-flash; the full list is on Models and prices
Cursor
- Open Settings → Models and paste your key into the OpenAI API Key field.
- Turn on “Override OpenAI Base URL” and enter https://api.aifans.fan/v1.
- Add a custom model with the model name (e.g. deepseek-v4.1-flash) and enable it.
Menu names change between Cursor versions; follow what you see.
Other tools and SDKs
Cline, Continue, OpenCode, Dify, LangChain and more have their own step-by-step pages under Guides. Anything else works the same way: point the base URL at https://api.aifans.fan/v1 and use your key and a model name.
curl https://api.aifans.fan/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "deepseek-v4.1-flash", "messages": [{"role": "user", "content": "Hello"}], "max_tokens": 1000}'
Tips
- Use a separate key per tool and per machine, with a spending limit, so you can disable just the one that misbehaves.
- If a tool runs on a server with a fixed IP, add an IP allow-list to its key.
- Use a max_tokens of 1000 or more; the API reference explains why.