Using Claude Code with GitHub Copilot Subscription



This content originally appeared on DEV Community and was authored by Allen Tuh

Do you have a Github Copilot subscription sitting around doing nothing? Why not pair it with the Claude Code (claimed by many developers as the best AI coding agent thus far).

A. Using LiteLLM

  1. Install Python on your local machine
  2. Setup LiteLLM
  3. Create a folder for LiteLLM e.g.: litellm
  4. Create a config.yaml file with the below content in the litellm folder
model_list:
  - model_name: anthropic/*
    litellm_params:
      model: github_copilot/gpt-5-mini
      extra_headers: {"editor-version": "vscode/1.85.1", "Copilot-Integration-Id": "vscode-chat"}
  - model_name: anthropic/*
    litellm_params:
      model: github_copilot/claude-sonnet-4.5
      extra_headers: {"editor-version": "vscode/1.85.1", "Copilot-Integration-Id": "vscode-chat"}
  1. Start the litellm proxy server
litellm --config config.yaml

B. Using Copilot API

  1. First you need to setup GitHub Copilot API proxy
  2. Run npm install -g copilot-api to install the API proxy
  3. Run copilot-api start to start the proxy server

Setup Claude Code

  1. Now install Claude Code in your local machine
  2. Run npm install -g @anthropic-ai/claude-code
  3. Edit the config file .claude/settings.json for Claude Code to use the LiteLLM or Copilot API proxy server instead of the default Claude subscription which is more expensive
  4. Add this settings into the config file

LiteLLM

{
  "env": {
    "ANTHROPIC_BASE_URL": "http://0.0.0.0:4000",
    "ANTHROPIC_AUTH_TOKEN": "sk-litellm-static-key",
    "ANTHROPIC_MODEL": "github_copilot/claude-sonnet-4.5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "github_copilot/gpt-5-mini",
    "DISABLE_NON_ESSENTIAL_MODEL_CALLS": "1",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}

Copilot API

{
  "env": {
    "ANTHROPIC_BASE_URL": "http://localhost:4141",
    "ANTHROPIC_AUTH_TOKEN": "sk-dummy",
    "ANTHROPIC_MODEL": "claude-sonnet-4.5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-5-mini",
    "DISABLE_NON_ESSENTIAL_MODEL_CALLS": "1",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}

Start your Claude Code and enjoy coding!


This content originally appeared on DEV Community and was authored by Allen Tuh