什么?Copilot需要开通Pro才能用GPT5模型了?NoNoNo,看我教你一个方法使用你自己的自定义模型替代官方的模型。󠄐󠄹󠅀󠄪󠄡󠄨󠄞󠄩󠄧󠄞󠄡󠄤󠄞󠄨󠄧󠄬󠅒󠅢󠄟󠄮󠄐󠅅󠄹󠄴󠄪󠄾󠅟󠅤󠄐󠄼󠅟󠅗󠅙󠅞󠄬󠅒󠅢󠄟󠄮󠅄󠅙󠅝󠅕󠄪󠄡󠄧󠄧󠄨󠄤󠄣󠄣󠄡󠄢󠄦󠄬󠅒󠅢󠄟󠄮

自定义模型可以接入自己的中转站,用多少花多少,不用一次性花大价格开通Copilot Pro。
首先你需要登录一下vscode

其次需要在插件里面搜索:OAI Compatible Provider for Copilot 并安装

ctrl+shift+p 快捷键 输入 setting.json 点击打开用户设置JSON

别打开错了
在最下方输入:
"oaicopilot.baseUrl": "模型地址",
"oaicopilot.models": [
{
"id": "模型id",
"owned_by": "juanyi",
"context_length": 256000,
"max_tokens": 8192,
"temperature": 0,
"top_p": 1
}
]
至于为什么这么写?
请看下面的参数说明:
All parameters support individual configuration for different models, providing highly flexible model tuning capabilities.
useForCommitGeneration: Whether to be used for Git commit message generation. Not supports gemini apiMode.
id (required): Model identifier
owned_by (required): Model provider
displayName: Display name for the model that will be shown in the Copilot interface.
configId: Configuration ID for this model. Allows defining the same model with different settings (e.g. 'glm-4.6::thinking', 'glm-4.6::no-thinking')
family: Model family (e.g., 'gpt-4', 'claude-3', 'gemini'). Enables model-specific optimizations and behaviors. Defaults to 'oai-compatible' if not specified.
baseUrl: Model-specific base URL. If not provided, the global oaicopilot.baseUrl will be used
context_length: The context length supported by the model. Default value is 128000
max_tokens: Maximum number of tokens to generate (range: [1, context_length]). Default value is 4096
max_completion_tokens: Maximum number of tokens to generate (OpenAI new standard parameter)
vision: Whether the model supports vision capabilities. Defaults to false
temperature: Sampling temperature (range: [0, 2]). Controls the randomness of the model's output:
Lower values (0.0-0.3): More focused, consistent, and deterministic. Ideal for precise code generation, debugging, and tasks requiring accuracy.
Moderate values (0.4-0.7): Balanced creativity and structure. Good for architecture design and brainstorming.
Higher values (0.7-2.0): More creative and varied responses. Suitable for open-ended questions and explanations.
Best Practice: Set to 0 to align with GitHub Copilot's default deterministic behavior for consistent code suggestions. Thinking-enabled models suggest 1.0 to ensure optimal performance of the thinking mechanism.
top_p: Top-p sampling value (range: (0, 1]). Optional parameter
top_k: Top-k sampling value (range: [1, ∞)). Optional parameter
min_p: Minimum probability threshold (range: [0, 1]). Optional parameter
frequency_penalty: Frequency penalty (range: [-2, 2]). Optional parameter
presence_penalty: Presence penalty (range: [-2, 2]). Optional parameter
repetition_penalty: Repetition penalty (range: (0, 2]). Optional parameter
enable_thinking: Enable model thinking and reasoning content display (for non-OpenRouter providers)
thinking_budget: Maximum token count for thinking chain output. Optional parameter
reasoning: OpenRouter reasoning configuration, includes the following options:
enabled: Enable reasoning functionality (if not specified, will be inferred from effort or max_tokens)
effort: Reasoning effort level (high, medium, low, minimal, auto)
exclude: Exclude reasoning tokens from the final response
max_tokens: Specific token limit for reasoning (Anthropic style, as an alternative to effort)
thinking: Thinking configuration for Zai provider
type: Set to 'enabled' to enable thinking, 'disabled' to disable thinking
reasoning_effort: Reasoning effort level (OpenAI reasoning configuration)
headers: Custom HTTP headers to be sent with every request to this model's provider (e.g., {"X-API-Version": "v1", "X-Custom-Header": "value"}). These headers will be merged with the default headers (Authorization, Content-Type, User-Agent)
extra: Extra request body parameters.
include_reasoning_in_request: Whether to include reasoning_content in assistant messages sent to the API. Supports deepseek-v3.2 and similar models.
apiMode: API mode: 'openai' (Default) for API (/chat/completions), 'openai-responses' for API (/responses), 'ollama' for API (/api/chat), 'anthropic' for API (/v1/messages), 'gemini' for API (/v1beta/models/{model}:streamGenerateContent?alt=sse).
delay: Model-specific delay in milliseconds between consecutive requests. If not specified, falls back to global oaicopilot.delay configuration.
ctrl+shift+p 快捷键 输入 oai 选中如图所示的一行

千万别选错了,选中juanyi

输入你的api_key,回车确定

在右下角的auto里面,点击auto

选择其他模型 里面的 管理模型

双击OAI下面你自定义的模型启动

这样在选择模型里面你就可以用你自己的自定义模型了


这样你就可以用自己的想要的模型来使用了,只要支持OpenAI的格式,理论上都可以使用这个方法。
参与讨论