Skip to main content

GitHub Copilot

GitHub Copilot is available on the Spanway gateway through the github_copilot/ model prefix. You register a GitHub Copilot model once in the gateway's config.yaml (or through the Admin UI), and every application then calls it through the gateway's OpenAI-compatible API with a Spanway virtual key. The provider credential stays on the gateway, and every request is authenticated, rate limited, logged and costed in the same way as any other provider.

The gateway translates requests and responses for GitHub Copilot natively, so provider specific parameters and errors are mapped to the OpenAI format for you.

Supported endpoints​

The gateway's endpoint support matrix lists the following endpoints for GitHub Copilot. Each link explains the request shape and the gateway features that apply to that endpoint.

Model types​

The bundled price map lists 43 GitHub Copilot models across these modes: Chat, Text completion, Responses, Embedding. The mode decides which gateway endpoint a model is meant for, and it is also used by the gateway's health checks to send the right kind of test request.

Environment variables​

The GitHub Copilot integration reads the following environment variables. Variables marked as required are the ones the gateway's environment validation checks for this provider. You can also pass any of these values directly in spanway_params (for example api_key or api_base), and the per-model value wins over the environment.

VariableRequiredPurpose
GITHUB_COPILOT_TOKEN_DIRNoFolder that holds the device sign-in tokens the gateway sends to GitHub Copilot. The gateway never sends OPENAI_API_KEY to Copilot
GITHUB_COPILOT_ACCESS_TOKEN_FILENoFile name of the sign-in access token inside that folder, access-token by default
GITHUB_COPILOT_API_KEY_FILENoFile name of the short lived Copilot key inside that folder, api-key.json by default

Reference a variable from config.yaml with the os.environ/ prefix so that the secret never appears in the file itself. Secrets can also come from a secret manager, see secret managers.

Each developer's own Copilot seat​

A shared credential sends every request through one Copilot account. With the auth type Per-user GitHub OAuth (github_copilot_auth_type: per_user_oauth on the credential), each developer connects their own Copilot seat once, and their requests to a model on that credential use their own seat. Requests from a developer who has not connected are refused with a message that says how to connect, and the gateway never shares one person's token with another.

  1. Open Models + Endpoints, pick the Add Model tab, choose GitHub Copilot as the Provider, set Auth Type: to Per-user GitHub OAuth, click Create credential and name it.
  2. Add the model on that credential, which sets spanway_credential_name on the deployment.
  3. Each developer opens the LLM Credentials tab, finds the credential under Your connections, clicks Connect, enters the code from the Connect GitHub Copilot dialog on the provider's page and waits for Connected as @their-login.

Connecting and disconnecting are written to the audit log, without the token. See personal provider connections for every step, the API calls and the errors.

Models and pricing​

The table lists every GitHub Copilot model in the gateway's bundled price map. Prices are shown in US dollars per 1 million tokens, computed from the per-token values the gateway uses for spend tracking. Context window sizes are the provider limits recorded in the same file. Capabilities are the supports_* flags set for each model.

info

Prices come from the price map bundled with this Spanway build. They are used to calculate the spend recorded for each request, key, team and user. Your negotiated rates may differ, and you can override them per deployment with custom pricing.

Model (model value)ModeMax input tokensMax output tokensInput per 1M tokensOutput per 1M tokensOther pricingCapabilities
github_copilot/claude-fable-5Chat200,00064,000tools, vision, reasoning, structured output
github_copilot/claude-fable-5.1Chat200,00064,000tools, vision, reasoning, structured output
github_copilot/claude-haiku-4.5Chat128,00016,000$1.00$5.00tools, vision, reasoning
github_copilot/claude-haiku-5.5Chat128,00016,000$0.1$0.5tools, vision, reasoning, structured output
github_copilot/claude-opus-4.8Chat200,00064,000tools, vision, reasoning, structured output
github_copilot/claude-opus-4.8-fastChat200,00064,000tools, vision, reasoning, structured output
github_copilot/claude-opus-5Chat200,00064,000tools, vision, reasoning, structured output
github_copilot/claude-opus-5.5Chat200,000128,000tools, vision, reasoning, structured output
github_copilot/claude-sonnet-5Chat200,00064,000tools, vision, reasoning, structured output
github_copilot/claude-sonnet-5.5Chat200,000128,000tools, vision, reasoning, structured output
github_copilot/gemini-3.7-flashChat200,00064,000tools, vision, reasoning
github_copilot/gemini-3.8-flashChat200,00065,536tools, vision, reasoning
github_copilot/gpt-3.5-turboChat16,3844,096tools
github_copilot/gpt-3.5-turbo-0613Chat16,3844,096tools
github_copilot/gpt-4Chat32,7684,096tools
github_copilot/gpt-4-0613Chat32,7684,096tools
github_copilot/gpt-4-o-previewChat64,0004,096tools
github_copilot/gpt-4.1Chat128,00016,384tools, vision, structured output
github_copilot/gpt-4.1-2025-04-14Chat128,00016,384tools, vision, structured output
github_copilot/gpt-4oChat64,0004,096tools, vision
github_copilot/gpt-4o-2024-05-13Chat64,0004,096tools, vision
github_copilot/gpt-4o-2024-08-06Chat64,00016,384tools
github_copilot/gpt-4o-2024-11-20Chat64,00016,384tools, vision
github_copilot/gpt-4o-miniChat64,0004,096tools
github_copilot/gpt-4o-mini-2024-07-18Chat64,0004,096tools
github_copilot/gpt-5-miniChat128,00064,000$0.25$2.00tools, vision, structured output
github_copilot/gpt-5.3-codexResponses128,000128,000$1.75$14.00tools, vision, reasoning, structured output
github_copilot/gpt-5.4Chat272,000128,000tools, vision, reasoning, structured output
github_copilot/gpt-5.4-miniResponses272,000128,000tools, vision, reasoning, structured output
github_copilot/gpt-5.5Responses272,000128,000tools, vision, reasoning, structured output
github_copilot/gpt-5.6-lunaResponses200,000128,000tools, vision, reasoning, structured output
github_copilot/gpt-5.6-solResponses272,000128,000tools, vision, reasoning, structured output
github_copilot/gpt-5.6-terraResponses272,000128,000tools, vision, reasoning, structured output
github_copilot/gpt-6-astraResponses272,000128,000tools, vision, reasoning, structured output
github_copilot/gpt-6-lunaResponses272,000128,000tools, vision, reasoning, structured output
github_copilot/gpt-6-solResponses272,000128,000tools, vision, reasoning, structured output
github_copilot/gpt-6.1-solResponses272,000128,000tools, vision, reasoning, structured output
github_copilot/gpt-41-copilotText completion
github_copilot/kimi-k3Chat917,504131,072tools, vision, structured output
github_copilot/mai-code-1.1-flashResponses128,000128,000tools, vision, structured output
github_copilot/text-embedding-3-smallEmbedding8,191
github_copilot/text-embedding-3-small-inferenceEmbedding8,191
github_copilot/text-embedding-ada-002Embedding8,191