Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

Merge pull request #655 from oSoWoSo/dev

Diego Rodrigues de Sa e Souza6acd36e374e9
diff --cc CHANGELOG.md
index eefea02b8d,eefea02b8d..1ffbd255e6
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -4,6 -4,6 +4,18 @@@
---
++## [3.1.4] — 2026-03-27
++
++### 🐛 Bug Fixes
++
++- **Streaming Override Fix** — Explicit `stream: true` in request body now takes priority over `Accept: application/json` header. Clients sending both will correctly receive SSE streaming responses (#656)
++
++### 🌍 i18n
++
++- **Czech string improvements** — Refined terminology across `cs.json` (PR #655 by @zen0bit)
++
++---
++
## [3.1.3] — 2026-03-26
### 🌍 i18n & Community
diff --cc docs/openapi.yaml
index 7befd7528e,7befd7528e..3bb6399beb
--- a/docs/openapi.yaml
+++ b/docs/openapi.yaml
@@@ -1,7 -1,7 +1,7 @@@
openapi: 3.1.0
info:
title: OmniRoute API
-- version: 3.1.3
++ version: 3.1.4
description: |
OmniRoute is a local-first AI API proxy router. It provides an OpenAI-compatible
endpoint that routes requests to multiple AI providers with load balancing,
diff --cc open-sse/utils/aiSdkCompat.ts
index ec206f087f,ec206f087f..a439ae928e
--- a/open-sse/utils/aiSdkCompat.ts
+++ b/open-sse/utils/aiSdkCompat.ts
@@@ -13,10 -13,10 +13,17 @@@ export function clientWantsJsonResponse
/**
* Resolves stream behavior from request body + Accept header.
-- * OpenAI-compatible behavior: stream only when `stream: true` and client did not force JSON.
++ * Priority: explicit `stream: true/false` in body wins.
++ * Accept header only acts as fallback when stream is not explicitly set.
++ * Fixes #656: clients sending both `stream: true` and `Accept: application/json`
++ * should still get streaming responses — body intent takes precedence.
*/
export function resolveStreamFlag(bodyStream: unknown, acceptHeader: unknown): boolean {
-- return bodyStream === true && !clientWantsJsonResponse(acceptHeader);
++ // Explicit body value always wins
++ if (bodyStream === true) return true;
++ if (bodyStream === false) return false;
++ // No explicit stream param — fall back to Accept header heuristic
++ return !clientWantsJsonResponse(acceptHeader);
}
/**
diff --cc package-lock.json
index ce292be887,ce292be887..2556400191
--- a/package-lock.json
+++ b/package-lock.json
@@@ -1,12 -1,12 +1,12 @@@
{
"name": "omniroute",
-- "version": "3.1.3",
++ "version": "3.1.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "omniroute",
-- "version": "3.1.3",
++ "version": "3.1.4",
"hasInstallScript": true,
"license": "MIT",
"workspaces": [
diff --cc package.json
index 8ae9dbe6e8,8ae9dbe6e8..241e05e541
--- a/package.json
+++ b/package.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "omniroute",
-- "version": "3.1.3",
++ "version": "3.1.4",
"description": "Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",
"type": "module",
"bin": {
diff --cc tests/unit/t26-ai-sdk-accept-header-compat.test.mjs
index 9f9d44e818,9f9d44e818..c4f9b1ba0f
--- a/tests/unit/t26-ai-sdk-accept-header-compat.test.mjs
+++ b/tests/unit/t26-ai-sdk-accept-header-compat.test.mjs
@@@ -4,9 -4,9 +4,10 @@@ import assert from "node:assert/strict"
const { clientWantsJsonResponse, resolveStreamFlag, stripMarkdownCodeFence } =
await import("../../open-sse/utils/aiSdkCompat.ts");
--test("T26: Accept application/json disables SSE stream mode", () => {
++test("T26: explicit stream:true takes priority over Accept application/json (#656)", () => {
assert.equal(clientWantsJsonResponse("application/json"), true);
-- assert.equal(resolveStreamFlag(true, "application/json"), false);
++ // Body stream:true always wins — even with Accept: application/json
++ assert.equal(resolveStreamFlag(true, "application/json"), true);
});
test("T26: text/event-stream keeps SSE behavior", () => {
@@@ -28,3 -28,3 +29,16 @@@ test("T26: non-fenced content is return
const plain = '{"name":"omniroute"}';
assert.equal(stripMarkdownCodeFence(plain), plain);
});
++
++test("T26: undefined stream falls back to Accept header heuristic (#656)", () => {
++ // No explicit stream param — Accept: application/json means no streaming
++ assert.equal(resolveStreamFlag(undefined, "application/json"), false);
++ // No explicit stream param + no JSON accept = stream by default
++ assert.equal(resolveStreamFlag(undefined, "text/event-stream"), true);
++ assert.equal(resolveStreamFlag(undefined, undefined), true);
++});
++
++test("T26: explicit stream:false always prevents streaming", () => {
++ assert.equal(resolveStreamFlag(false, "text/event-stream"), false);
++ assert.equal(resolveStreamFlag(false, undefined), false);
++});