What you need before opening VS Code
A qwen api key for VS Code is just an API key plus the right endpoint settings in an extension. Gather these three values first:
- Base URL:
https://api.uncensoredqwen.com/v1 - Model ID:
uncensored - API key: created on the API key page after you sign up with Google or with email and password
New accounts can claim $0.50 of trial credit with one click on that page. It needs no card, is limited to one per person and stays valid for 7 days. That is enough to test an editor setup for a few days of real coding.
A note on naming: the service is a hosted open-weight model run by an independent provider. It is not the official API of Alibaba, and it is not a router to other vendors. In your editor it appears under whatever display name you give it.
Test the key with curl first
Before changing any editor setting, confirm the key and URL work on their own. If this fails, no extension will succeed, and you will know the problem is the key rather than the plugin.
export API_KEY="paste-your-key-here"
curl https://api.uncensoredqwen.com/v1/models \
-H "Authorization: Bearer $API_KEY"
A JSON list that includes uncensored means authentication works. Then send one real completion:
curl https://api.uncensoredqwen.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"uncensored","messages":[{"role":"user","content":"Write a Python function that reverses a string."}],"max_tokens":200}'
The response headers include X-Balance-USD, which is a quick way to see remaining credit without leaving the terminal.
Add the provider in a VS Code extension
Several VS Code extensions for AI coding assistance can talk to any OpenAI-compatible server. The labels differ a little from tool to tool, but the fields map one to one. Look for a provider choice named like "OpenAI Compatible", "OpenAI" with a custom base URL, or "Custom endpoint".
| Extension field | Value to enter |
|---|---|
| Provider | OpenAI-compatible (or OpenAI with custom base URL) |
| Base URL / API base | https://api.uncensoredqwen.com/v1 |
| API key | The key from your account |
| Model ID | uncensored |
Extensions that read a JSON config file usually want something shaped like this. The exact key names vary, so check your extension's documentation and adapt the field names:
{
"models": [
{
"title": "Uncensored API",
"provider": "openai",
"model": "uncensored",
"apiBase": "https://api.uncensoredqwen.com/v1",
"apiKey": "paste-your-key-here"
}
]
}
Do not commit this file. If your settings live inside a repository, use the extension's secret storage or an environment variable instead, and add the config path to .gitignore.
After saving, open the extension's chat panel and send a short message such as "Explain this function" with a file open. A streamed answer means the setup is done.
Fix the common config mistakes
Most failed setups come down to a handful of typos. Work through this list in order.
The URL has the wrong shape
The base URL ends at /v1. Extensions add /chat/completions themselves. If you paste the full path, you get a 404 because the client requests /v1/chat/completions/chat/completions. A trailing slash is usually harmless, but a missing /v1 is not.
The model name is wrong
Some extensions pre-fill a model dropdown with names from another service. Overwrite it with uncensored exactly, in lower case. If the field is a dropdown with no custom entry, look for a "custom model" or "other" option.
The key has stray characters
Copying from a web page can add a trailing space or newline. Paste into a plain text editor, trim, and paste again. A 401 response nearly always points to this or to a key from a different account.
The extension still talks to its default server
If your balance does not change after chat requests, the editor may be using a built-in provider. Check that the active model profile is the one you edited, and reload the window after changing settings.
Requests fail with 429
That is a rate limit, covered in the next section. The error body carries a code that says which limit you hit.
Check that requests really reach the API
Editors rarely tell you which server answered. Two quick checks remove the doubt.
- Watch the balance. Run the
/v1/modelsor a short completion call from the terminal, note theX-Balance-USDheader, send three chat messages in the editor, then repeat the terminal call. The number should drop by a small amount. The same figure is available fromGET /v1/balance. - Ask for something the default setup would refuse or handle differently. A tiny, harmless test is to request a reply in exactly five words. If the answer follows the instruction and arrives streamed, the connection is healthy.
If the balance does not move, open the extension's output panel or developer console. Most extensions log the request URL and the HTTP status, and a wrong host shows up immediately. Fix the base URL, reload the window and try again.
Teams sharing a repository should give each person a separate key instead of one shared value. That way a rate limit hit by one person does not block the others, and a leaked key can be replaced without disturbing everyone else.
Autocomplete, chat and rate limits
Chat is gentle on limits: one request per message. Inline autocomplete is different. Many extensions send a request on a short pause in typing, which can produce dozens of calls per minute while you work.
Know the numbers. A full key allows 8 concurrent requests and 300 requests per minute. A trial key allows 2 concurrent and 60 per minute. When you exceed them, the API replies with HTTP 429 and the code rate_limited (too many per minute) or concurrency (too many at once). On temporary overload you also get 429 with a Retry-After: 5 header. A streamed completion keeps its concurrency slot until the stream ends, so slow streams count against you longer.
Practical settings that help:
- Use the service for chat, edits and explanations, and turn tab autocomplete off or raise its debounce delay while on a trial key.
- Lower the maximum output tokens for autocomplete to a few dozen. Short completions finish quickly and free the slot.
- Avoid running several editor windows against the same key during a trial.
Failed or refused requests are not charged, so errors cost nothing except time.
Cost of a coding session
Coding prompts are input-heavy because extensions attach file contents. Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens. Consider one chat turn that sends 6,000 tokens of code and context and gets 800 tokens back:
- Input: 6,000 x $0.15 / 1,000,000 = $0.0009
- Output: 800 x $0.50 / 1,000,000 = $0.0004
- Total: $0.0013 per turn
At 100 such turns in a working day that is $0.13. The $0.50 trial covers roughly 380 turns of this size ($0.50 / $0.0013 is about 385). Credit is prepaid, never expires, and top-ups are whole amounts from $20 to $500, with a bonus of 5% from $50, 10% from $100 and 15% from $200. See the pricing page for payment methods.
The context window is 100,000 tokens, prompt plus completion. If an extension indexes your whole repository into each prompt, large requests will cost more and approach that ceiling. Narrow the context to the files you actually need.
Privacy and where to read more
Prompts are not used for training. Still, source code often contains secrets, so keep .env files and credentials out of the files you attach to a chat. Most extensions let you exclude paths from the context.
The model is text only. It answers coding questions, drafts functions, explains errors and supports tool calling and JSON mode, but it does not generate images, audio or video. For request fields and examples beyond this page, read the API documentation. If something still fails after the checks above, the earlier article on common Qwen API mistakes lists more error patterns with fixes.
