Thanks @andreasdueren.
I tried wiring AFFiNEβs openai provider to Mistral (baseUrl=https://api.mistral.ai/v1, model mistral-large-latest + scenarios override), but AFFiNE is calling the new OpenAI Responses API (/v1/responses), while Mistral only exposes the older /v1/chat/completions, so I get 404s ("no Route matched with those values").
This seems to be the same limitation described in GitHub issues #13617 and #13480, where the suggested fix is to set "oldApiStyle": true under copilot.providers.openai in config.json to force the old chat/completions style. I've tried that without success despite it's part of the code https://github.com/toeverything/AFFiNE/blob/62fe6982fbdbfa9d6fcbad78019e4d6cda62338a/packages/backend/server/src/plugins/copilot/providers/openai.ts#L55
Iβm not sure whether the Cloudron AFFiNE package already includes any other workaround, so right now Mistral isnβt really usable as an OpenAI-compatible backend in this setup.
Nov 17 09:50:05 APICallError [AI_APICallError]: Not Found
Nov 17 09:50:05 at file:///run/affine/affine-build/node_modules/@ai-sdk/provider-utils/dist/index.mjs:890:14
Nov 17 09:50:05 at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Nov 17 09:50:05 at async postToApi (file:///run/affine/affine-build/node_modules/@ai-sdk/provider-utils/dist/index.mjs:721:28)
Nov 17 09:50:05 at async OpenAIResponsesLanguageModel.doStream (file:///run/affine/affine-build/node_modules/@ai-sdk/openai/dist/index.mjs:3631:50)
Nov 17 09:50:05 at async fn (file:///run/affine/affine-build/node_modules/ai/dist/index.mjs:4987:27)
Nov 17 09:50:05 at async file:///run/affine/affine-build/node_modules/ai/dist/index.mjs:1544:22
Nov 17 09:50:05 at async _retryWithExponentialBackoff (file:///run/affine/affine-build/node_modules/ai/dist/index.mjs:1695:12)
Nov 17 09:50:05 at async streamStep (file:///run/affine/affine-build/node_modules/ai/dist/index.mjs:4943:15)
Nov 17 09:50:05 at async fn (file:///run/affine/affine-build/node_modules/ai/dist/index.mjs:5284:9)
Nov 17 09:50:05 at async file:///run/affine/affine-build/node_modules/ai/dist/index.mjs:1544:22 {
Nov 17 09:50:05 cause: undefined,
Nov 17 09:50:05 url: 'https://api.mistral.ai/v1/responses',
Nov 17 09:50:05 requestBodyValues: {
Nov 17 09:50:05 model: 'mistral-large-latest',
Nov 17 09:50:05 input: [ [Object], [Object] ],
Nov 17 09:50:05 temperature: 0,
Nov 17 09:50:05 top_p: undefined,
Nov 17 09:50:05 max_output_tokens: 4096,
Nov 17 09:50:05 max_tool_calls: undefined,
Nov 17 09:50:05 metadata: undefined,
Nov 17 09:50:05 parallel_tool_calls: undefined,
Nov 17 09:50:05 previous_response_id: undefined,
Nov 17 09:50:05 store: undefined,
Nov 17 09:50:05 user: '<REDACTED>',
Nov 17 09:50:05 instructions: undefined,
Nov 17 09:50:05 service_tier: undefined,
Nov 17 09:50:05 include: [ 'web_search_call.action.sources' ],
Nov 17 09:50:05 prompt_cache_key: undefined,
Nov 17 09:50:05 safety_identifier: undefined,
Nov 17 09:50:05 top_logprobs: undefined,
Nov 17 09:50:05 truncation: undefined,
Nov 17 09:50:05 tools: [
Nov 17 09:50:05 [Object], [Object],
Nov 17 09:50:05 [Object], [Object],
Nov 17 09:50:05 [Object], [Object],
Nov 17 09:50:05 [Object], [Object]
Nov 17 09:50:05 ],
Nov 17 09:50:05 tool_choice: 'auto',
Nov 17 09:50:05 stream: true
Nov 17 09:50:05 },
Nov 17 09:50:05 statusCode: 404,
Nov 17 09:50:05 responseHeaders: {
Nov 17 09:50:05 'access-control-allow-origin': '*',
Nov 17 09:50:05 'alt-svc': 'h3=":443"; ma=86400',
Nov 17 09:50:05 'cf-cache-status': 'DYNAMIC',
Nov 17 09:50:05 'cf-ray': '99fdfa7caeef2c00-FRA',
Nov 17 09:50:05 connection: 'keep-alive',
Nov 17 09:50:05 'content-encoding': 'br',
Nov 17 09:50:05 'content-type': 'application/json; charset=utf-8',
Nov 17 09:50:05 date: 'Mon, 17 Nov 2025 08:50:04 GMT',
Nov 17 09:50:05 server: 'cloudflare',
Nov 17 09:50:05 'set-cookie': '_cfuvid=<REDACTED>-1763369404992-<REDACTED_IP>-604800000; path=/; domain=.mistral.ai; HttpOnly; Secure; SameSite=None',
Nov 17 09:50:05 'strict-transport-security': 'max-age=15552000; includeSubDomains; preload',
Nov 17 09:50:05 'transfer-encoding': 'chunked',
Nov 17 09:50:05 'x-content-type-options': 'nosniff',
Nov 17 09:50:05 'x-kong-response-latency': '1'
Nov 17 09:50:05 },
Nov 17 09:50:05 responseBody: '{\n' +
Nov 17 09:50:05 ' "message":"no Route matched with those values",\n' +
Nov 17 09:50:05 ' "request_id":"<REDACTED>"\n' +
Nov 17 09:50:05 '}',
Nov 17 09:50:05 isRetryable: false,
Nov 17 09:50:05 data: undefined,
Nov 17 09:50:05 [Symbol(vercel.ai.error)]: true,
Nov 17 09:50:05 [Symbol(vercel.ai.error.AI_APICallError)]: true
Nov 17 09:50:05 }
Also interesting read: https://sneekes.app/posts/getting_affine_ai_copilot_working_with_custom_models_and_ollama/
TLDR: Too bad for me 
EDIT: after deleting the keys from table app_configs and forcing the oldApiStyle: true in openai provider config, I get a different stack trace but still not solving the issue
, see below
Nov 17 10:06:30 [Nest] 72 - 11/17/2025, 9:06:30 AM ERROR [OpenAIProvider] <selfhosted:event:27148b39-55a5-4e71-91ec-ce77dd2bb451> Failed to fetch available models
Nov 17 10:06:30 ZodError: [
Nov 17 10:06:30 {
Nov 17 10:06:30 "code": "invalid_type",
Nov 17 10:06:30 "expected": "array",
Nov 17 10:06:30 "received": "undefined",
Nov 17 10:06:30 "path": [
Nov 17 10:06:30 "data"
Nov 17 10:06:30 ],
Nov 17 10:06:30 "message": "Required"
Nov 17 10:06:30 }
Nov 17 10:06:30 ]
Nov 17 10:06:30 at get error (file:///run/affine/affine-build/node_modules/zod/dist/esm/v3/types.js:51:31)
Nov 17 10:06:30 at ZodObject.parse (file:///run/affine/affine-build/node_modules/zod/dist/esm/v3/types.js:126:22)
Nov 17 10:06:30 at file:///run/affine/affine-build/dist/main.js:122774:66
Nov 17 10:06:30 at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Nov 17 10:06:30 at async OpenAIProvider.refreshOnlineModels (file:///run/affine/affine-build/dist/main.js:122769:34)
Nov 17 10:06:30 <REDACTED_IP> - - [17/Nov/2025:09:06:30 +0000] "GET /api/auth/session HTTP/1.1" 200 193 "https://affine.zoemp.be/workspace/4Ob0-Wxj2fHaDhkgaW6gC/Y4cspZCWKz" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/<REDACTED_IP> Safari/537.36"
...
...
Nov 17 10:06:37 [Nest] 72 - 11/17/2025, 9:06:37 AM DEBUG [CopilotProviderFactory] <selfhosted:http:ef38c027-0882-4057-9f12-f7a552f391a6> Resolving copilot provider for output type: object
Nov 17 10:06:37 [Nest] 72 - 11/17/2025, 9:06:37 AM ERROR [Sse] <selfhosted:http:ef38c027-0882-4057-9f12-f7a552f391a6> no_copilot_provider_available ({"sessionId":"<REDACTED>","params":{"messageId":"79b66a60-8f15-43fe-ac11-6b90e2a7e300"},"throwInStream":false})
Nov 17 10:06:37 no_copilot_provider_available: No copilot provider available: mistral-large-latest
Nov 17 10:06:37 at CopilotController.chooseProvider (file:///run/affine/affine-build/dist/main.js:130026:19)
Nov 17 10:06:37 at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Nov 17 10:06:37 at async CopilotController.prepareChatSession (file:///run/affine/affine-build/dist/main.js:130080:37)
Nov 17 10:06:37 at async CopilotController.chatStreamObject (file:///run/affine/affine-build/dist/main.js:130214:64)
Nov 17 10:06:37 at async CopilotController.<anonymous> (file:///run/affine/affine-build/dist/main.js:6374:20)