diff --git a/src/config/index.mjs b/src/config/index.mjs index abd174a67..1b9ad9ebc 100644 --- a/src/config/index.mjs +++ b/src/config/index.mjs @@ -152,6 +152,7 @@ export const openRouterApiModelKeys = [ 'openRouter_openai_o3', 'openRouter_openai_gpt_4_1_mini', 'openRouter_fusion', + 'openRouter_fusion_flash', 'openRouter_openai_gpt_chat_latest', 'openRouter_openai_gpt_5_5', 'openRouter_openai_gpt_5_5_pro', @@ -516,6 +517,10 @@ export const Models = { value: 'openrouter/fusion', desc: 'OpenRouter (Fusion)', }, + openRouter_fusion_flash: { + value: 'openrouter/fusion-flash', + desc: 'OpenRouter (Fusion Flash)', + }, openRouter_openai_gpt_chat_latest: { value: 'openai/gpt-chat-latest', desc: 'OpenRouter (GPT Chat Latest)', diff --git a/tests/unit/services/apis/thin-adapters.test.mjs b/tests/unit/services/apis/thin-adapters.test.mjs index 4a41d2f11..618629207 100644 --- a/tests/unit/services/apis/thin-adapters.test.mjs +++ b/tests/unit/services/apis/thin-adapters.test.mjs @@ -68,10 +68,11 @@ const adapters = [ }, { name: 'openrouter-api', - apiMode: { groupName: 'openRouterApiModelKeys', itemName: 'openRouter_openai_o3' }, + apiMode: { groupName: 'openRouterApiModelKeys', itemName: 'openRouter_fusion_flash' }, providerId: 'openrouter', expectedBaseUrl: 'https://openrouter.ai/api/v1', expectedApiKey: 'or-key', + expectedModel: 'openrouter/fusion-flash', }, { name: 'chatglm-api', @@ -116,6 +117,9 @@ for (const adapter of adapters) { assert.equal(capturedInput, `${adapter.expectedBaseUrl}/chat/completions`) // Verify API key reaches the Authorization header assert.equal(capturedInit.headers.Authorization, `Bearer ${adapter.expectedApiKey}`) + if (adapter.expectedModel) { + assert.equal(JSON.parse(capturedInit.body).model, adapter.expectedModel) + } }) test(`${adapter.name}: delegates to compat layer and produces output`, async (t) => {