Skip to content

Support for BYOK to add models into COPILOT CLI Through API Keys #1095

@aosama

Description

@aosama

Describe the feature or problem you'd like to solve

As a user of COPILOT CLI, I sometimes need to add new models through BYOK (Bring Your Own Key). This allows me to benefite from using models such as Grok 4.1 and their 1 million token window.

This solves use cases where larger context window models are needed, for example reading a large codebase and planning a major refactor. Another example is using dpecialized models which have better aptitude for dealing with complex mathematics.

Proposed solution

Allow the addition of model providers and API keys into the JSON configuration files of copilot CLI. For exampl,

{
"modelProviders": {
"xai": {
"name": "xAI",
"provider": "openai-compatible",
"baseUrl": "https://api.x.ai/v1",
"apiKey": "${XAI_API_KEY}",
"models": [
{
"id": "grok-3",
"displayName": "Grok 4 (My Key)",
"contextLength": 1000000,
"capabilities": ["tool_use", "vision"]
}
]
}
}
}

Example prompts or workflows

No response

Additional context

 While the model lineup from the co pilot subscription is absolutely fantastic, There are use cases where models from different providers and different from the lineup are needed. Particularly the most pressing need (in my use cases) is the larger context window and the larger GROK models from XAI.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions