Use Inference APIs with VS Code Copilot Chat (bring your own key)
Use Inference APIs models in VS Code's Copilot Chat through the Custom Endpoint provider, with your own key and per-token billing.
Settings
| Setting | Value |
|---|---|
| Base URL | https://api.inferenceapis.com/v1 (also /openai/v1) |
| API key | From API Keys; send as Authorization: Bearer … |
| Chat model ids | openai/gpt-oss-120b, deepseek-ai/DeepSeek-V4-Flash, zai-org/GLM-5.3-Flash, meta-llama/Llama-3.3-70B-Instruct-Turbo — all models |
| Audio model ids | openai/whisper-large-v3 (transcription), hexgrad/Kokoro-82M (speech) |
Which model
Agent mode needs reliable tool calling: zai-org/GLM-5.3 or deepseek-ai/DeepSeek-V4-Pro. For quick chat, deepseek-ai/DeepSeek-V4.1-Flash. Prices and measured speed: chat models.
Steps
- Open the model picker in the Chat view and choose Manage Language Models (the gear icon).
- Choose Add Models, then the Custom Endpoint provider.
- Pick the Chat Completions API type. Responses also works on this endpoint.
- URL:
https://api.inferenceapis.com/v1/chat/completions. API key: your Inference APIs key. - Add a model with id
zai-org/GLM-5.3, tool calling on, vision off, max input tokens 1000000 and max output tokens 32768. Repeat for any other model id from the model list.
Verify
Open Chat, select the model you added, and ask it to "list the files in this workspace" in agent mode; a working tool call confirms the setup.
How this guide was checked
Configuration only These steps follow the VS Code documentation for the Custom Endpoint provider, which replaced the older "OpenAI Compatible" provider and the deprecated github.copilot.chat.customOAIModels setting. We verified the chat-completions and Responses behaviour it relies on but did not run VS Code itself. If a step does not match what you see, tell us.
Gotchas
- Inline code completions, semantic search and other embedding-based features still use GitHub's own models; bring-your-own-key covers chat and agent mode.
- On Copilot Business or Enterprise, an administrator can switch the bring-your-own-key policy off.
- Turn vision off for the text models. Turn it on for Qwen/Qwen3-VL-235B-A22B-Instruct, which accepts images.
If something fails
401 — key missing or wrong · 402 insufficient_balance — add credits on Billing · 404 model_not_found — check the id against the model list (aliases such as gpt-oss-120b work too) · 503 model_unavailable — the model is being enabled. Full details in the API docs.
