[FEATURE] Add support for Github Copilot SDK

Status Open
Maintainer reply None cached
Activity 3 comments · opened Jan 25, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Requirement: A lot of users (including enterprise users) have existing subscription to Github Copilot which gives them access to various AI models including claude. Adding support for Copilot within Claude code would let users use their existing subscriptions within the tool.

Proposed Solution

Integrate the newly launched Copilot SDK to Claude code : copilot-sdk

Alternative Solutions

_No response_

Priority

High - Significant impact on productivity

Feature Category

API and model interactions

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

3 Comments

HeegonJin · 8 months ago

bump

johnib · 3 months ago

@pranjalsinha99 @HeegonJin you don't need to wait on first-party SDK support for this - there's a way today that does exactly what you're after: use your Copilot sub (incl. its Claude models) inside Claude Code, no separate Anthropic key.

I maintain a fork that's a local proxy exposing Copilot as a native Anthropic endpoint. point Claude Code at it:

npx copilot-api-node20@latest start

then set ANTHROPIC_BASE_URL=http://localhost:4141 (+ any non-empty ANTHROPIC_API_KEY) and run claude as usual. requests get forwarded straight to Copilot's native /v1/messages, so thinking, tool use and usage reporting all come through afaict.

full disclosure it's my own fork, not anything official - been running it ~9 months for a few folks on my team. you're welcome to give it a try: https://www.npmjs.com/package/copilot-api-node20

csj0oe · 14 days ago

You can already do this without a proxy: Copilot exposes an Anthropic-compatible /v1/messages endpoint, and Claude Code can talk to it directly. I've switched from copilot-api to this setup (Copilot Enterprise, Claude Code 2.1.285).

Setup

  1. Log in with the GitHub CLI (gh auth login) using an account that has a Copilot seat. Copilot's API accepts the gh token directly as a Bearer token.
  2. ~/.claude/settings.json:
{
  "apiKeyHelper": "gh auth token",
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.enterprise.githubcopilot.com",
    "CLAUDE_CODE_ATTRIBUTION_HEADER": "0",
    "ENABLE_TOOL_SEARCH": "true"
  }
}
  • ANTHROPIC_BASE_URL: this is the Copilot Enterprise host. For other plans the host is probably https://api.githubcopilot.com, but I haven't tested that.
  • CLAUDE_CODE_ATTRIBUTION_HEADER=0: needed for prompt caching. Without it, cache_read stays at 0 and every turn is billed as fresh input.
  • ENABLE_TOOL_SEARCH=true: optional. It's off by default with a custom base URL, but works on Copilot and cut my cached prompt prefix from about 38k to 27k tokens.

WebSearch

Copilot rejects Anthropic's server-side web search tool.

Workaround: a PreToolUse hook on WebSearch that runs the query through Copilot's /responses endpoint with its web_search tool on a GPT model (that endpoint only accepts OpenAI models; the same gh token works there), then returns the answer and sources to Claude as the hook's deny reason. Claude uses it as the search result.

WebFetch works as-is, because Claude Code fetches pages client-side.