GitHub Copilot
Verified Code examples on this page have been automatically tested and verified.Configure GitHub Copilot in VS Code to route requests through agentgateway.
Before you begin
- Agentgateway running at
http://localhost:3000with a configured LLM backend. - VS Code with the GitHub Copilot extension installed.
- A GitHub Copilot Business or Enterprise subscription.
Example agentgateway configuration
cat > /tmp/test-copilot.yaml << 'EOF'
# yaml-language-server: $schema=https://agentgateway.dev/schema/config
llm:
port: 3000
models:
- name: "*"
provider: openAI
params:
apiKey: "$OPENAI_API_KEY"
EOFConfigure GitHub Copilot
Open VS Code Settings (
Cmd + ,on macOS,Ctrl + ,on Windows/Linux).Search for
github.copilotin the settings search bar.Set the proxy URL to your agentgateway address. Click Edit in settings.json and add:
{ "github.copilot.advanced": { "debug.overrideProxyUrl": "http://localhost:3000/v1" } }Save the file and reload VS Code (
Cmd + Shift + P> Developer: Reload Window).
Verify the connection
- Open a code file in VS Code.
- Start typing and wait for Copilot suggestions to appear.
- Open the Copilot chat panel (
Cmd + Shift + Ion macOS,Ctrl + Shift + Ion Windows/Linux) and send a test message.