Issue evidence · AI API · n8n-io/n8n

OpenAI-Compatible Endpoint Returns 500 on Responses API, Should Fall Back to Chat Completions

GitHub issue: https://github.com/n8n-io/n8n/issues/40924

Reproduced

When a custom OpenAI-compatible endpoint answers 500 on /v1/responses, n8n does not fall back to /v1/chat/completions and fails after retries.

What Badgr ran

Extracted n8n's own fallback classifier (servesNoResponsesApi and its helpers) from packages/@n8n/agents/src/runtime/model/openai-api-style.ts on master and ran it on the issue's error shape, locally. The full n8n agent and a Badgr route were not run.

What came back

  • 500 with {error:{message:"'role'", type:"InternalServerError", code:500}} (the issue's body): falls back = false.
  • 500 with a generic server_error body: falls back = false.
  • 400 with code unknown_url (control): falls back = true.

This runs the real decision function on the reported input; it is not an end-to-end n8n run. My 404 and 405 controls used a body with no error object and are not informative. A mock endpoint through Badgr was not built.

Checked 2026-10-14 in Badgr’s local development environment.

← All issue evidence