Copilot API (GitHub + Microsoft 365): API Key, Access, SDK, AI Credits Pricing, Alternatives | Morph

GitHub Copilot API vs Microsoft 365 Copilot API: SDK, Access, Pricing, and Alternatives (2026)

There is no GitHub Copilot API for code completions or edits. GitHub ships the Copilot SDK (GA June 2026) and REST admin endpoints. Microsoft 365 Copilot APIs live in Microsoft Graph. The top GitHub result is an unofficial proxy. Plans, AI credits, and alternatives.

April 4, 2026 · 1 min read
GitHub Copilot API vs Microsoft 365 Copilot API: SDK, Access, Pricing, and Alternatives (2026)

Copilot API: The Short Answer

Last updated November 6, 2026.

"Copilot API" names three different things. GitHub has no public endpoint that returns Copilot completions or code edits. It ships the GitHub Copilot SDK, generally available since June 2, 2026, which embeds the Copilot agent runtime in your own app in six languages. GitHub's REST API handles Copilot administration, and since October 19, 2026 that includes model policies. Microsoft 365 Copilot APIs are a separate family in Microsoft Graph, and each user needs a Microsoft 365 Copilot license. The top-ranked "copilot-api" repo on GitHub is an unofficial, reverse-engineered proxy that GitHub does not support. To build your own coding agent, call model and tool APIs directly.

Which Copilot API Do You Need? (October 2026)
GitHub Copilot SDKGitHub REST API (Copilot)Microsoft 365 Copilot APIs
What it doesEmbeds the Copilot agent runtime in your appSeat, usage metrics, and model policy managementGives custom apps Microsoft 365 Copilot features
StatusGenerally available since June 2, 2026Model policy API GA October 19, 2026Mix of available and preview APIs
Where it lives@github/copilot-sdk on npm, plus 5 other languagesapi.github.comgraph.microsoft.com/v1.0/copilot and /beta/copilot
LicenseCopilot subscription, or BYOKCopilot seats on the managed org or enterpriseMicrosoft 365 Copilot license per user
Returns code completionsNo, it runs agent sessionsNoNo

Does Copilot Have a Public API?

Partially. GitHub Copilot exposes REST API endpoints through the GitHub API, but they cover administration, not code intelligence. You can manage Copilot seats, query usage metrics, and configure content exclusions. You cannot call Copilot's completion engine, edit model, or agent loop from your own code.

The REST endpoints live under /orgs/{org}/copilot in the GitHub API. They let organization admins list seat assignments, view usage data, and manage billing. These are management APIs, not coding APIs.

On October 19, 2026 GitHub made the Copilot model policy API generally available. Its GET and PATCH endpoints read and set which models are enabled at the enterprise, enterprise team, organization, and agent app levels.

What the REST API Covers

Copilot's REST API handles three things: seat management (assign/remove Copilot licenses), usage metrics (completion counts, acceptance rates, active users), and content exclusion (block Copilot from suggesting code matching certain patterns). For code completions and edits, Copilot only works through supported IDEs and the CLI.

This is where most people hit a wall. They search "Copilot API" expecting an endpoint that takes code and returns completions. That endpoint does not exist in GitHub's official API. The completions engine is only accessible through Copilot's IDE integrations (VS Code, JetBrains, Neovim) and the Copilot CLI.

Copilot API Key: Which Token Each Copilot API Takes

GitHub does not issue a Copilot API key. Each Copilot surface authenticates with a credential tied to a GitHub account or a Microsoft 365 tenant. People who search for a GitHub Copilot API key usually need one of the four below.

Copilot API Key by Surface (November 2026)
SurfaceCredential it takesRequirement
GitHub REST API (Copilot endpoints)Personal access token (classic) or OAuth app token with the manage_billing:copilot or read:org scopeOrganization owner for seat and billing data
GitHub Copilot SDKSigned-in copilot CLI user, a GitHub OAuth app user token, or COPILOT_GITHUB_TOKEN / GH_TOKEN / GITHUB_TOKENCopilot subscription on that GitHub account
Copilot SDK with BYOKYour own API key from a model provider such as OpenAI, Anthropic, or Microsoft FoundryNo GitHub authentication
Microsoft 365 Copilot APIsMicrosoft Entra ID access token for the signed-in user, acquired with MSALEntra app registration and a Microsoft 365 Copilot license per user

A token with the right scope still returns 403 on GET /orgs/{org}/copilot/billing unless its owner is an organization owner. GitHub marks the seat management endpoints as public preview, so pin the X-GitHub-Api-Version header.

SDK BYOK is key-based only. GitHub's SDK FAQ says Entra ID and managed identities are not supported for BYOK. The unofficial copilot-api proxy signs in with your GitHub account and forwards to Copilot's backend, which is why its README warns about abuse detection.

If you want a key that returns code edits, you want a model API. One Morph API key from the dashboard calls Fast Apply and WarpGrep on an OpenAI-compatible endpoint.

Microsoft 365 Copilot APIs vs the GitHub Copilot API

Five of the top ten Google results for "copilot api" are Microsoft Learn pages (Ahrefs SERP, October 2026). They document Microsoft 365 Copilot APIs, a different product from GitHub Copilot. These APIs sit in Microsoft Graph under graph.microsoft.com/v1.0/copilot and graph.microsoft.com/beta/copilot.

The family includes the Retrieval API, Interaction Export API, Meeting Insights API, usage reports, and package management. The Search API, Chat API, and two change-notification APIs are still in preview. Every user who reaches Copilot functionality through them needs a Microsoft 365 Copilot license. None of them return code completions or edits, so they are the wrong API for a coding tool.

The unofficial copilot-api proxy

The #1 Google result for "copilot api" is github.com/ericc-ch/copilot-api, an MIT-licensed project with about 4,100 stars. It reverse-engineers the Copilot backend and exposes OpenAI-compatible and Anthropic-compatible endpoints such as /v1/chat/completions and /v1/messages. Its README says GitHub does not support it and it may break. It also warns that automated or excessive use can trigger GitHub's abuse detection. Do not build a product on it.

Copilot Extensions: Replaced by MCP

GitHub App-based Copilot Extensions are retired. GitHub blocked new server-side extensions on September 24, 2025 and shut down existing GitHub App extensions on November 10, 2025. MCP servers took their place. Client-side Copilot extensions built on the VS Code extension API were not affected.

For a new integration, build an MCP server. GitHub's deprecation notice names MCP as the replacement, and the Copilot SDK accepts MCP servers as tools.

If you built a GitHub App extension

It stopped working on November 10, 2025. Port its tools to an MCP server.

The GitHub Copilot SDK (GA June 2026)

GitHub made the Copilot SDK generally available on June 2, 2026. It exposes the agent runtime behind Copilot CLI to your own code. Your app talks to a Copilot CLI server over JSON-RPC. The Node.js, Python, and .NET SDKs bundle the CLI runtime.

GitHub Copilot SDK at GA
GitHub Copilot SDK
LanguagesNode.js/TypeScript, Python, Go, .NET, Rust, Java
TransportJSON-RPC to a Copilot CLI server
ToolsCustom tools via defineTool, plus MCP servers
AuthCopilot subscription, or BYOK keys for providers such as OpenAI, Microsoft Foundry, or Anthropic
ObservabilityOpenTelemetry tracing
Other GA featuresSystem prompt customization, hooks, remote sessions

The SDK runs agent sessions through the Copilot runtime. It is not a raw completions endpoint. You get the loop and supply the tools.

The APIs You Actually Need to Build Copilot-Like Tools

Strip away Copilot's UI and agent orchestration, and every AI coding tool runs on three primitives: code editing, code search, and code execution. These are the operations that matter when you are building your own tools.

1. Fast Apply (Code Editing)

An LLM generates a plan for how code should change. A fast-apply model merges those changes into the original file. This operation needs to be fast (sub-second for most files) and accurate (preserve formatting, indentation, surrounding code). Copilot uses a proprietary model for this. The Copilot SDK handles it internally. Neither is available as a standalone API.

2. Code Search (Codebase Navigation)

Before editing code, an agent needs to find the right files. Cognition (behind Devin) measured that 60% of their agent's time went to searching for code. Copilot indexes your codebase locally in VS Code. The Copilot SDK does not include a search primitive. If you are building a server-side tool or CI pipeline, you need an API for this.

