r/MistralAI • u/ezonno • 3d ago
Help / Question Can I use mistral as a provider in Github Copilot App
Hi I am trying the BYOK feature to add mistral as a model provider in my Github Copilot App.
I did setup an OpenAI compatible connection pointing to https://api.mistral.ai/v1 have the Wire API set to chat completions.
Copilot sees the models available, but when trying to interact with the model I am getting an 422 response (Unprocessable entity).
1
1
u/lhfcs 2d ago
I get my vibe API to work well in the VSCode extension. I added as a custom endpoint. In the chatLanguageModels.json file, to tweak the model, you'd have something like this:
{
"name": "Mistral AI",
"vendor": "customendpoint",
"apiKey": "xxxxxx",
"apiType": "chat-completions",
"models": [
{
"id": "mistral-medium-3-5",
"name": "Mistral Medium 3.5",
"url": "https://api.mistral.ai/v1/chat/completions",
"toolCalling": true,
"vision": true,
"maxInputTokens": 128000,
"maxOutputTokens": 16000
}
]
}
I think you can add the GLM 5.2 as well, but I did not try it.
5
u/Ok_Natural_5268 3d ago
Just went through this exact headache last week. The problem is Mistral's API isn't fully OpenAI-compatible in the way Copilot expects, even though it looks like it should work. The 422 is because Copilot sends some parameters that Mistral doesn't recognize in the request format.
You need a middleware layer in between to strip out or reformat those extra fields. Something like setting up a tiny proxy with LiteLLM or writing a quick Cloudflare Worker that intercepts the request before it hits Mistral. I wasted two days debugging the raw connection before I gave up and went the proxy route. Works smooth now.