Problem
OpenAiCompatibleModelFactory.mistral() configures the OpenAI-compatible client with:
The OpenAI Java client appends /chat/completions, so validation calls are sent to:
https://api.mistral.ai/chat/completions
Mistral exposes the OpenAI-compatible endpoint under /v1, making the request return HTTP 404. The expected endpoint is:
https://api.mistral.ai/v1/chat/completions
This causes OpenAiCompatibleModelFactoryByokIT.mistral buildValidated succeeds with valid key to fail when MISTRAL_API_KEY is configured.
Proposed fix
Change the Mistral base URL in OpenAiCompatibleModelFactory.mistral() to:
https://api.mistral.ai/v1
The change should remain provider-specific. The generic factory must not append /v1, because other OpenAI-compatible providers use different versioned paths, such as Gemini's /v1beta/openai, and custom providers may use arbitrary paths.
Regression coverage
- Run the existing Mistral BYOK integration test with
MISTRAL_API_KEY and confirm buildValidated() succeeds.
- Where practical, add a credential-free request-path test confirming that a
/v1 base URL results in a request to /v1/chat/completions.
Acceptance criteria
OpenAiCompatibleModelFactory.mistral() sends chat-completion requests to https://api.mistral.ai/v1/chat/completions.
- The live Mistral BYOK integration test passes with a valid key.
- Other named and custom OpenAI-compatible providers are unchanged.
Reference: #1929 (review)
Problem
OpenAiCompatibleModelFactory.mistral()configures the OpenAI-compatible client with:The OpenAI Java client appends
/chat/completions, so validation calls are sent to:Mistral exposes the OpenAI-compatible endpoint under
/v1, making the request return HTTP 404. The expected endpoint is:This causes
OpenAiCompatibleModelFactoryByokIT.mistral buildValidated succeeds with valid keyto fail whenMISTRAL_API_KEYis configured.Proposed fix
Change the Mistral base URL in
OpenAiCompatibleModelFactory.mistral()to:The change should remain provider-specific. The generic factory must not append
/v1, because other OpenAI-compatible providers use different versioned paths, such as Gemini's/v1beta/openai, and custom providers may use arbitrary paths.Regression coverage
MISTRAL_API_KEYand confirmbuildValidated()succeeds./v1base URL results in a request to/v1/chat/completions.Acceptance criteria
OpenAiCompatibleModelFactory.mistral()sends chat-completion requests tohttps://api.mistral.ai/v1/chat/completions.Reference: #1929 (review)