3. Sandboxed Execution

Running generated code requires isolation: the agent writes code, runs it, reads output, iterates. Copilot runs code in your local terminal. For production pipelines, code review bots, and CI/CD agents, you need sandboxed environments with resource limits and network controls.

The Copilot SDK provides the orchestration layer (tool calling, multi-turn sessions) but not specialized implementations of these three primitives. You still need to bring your own code editing model, search system, and execution environment.

Morph API Stack

Morph provides the editing and search primitives as standalone, pay-per-use APIs. Execution stays in the sandbox you already run; WarpGrep executes inside it. No subscription required.

10,500
Tokens/sec (Fast Apply)
<6s
Full codebase search (WarpGrep)
$0.80
Per million input tokens (Fast Apply)

Fast Apply API

OpenAI-compatible endpoint. Send original code and the desired changes, get back the merged file. The morph-v3-fast model is purpose-built for edit merging: insertions, deletions, partial rewrites, multi-region edits within a single file. At 10,500 tokens/second, it handles real-time editing UIs and batch processing alike.

WarpGrep

Agentic code search that runs 8 parallel tool calls per turn across 4 turns, completing full codebase searches in under 6 seconds. Instead of simple string matching, WarpGrep executes multi-turn search strategies: reading directory structures, grepping for patterns, reading file contents, and narrowing results. Available as an MCP server or direct API.

Execution: your sandbox

Morph does not run sandboxes. Generated code executes wherever you already run it: E2B, Modal, Daytona, Docker, or a box over SSH. WarpGrep plugs into that environment through sandbox execution, so search runs against the same filesystem the agent edits and tests.

Code Examples

Morph's APIs use the OpenAI SDK format. If you have used the OpenAI or Anthropic API, the integration pattern is identical.

Fast Apply: Merge Code Edits

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.morphllm.com/v1",
  apiKey: process.env.MORPH_API_KEY,
});

const response = await client.chat.completions.create({
  model: "morph-v3-fast",
  messages: [
    {
      role: "user",
      content: `<code>
${originalCode}
</code>
<update>
${llmGeneratedChanges}
</update>`,
    },
  ],
});

const updatedCode = response.choices[0].message.content;

WarpGrep: MCP Server Configuration

{
  "mcpServers": {
    "warpgrep": {
      "command": "npx",
      "args": ["-y", "@morphllm/morphmcp"],
      "env": {
        "MORPH_API_KEY": "your-api-key"
      }
    }
  }
}

GitHub Copilot SDK (for comparison): Agent Session in TypeScript

import { CopilotClient, approveAll } from "@github/copilot-sdk";

// The SDK runs the Copilot agent loop; you supply tools and permissions
const client = new CopilotClient();
await client.start();

const session = await client.createSession({
  model: "gpt-5",
  onPermissionRequest: approveAll,
});

session.on("assistant.message", (event) => {
  console.log(event.data.content);
});

const done = new Promise<void>((resolve) => session.on("session.idle", () => resolve()));
await session.send({ prompt: "Review the auth middleware" });
await done;

await session.disconnect();
await client.stop();

The key difference: the Copilot SDK gives you an orchestration framework where you supply tool implementations. Morph gives you the tool implementations themselves. Many teams use both, plugging Morph's Fast Apply and WarpGrep into a Copilot SDK agent as custom tools.

Pricing Comparison

Copilot charges per seat with tiered plans. Morph charges per API call. The economics depend on what you are building.

Pricing Comparison (October 2026)
GitHub CopilotMorph API
Pricing modelPer seat/month + AI Credits usagePay per use
Free tierCopilot Free: 2,000 completions/mo + AI credit allowanceFree tier + usage-based
Individual plan$10/mo Pro (1,500 credits), $39/mo Pro+ (7,000), $100/mo Max (20,000)No subscription, API costs only
Team plan$19/user/mo Business (1,900 credits)No seat fees
Enterprise plan$39/user/mo Enterprise (3,900 credits)Volume discounts available
Code editing (Fast Apply)Bundled (IDE only)$0.80/M input + $1.20/M output
Code searchBundled (local index)WarpGrep: $0.80 per 100K tokens
Usage billing unit1 AI Credit = $0.01 on token usagePer token, no credit layer
API access to editsNo standalone endpointYes, OpenAI-compatible
CI/CD integrationCopilot Coding Agent (PR-based)Any environment via API

