Get API key

VS Code LLM API: Connect Your Editor to Your Own Key

You can point VS Code at any OpenAI-compatible endpoint by giving an extension three values: a base URL, an API key and a model ID. This page shows where those values go and how to test them first.

Updated

Abstract code editor connected by a cable to a glowing server cube, representing a VS Code LLM API connection

Key points

  • Test the key with curl before you touch the editor, so you know which side is broken.
  • Extensions such as Continue and Cline ask for the same three values: base URL, key, model ID.
  • Use model ID uncensored and the base URL https://api.codingllmapi.com/v1.
  • The API serves chat completions only, so features that need a separate completion endpoint may not work.

What you need before you start

A VS Code LLM API setup has no magic in it. VS Code itself does not talk to language models. An extension does, and that extension needs to know where to send requests and how to identify you. Any extension that supports a custom OpenAI-compatible provider can use this service.

Collect these three values first.

  • Base URL: https://api.codingllmapi.com/v1
  • Model ID: uncensored
  • API key: created on the API key page. After sign-up you can claim $0.50 of trial credit with one click, valid for 7 days and with no card needed.

The key goes into the request as Authorization: Bearer <key>. Extensions add that header for you once you paste the key into their settings.

Step 1: test the key outside the editor

Debugging inside an extension is slower than debugging in a terminal. Open the terminal in VS Code (Ctrl+` on Windows and Linux, Cmd+` on macOS), store the key in an environment variable and run two calls. The first lists models. The second sends a tiny chat request.

export LLM_API_KEY="paste-your-key-here"

curl -s https://api.codingllmapi.com/v1/models \
  -H "Authorization: Bearer $LLM_API_KEY"

curl -s https://api.codingllmapi.com/v1/chat/completions \
  -H "Authorization: Bearer $LLM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"uncensored","messages":[{"role":"user","content":"Reply with the word ready."}],"max_tokens":10}'

If the second call returns JSON with a message, the key, the URL and the model ID are all correct. Whatever goes wrong later is an extension setting, not your account. If you get an authentication error here, check that you copied the whole key and that no stray quote or space came along.

Step 2: configure an extension

Extension settings change between versions, so treat the field names below as a guide and check the extension's own documentation if a label differs. The three values are always the same.

Continue

Continue is an open-source assistant for VS Code and JetBrains. It reads a config file from your home directory. Newer versions use a YAML file, and older ones use config.json. The model entry carries the same fields in both. In the JSON format it looks like this:

{
  "models": [
    {
      "title": "Uncensored",
      "provider": "openai",
      "model": "uncensored",
      "apiBase": "https://api.codingllmapi.com/v1",
      "apiKey": "paste-your-key-here"
    }
  ]
}

The provider is openai because the wire format is OpenAI's. Only apiBase tells Continue to talk to a different server. Reload the window after saving and pick the model from the dropdown in the chat panel.

Cline

Cline is an agent extension that can read files, edit them and run terminal commands with your approval. Open its settings and choose the provider named OpenAI Compatible. Fill in the Base URL, the API Key and the Model ID. Paste https://api.codingllmapi.com/v1, your key and uncensored. Save, start a task and approve its first tool use.

Other extensions

Many tools follow the same pattern under names like "custom endpoint", "OpenAI-compatible" or "bring your own key". Look for a field that accepts a base URL. If an extension only offers a fixed list of vendors with no URL field, it cannot be pointed at this API.

What works and what may not

This API implements POST /v1/chat/completions and GET /v1/models. That covers chat panels, edit commands, explain-this-code actions and agent loops. It does not cover everything an editor might ask for.

Editor featureExpected result
Chat about the open fileWorks
Select code and ask for an editWorks
Agent tasks with tool callsWorks if the extension uses the standard tools field or its own prompt format
Inline tab completionDepends on the extension. If it needs a separate completion or fill-in-the-middle endpoint, this API does not provide one
Codebase embeddings and indexingNot available here, since there is no embeddings endpoint. Use a different embeddings source or turn indexing off
Image input or generationNot available, the API is text only

If an extension fails on a feature in this table, switch that one feature off in its settings instead of assuming your key is wrong. For an overview of what this model is like for programming work, see the page on an uncensored model for coding agents.

Beyond extensions: scripts you run from the editor

An extension is not the only way to use a key from VS Code. Many developers keep a small script in the project that sends a file to the model and prints the answer, then run it from the integrated terminal or bind it to a task. This gives you full control over the prompt and avoids surprises from an extension's hidden instructions.

