kimik2api.comKimi K2 API Cursor Setup: Use a Custom Endpoint
Kimi K2 API Cursor Setup: Use a Custom Endpoint
Searching for a kimi k2 api cursor setup usually means you want Cursor to talk to a different model through a custom OpenAI-style endpoint. That works here with a base URL, a key and one model ID, and the steps are below.
Updated

Key points
- Cursor can send chat requests to any OpenAI-compatible base URL with your own key.
- Use base URL https://api.kimik2api.com/v1 and add the model name uncensored by hand.
- The model is not Kimi K2 itself, so judge its code quality on your own repository.
- Test the key with curl first; most setup failures are a typo in the URL or model name.
What you can and cannot do in Cursor
Cursor lets you bring your own key for OpenAI-style models and override the base URL it calls. That is the whole mechanism: you give it https://api.kimik2api.com/v1, a key from this site, and a model name. Chat and edit requests that you send to that model go to this API.
Be clear about what sits behind the endpoint. It serves one open-weight model, ID uncensored, run by an independent provider and tuned to answer without content refusals for lawful adult use. It is not Moonshot's hosted Kimi K2 and not a router over several vendors. If you want Cursor to behave like the official Kimi K2, this is not that. If you want a cheap, OpenAI-compatible model that does not refuse reasonable requests, it is.
Two practical limits apply to any custom-key setup in an editor. First, features that depend on the editor vendor's own models, such as inline tab completion, normally keep using those models. Second, the API here exposes POST /v1/chat/completions and GET /v1/models only, so anything that needs embeddings or images has to come from elsewhere. Cursor's menus and rules change between versions, so check Cursor's own documentation if a setting below has moved.
Step 1: get a key and check it with curl
Create an account on the API key page. Sign-up works with Google or with email and password. New accounts can claim $0.50 of trial credit with one click, valid for 7 days and with no card. The trial key allows 2 concurrent requests and 60 requests per minute, which is enough for setup but can feel tight in an agent session.
Before you touch the editor, confirm the key works from a terminal. This separates key problems from Cursor problems.
curl https://api.kimik2api.com/v1/models \
-H "Authorization: Bearer YOUR_KEY"
curl https://api.kimik2api.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"uncensored","messages":[{"role":"user","content":"Write a one-line Python hello world."}]}'
The first call should list the model. The second should return a normal chat completion. If either fails, fix that before continuing. A 401 means the key is wrong or has a stray space, and a 404 usually means the URL is missing /v1.
Step 2: configure Cursor
Open Cursor's settings and go to the models section. Names differ slightly by version, but the pieces are the same.
- Find the field for an OpenAI API key and paste your key from this site.
- Turn on the option to override the OpenAI base URL and enter
https://api.kimik2api.com/v1. Keep the/v1at the end and leave off any trailing path such as/chat/completions. - Use the add-model control and type
uncensoredexactly, lower case. - Run the verify button if there is one, or open a chat, pick
uncensoredin the model dropdown and send a short message.
If the model answers, you are done. If Cursor reports that the key or model is invalid, compare what you typed with the curl test above, character by character. The model ID is the usual culprit: Uncensored, uncensored with a trailing space and uncensored-1 all fail.
One key, one base URL
Cursor's override applies to the OpenAI key slot as a whole. If you also use a real OpenAI model in the same editor, switching the base URL affects that slot, and the two will collide. Many people keep the override on while working with this endpoint and switch it off when they want the other service. Check how your Cursor version handles this before you rely on both at once.
Writing prompts that suit this model
A general chat model that has been tuned to avoid refusals still needs good instructions to write good code. Some habits help in an editor.
- Select code before you ask. Give the model the function and its neighbours, not the whole repo. Input tokens cost $0.15 per 1M, so context is cheap, but a focused context gives a better answer than a flooded one.
- State the language, framework and version. "Python 3.12, FastAPI, Pydantic v2" removes a lot of guessing.
- Ask for a diff or a single function. Smaller outputs are easier to review and cost less, since output tokens run $0.50 per 1M.
- Ask for the plan first on big changes. A short list of steps, then one step at a time.
I cannot give you benchmark numbers for coding quality, because none are published for this endpoint. Run the model on three or four tasks from your own repository, such as a refactor, a test, a bug fix and an explanation, and decide from those. The trial credit is enough to do that many times over.
Where an uncensored model earns its place in an editor is the code that other assistants hesitate over even though it is lawful: security tooling for systems you own, scrapers, text-heavy game logic, or fiction and roleplay backends for adult apps. The one hard limit is no sexual content involving minors, and that never changes.
What a Cursor session costs
Editor chats resend context on every turn, so the input side dominates. Take a working session of 40 requests, each with 12,000 input tokens (selected code, the file, a few earlier messages) and 700 output tokens.
- Input: 40 x 12,000 = 480,000 tokens, which is 0.48 x $0.15 = $0.072
- Output: 40 x 700 = 28,000 tokens, which is 0.028 x $0.50 = $0.014
- Session total: $0.086
Eight such sessions in a work week come to about $0.69. Billing is prepaid with no subscription, a top-up runs from $20 to $500, and credit never expires, so a quiet week costs nothing. You can pay with crypto (USDT on TRC20, USDC on Base). Full rates are on the pricing page, and failed or refused requests are not charged.
When Cursor shows an error
Most problems fall into a few groups.
| Symptom | Likely cause | Fix |
|---|---|---|
| 401 or invalid key | Wrong key or stray whitespace | Paste again; retest with curl |
| 404 or model not found | Base URL without /v1, or wrong model name | Use the exact URL and uncensored |
429 with concurrency | More than 8 requests at once (2 on a trial key) | Wait for streams to end; avoid parallel agents |
429 with rate_limited | Over 300 requests per minute (60 on trial) | Slow down or batch work |
| 429 with a Retry-After header | Temporary overload | Retry after 5 seconds |
Remember that a streamed request holds its concurrency slot until the stream finishes. An editor that fires several background calls while a long answer is still streaming can reach the cap faster than you expect. The API docs list the headers worth logging, including X-Request-Id, which support will ask for if you write in.
For tool-heavy modes, the API supports tool calling with tools and tool_choice, and results go back as role: "tool" messages. Whether the model uses tools well enough for a given agent flow is something to test, not assume. JSON mode is available too, if a workflow of yours needs structured output.
Same setup outside Cursor
The base URL and model name work in anything that speaks the OpenAI chat format. This Python snippet is a good smoke test and a starting point for scripts that run next to your editor:
from openai import OpenAI
client = OpenAI(base_url="https://api.kimik2api.com/v1", api_key="YOUR_KEY")
resp = client.chat.completions.create(
model="uncensored",
messages=[
{"role": "system", "content": "You are a careful senior engineer."},
{"role": "user", "content": "Explain what this regex matches: ^\\d{3}-\\d{4}$"},
],
temperature=0.2,
)
print(resp.choices[0].message.content)
For the general Kimi-related questions people bring to this site, see the Kimi API overview.
More guides
Questions and answers
What base URL do I enter in Cursor?
Enter https://api.kimik2api.com/v1 in the OpenAI base URL override, with your key from this site in the OpenAI key field.
Which model name should I add?
Add uncensored, in lower case, as a custom model. The API serves one model, so it is the only valid ID.
Does Cursor's tab completion use this API?
Do not assume so. Editor features that depend on the vendor's own models usually keep using them. Check Cursor's documentation for your version.
Is this the real Kimi K2?
No. It is an independent provider's open-weight model, tuned to answer without content refusals for lawful adult use, offered through an OpenAI-compatible API.
Why do I get 429 errors in long sessions?
You hit the concurrency or per-minute limit. A full key allows 8 concurrent requests and 300 per minute; a trial key allows 2 and 60.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.