EN ▾
Try with trial credit

GitHub Copilot: Use Your Own API Key

Can you make GitHub Copilot use your own API key? In some editors and for some features, yes, but the answer changes with plan and version. Where Copilot does not allow it, other editor tools do.

Last updated

Editor panel with a glowing cable being plugged into a different socket, symbolising a custom API endpoint

Summary

  • Copilot's own bring-your-own-key options are limited and change over time; check GitHub's current docs.
  • Open-source assistants such as Continue, Aider and Cline accept any OpenAI-compatible base URL.
  • For this endpoint use the base URL, your key and the model ID uncensored.
  • We are not affiliated with GitHub, Microsoft or any editor vendor.

The short answer

If your question is whether you can make github copilot use own api key for the main completions, treat that as something GitHub controls. Copilot is a service that GitHub runs, and inline suggestions go through it. In recent versions GitHub has added bring-your-own-key options for chat in some editors, covering named providers and, in some builds, custom OpenAI-compatible endpoints. Availability depends on your editor, version, plan and organisation policy, so read GitHub's current documentation before relying on any of it.

What always works is the other route: use a coding assistant that is built to take a custom base URL, and keep Copilot for what it does well. That is the part this guide covers with working configuration. We are an independent API and have no affiliation with GitHub or Microsoft.

It also helps to separate two jobs that people lump together under "Copilot". One is inline completion, the grey suggestion that appears as you type. The other is chat and edit, where you describe a change and get a diff back. A custom endpoint is a natural fit for the second job, since chat tools send a prompt and wait for a reply. Inline completion needs a very low delay and a fill-in-the-middle format that general chat endpoints do not provide.

What you need from this API

Any tool that supports an OpenAI-compatible provider needs three values.

SettingValue
Base URLhttps://api.githubcopilotapikey.com/v1
API keyfrom the API key page
Modeluncensored

Check that the key works before touching an editor:

curl https://api.githubcopilotapikey.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"uncensored","messages":[{"role":"user","content":"Reply with OK."}]}'

If you get JSON back, the endpoint is fine and any later failure is in the editor settings. New accounts can claim $0.50 of trial credit on the key page, valid 7 days.

Keep the key out of shared config files. Most editors store extension settings in a file that is easy to sync or commit by accident, so check where the key ends up before you add it. An environment variable referenced from the tool's config is safer where the tool supports it. You can also create a second key on the key page for editor use only, label it, and revoke it later without touching the rest of your setup (extra keys are available to accounts that have topped up).

Continue (VS Code and JetBrains)

Continue is an open-source extension that lets you define models in a config file. Add an entry with the openai provider and your base URL:

{
  "models": [
    {
      "title": "Uncensored",
      "provider": "openai",
      "model": "uncensored",
      "apiBase": "https://api.githubcopilotapikey.com/v1",
      "apiKey": "YOUR_KEY"
    }
  ]
}

Newer versions of the extension may use a YAML file with the same fields. The names above are the common ones; check the extension's docs if yours differs. Select the model in the chat panel and send a test message.

After saving, open the chat panel and ask something that is easy to verify, such as asking for a function that reverses a string and then reading what comes back. If the request fails, look at the extension's output log for the HTTP status; the table further down maps common statuses to fixes. Also confirm that you picked this model from the model dropdown, since the extension may still be using whichever default it had before.

Aider in the terminal

Aider reads standard OpenAI environment variables. Set them and prefix the model with openai/ so it uses the generic client:

export OPENAI_API_BASE=https://api.githubcopilotapikey.com/v1
export OPENAI_API_KEY=YOUR_KEY
aider --model openai/uncensored

Aider will warn that it does not know this model's context size or price. That is expected, because the model is not in its built-in list. You can ignore the warning or add a model settings file.

Aider works by sending your repository map and the files you add to the chat. Add only the files that matter to the task. That keeps each request small, makes the answers more focused, and holds down the token bill. The --no-auto-commits flag is useful while you evaluate any new model, so you can review each change before it enters history.

Cline and other editor agents

Cline and similar agent extensions have an "OpenAI Compatible" provider. Enter the same three values: base URL, key, model ID. Agents send long prompts with file contents and tool definitions, and this API supports tool calling, so they should work, but test on a small repository first and watch the balance. See the docs for request details and the pricing page for rates.

Keep concurrency in mind. A full key allows 8 concurrent requests and 300 per minute. An agent that fires many parallel calls may see HTTP 429 with concurrency. Lower its parallelism setting or retry after a few seconds.

Start with the lowest-risk mode. Many agent tools ask for approval before running commands or writing files; keep that on while you learn how this model behaves with your project. Prompts in these tools can reach tens of thousands of tokens once a few files are attached, so also set a limit on how many files go in per request. The window here is 100,000 tokens for prompt plus completion, and you want headroom for the reply.

Using the SDK in your own tools

If you wrote a script or an editor plugin, the OpenAI SDK needs only the base URL change:

from openai import OpenAI

client = OpenAI(base_url="https://api.githubcopilotapikey.com/v1", api_key="YOUR_KEY")
r = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Explain this regex: ^\\d{3}-\\d{4}$"}],
)
print(r.choices[0].message.content)

The endpoint also supports /v1/responses and GET /v1/models. Streaming, JSON mode and tool calls work as in the OpenAI API.

For tool-using scripts, pass tools and tool_choice as you would with the OpenAI API and return results as messages with role: "tool". Streamed tool calls arrive in the same chunk format, so the usual OpenAI helper libraries parse them.

Fixing common errors

SymptomLikely causeFix
401 or "invalid key"Key copied with a space, or an old key after regeneratingCopy again from the key page; the old key stops working at once after a reissue.
404 on the requestBase URL missing /v1, or a doubled /v1/v1Use exactly https://api.githubcopilotapikey.com/v1.
Model not foundModel name typed differentlyUse uncensored, lowercase.
429 with concurrencyAgent sends too many parallel callsLower parallelism or retry after a few seconds.
429 with rate_limitedMore than 300 requests a minute on a full key, 60 on trialSlow the tool down or top up to get a full key.

The response headers help. X-Request-Id identifies a request if you contact support, and X-RateLimit-Limit-Requests shows your limit.

Watching your balance

Because billing is per token, check the balance as you try new tools. Agents can send large prompts quickly. Two ways to see it:

curl https://api.githubcopilotapikey.com/v1/balance \
  -H "Authorization: Bearer YOUR_KEY"

Every response also carries an X-Balance-USD header. As a rough guide at $0.15 and $0.50 per 1M tokens, a chat edit with 12,000 input and 1,500 output tokens costs $0.00255, so a hundred of them cost about 25 cents.

Honest limits

This is a general chat model tuned to avoid content refusals for lawful adult use. We do not claim it beats a dedicated code model, so run it on your own code and judge the output. It does not provide inline ghost-text completion by itself; that depends on the editor tool you pair it with. It is text only, with a 100,000-token window. Prompts are not used for training. Our Claude API key myths vs facts article covers how keys from different vendors differ.

Frequently asked questions

Is this an official GitHub Copilot key?

No. We are independent and not affiliated with GitHub, Microsoft or any editor vendor. The key works with tools that accept an OpenAI-compatible endpoint.

Which tools accept a custom base URL?

Continue, Aider and Cline are examples. Any tool with an OpenAI-compatible provider option should work.

What model name should I enter?

Use uncensored.

Can I try it without paying?

New users can claim $0.50 of trial credit on the API key page, valid for 7 days and with no card.

Get your key in one step

Sign up, copy the key, update your base URL. That’s it.

Start with trial balance

Provide email and password. Key displayed immediately.