For individual developers who want an IDE assistant, Copilot's $10/month Pro plan is the simplest option. For teams building custom tools, running agents in CI, or needing programmatic access to code editing, Morph's per-use pricing avoids the seat cost scaling. Ten Copilot seats cost $190/month on Business or $390/month on Enterprise before any credit overage, and that buys you an IDE assistant, not an endpoint. Morph bills the edits themselves at $0.80 per million input tokens and $1.20 per million output, with no seat count in the equation.

Frequently Asked Questions

Is there a GitHub Copilot API key?

No. GitHub does not issue a Copilot API key. The Copilot REST endpoints take a GitHub personal access token (classic) or OAuth app token with the manage_billing:copilot or read:org scope. The Copilot SDK uses a signed-in Copilot CLI user, a GitHub OAuth app token, or COPILOT_GITHUB_TOKEN, GH_TOKEN, or GITHUB_TOKEN. With BYOK it takes your model provider's API key instead.

Does GitHub Copilot have a public API?

Not for completions or edits. GitHub's REST API covers Copilot administration, such as seat assignment and usage metrics. The model policy API joined it on October 19, 2026. To embed Copilot's agent in your own app, use the GitHub Copilot SDK.

What is the GitHub Copilot SDK?

A library that embeds the Copilot agent runtime in your application. It became generally available on June 2, 2026, with SDKs for Node.js/TypeScript, Python, Go, .NET, Rust, and Java. It talks to a Copilot CLI server over JSON-RPC and supports custom tools, MCP servers, and OpenTelemetry tracing.

Do I need a Copilot subscription to use the Copilot SDK?

Yes, unless you use BYOK. With bring-your-own-key, the SDK sends model calls to your own key for a provider such as OpenAI, Microsoft Foundry, or Anthropic.

Is the Microsoft Copilot API the same as the GitHub Copilot API?

No. Microsoft 365 Copilot APIs live in Microsoft Graph under graph.microsoft.com/v1.0/copilot and graph.microsoft.com/beta/copilot. They give custom apps access to Microsoft 365 Copilot features such as retrieval and meeting insights, and each user needs a Microsoft 365 Copilot license. GitHub Copilot is the coding assistant, with its own SDK and REST endpoints.

How much does GitHub Copilot cost?

Copilot Free and Copilot Student cost $0. Pro is $10 per month with 1,500 monthly AI credits, Pro+ is $39 with 7,000, and Max is $100 with 20,000. Business is $19 per seat with 1,900 credits per user. Enterprise is $39 per seat with 3,900 credits per user.

Can I get Copilot code completions via API?

No. Inline completions only run inside supported IDEs and Copilot's own clients. The unofficial copilot-api project on GitHub reverse-engineers the backend, but its README says GitHub does not support it and that heavy automated use can trigger GitHub's abuse detection.

Are Copilot Extensions still available?

GitHub App-based Copilot Extensions shut down on November 10, 2025, and GitHub blocked new ones on September 24, 2025. GitHub pointed builders to MCP servers instead. Client-side extensions built on the VS Code extension API kept working.

How does Morph compare to the Copilot SDK?

They do different jobs. The Copilot SDK runs an agent loop. Morph sells tools an agent loop calls. Fast Apply merges model-written edits into files at 10,500 tok/s for $0.80 per million input tokens and $1.20 per million output tokens. WarpGrep searches a codebase for $0.80 per 100K tokens. Either can be registered as a custom tool in a Copilot SDK session.

Can I build a Copilot-like tool with open APIs?

Yes. A coding agent needs a model, a way to search the repo, and a way to write edits back to files. Morph covers search and edits with WarpGrep and Fast Apply over an OpenAI-compatible API, and you can pair them with any model.

Related Pages

Build with Morph API

Fast Apply at 10,500 tok/s. WarpGrep for agentic code search, inside any sandbox. The coding primitives behind AI tools, available as pay-per-use APIs.