Here is a short Python script that reviews whatever file path you pass in. It reads the key from an environment variable, so nothing secret lands in your repository.

import os
import sys
from openai import OpenAI

client = OpenAI(
    base_url="https://api.codingllmapi.com/v1",
    api_key=os.environ["LLM_API_KEY"],
)

path = sys.argv[1]
with open(path, encoding="utf-8") as f:
    source = f.read()

resp = client.chat.completions.create(
    model="uncensored",
    messages=[
        {"role": "system", "content": "Review the code. List bugs first, then style issues. Be brief."},
        {"role": "user", "content": source},
    ],
    temperature=0.2,
)
print(resp.choices[0].message.content)

Run it with python review.py src/app.py. Large files are fine up to the 100,000-token window, but a smaller prompt answers faster and costs less. If you want the answer to appear as it is written, pass stream=True and print each chunk's delta.content as it arrives.

The same idea works as a VS Code task in .vscode/tasks.json: define a task whose command is this script with the current file as an argument, and trigger it from the command palette. It is a small amount of setup, and the result is a review command you fully understand.

Fixing common errors

Most problems fall into a handful of causes. Work from the top of this list.

  1. 401 or "invalid API key". The key was pasted with a trailing space, or you used a key meant for a different site. Create a new one and paste it again.
  2. 404 or "model not found". The model ID is misspelled, or the base URL is missing /v1 or has it twice. The correct ID is uncensored. Run the /v1/models call to see what the server reports.
  3. 429 with rate_limited. You exceeded the requests-per-minute limit: 300 on a full key, 60 on a trial key. Agents that loop quickly hit this. Wait and retry, or lower the number of automatic steps.
  4. 429 with concurrency. Too many requests at once: 8 on a full key, 2 on a trial key. Some extensions fire several calls in parallel for one task. A streamed reply holds its slot until it ends, so a stuck stream can block new calls.
  5. 429 with a Retry-After: 5 header. Temporary overload. The extension should retry after five seconds. If it does not, retry by hand.
  6. The request is rejected as too large. The body limit is 8 MB, and the context window is 100,000 tokens for prompt plus answer. Agents that attach many files can exceed this. Narrow the context or clear the conversation.

When asking support for help, include the value of the X-Request-Id response header. You can see it with curl -i.

Keeping the cost visible

Editor agents send a lot of text, because each step usually carries the files and history so far. Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens, which keeps single requests small in cost, but loops add up.

A worked example: an agent step with 30,000 input tokens and 1,000 output tokens costs 30,000 x $0.15 / 1,000,000 = $0.0045 for input and 1,000 x $0.50 / 1,000,000 = $0.0005 for output, so $0.005 per step. A task of 40 such steps costs $0.20. That is a rough shape, not a promise, since real steps vary in size.

  • Check X-Balance-USD in the response headers to see your credit after a call.
  • Start new tasks in new conversations so old history does not ride along forever.
  • Set the extension's step or request limit if it has one.

Credit is prepaid, so spending stops when the balance is gone, and it never expires. Top-ups run from $20 to $500 in whole amounts, with a bonus of 5% from $50, 10% from $100 and 15% from $200. Cards (Visa, Mastercard, Apple Pay, Google Pay) and crypto (USDT on TRC20, USDC on Base) are accepted. Details are on the pricing page, and the docs list every supported parameter.

A note on privacy and use

Code you send goes to the provider's servers, so do not paste secrets such as production keys, passwords or customer data into prompts. Prompts on this service are not used for training. The model is tuned to answer without content refusals for lawful adult use, which means it will not stop to lecture you about a security test or a dark-themed game script, but you remain responsible for what you ask it to do. Sexual content involving minors is never allowed.

Questions and answers

Can I use this API with GitHub Copilot in VS Code?

Copilot is tied to its own service, so this key does not replace it. Use an extension that accepts a custom endpoint, such as Continue or Cline.

Which model ID do I enter?

Enter uncensored. You can confirm it by calling GET /v1/models with your key.

Why does the editor say the connection failed?

Run the curl test first. If curl works, recheck the base URL in the extension, including the /v1 at the end and the absence of extra spaces.

Does inline autocomplete work?

Only if the extension can use plain chat completions for it. This API has no separate completion endpoint, so check the extension's autocomplete settings.

Is there a free way to test it?

New users can claim $0.50 of trial credit on the API key page after sign-up. It needs no card, lasts 7 days and is limited to one per person.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key