Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

šŸ› fix: update payload handling for OpenRouter image models (#10622)

sxjerud717d5da2074
diff --git a/packages/model-bank/src/aiModels/cerebras.ts b/packages/model-bank/src/aiModels/cerebras.ts
index aaeaf59bb92..ef89376c0ad 100644
--- a/packages/model-bank/src/aiModels/cerebras.ts
+++ b/packages/model-bank/src/aiModels/cerebras.ts
@@ -1,47 +1,6 @@
import { type AIChatModelCard } from '../types/aiModel';
const cerebrasModels: AIChatModelCard[] = [
- {
- abilities: {
- functionCall: true,
- reasoning: true,
- structuredOutput: true,
- },
- contextWindowTokens: 131_072,
- description:
- 'This model delivers strong coding performance with advanced reasoning capabilities, superior tool use, and enhanced real-world performance in agentic coding applications.',
- displayName: 'GLM 4.7',
- enabled: true,
- id: 'zai-glm-4.7',
- maxOutput: 40_000,
- pricing: {
- units: [
- { name: 'textInput', rate: 2.25, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 2.75, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
- {
- abilities: {
- functionCall: true,
- reasoning: true,
- },
- contextWindowTokens: 131_072,
- displayName: 'GPT OSS 120B',
- enabled: true,
- id: 'gpt-oss-120b',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.35, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.75, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- settings: {
- extendParams: ['reasoningEffort'],
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
diff --git a/packages/model-bank/src/aiModels/google.ts b/packages/model-bank/src/aiModels/google.ts
index 973a9e4f7cd..1aee242cc66 100644
--- a/packages/model-bank/src/aiModels/google.ts
+++ b/packages/model-bank/src/aiModels/google.ts
@@ -360,111 +360,6 @@ const googleChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- reasoning: true,
- search: true,
- video: true,
- vision: true,
- },
- contextWindowTokens: 1_048_576 + 65_536,
- description:
- 'Gemini 2.5 Pro Preview is Google’s most advanced reasoning model, able to reason over code, math, and STEM problems and analyze large datasets, codebases, and documents with long context.',
- displayName: 'Gemini 2.5 Pro Preview 06-05',
- id: 'gemini-2.5-pro-preview-06-05',
- maxOutput: 65_536,
- pricing: {
- units: [
- {
- name: 'textInput_cacheRead',
- strategy: 'tiered',
- tiers: [
- { rate: 0.31, upTo: 200_000 },
- { rate: 0.625, upTo: 'infinity' },
- ],
- unit: 'millionTokens',
- },
- {
- name: 'textInput',
- strategy: 'tiered',
- tiers: [
- { rate: 1.25, upTo: 200_000 },
- { rate: 2.5, upTo: 'infinity' },
- ],
- unit: 'millionTokens',
- },
- {
- name: 'textOutput',
- strategy: 'tiered',
- tiers: [
- { rate: 10, upTo: 200_000 },
- { rate: 15, upTo: 'infinity' },
- ],
- unit: 'millionTokens',
- },
- ],
- },
- releasedAt: '2025-06-05',
- settings: {
- extendParams: ['thinkingBudget', 'urlContext'],
- searchImpl: 'params',
- searchProvider: 'google',
- },
- type: 'chat',
- },
- {
- abilities: {
- functionCall: true,
- reasoning: true,
- search: true,
- video: true,
- vision: true,
- },
- contextWindowTokens: 1_048_576 + 65_536,
- description:
- 'Gemini 2.5 Pro Preview is Google’s most advanced reasoning model, able to reason over code, math, and STEM problems and analyze large datasets, codebases, and documents with long context.',
- displayName: 'Gemini 2.5 Pro Preview 05-06',
- id: 'gemini-2.5-pro-preview-05-06',
- maxOutput: 65_536,
- pricing: {
- units: [
- {
- name: 'textInput_cacheRead',
- strategy: 'tiered',
- tiers: [
- { rate: 0.31, upTo: 200_000 },
- { rate: 0.625, upTo: 'infinity' },
- ],
- unit: 'millionTokens',
- },
- {
- name: 'textInput',
- strategy: 'tiered',
- tiers: [
- { rate: 1.25, upTo: 200_000 },
- { rate: 2.5, upTo: 'infinity' },
- ],
- unit: 'millionTokens',
- },
- {
- name: 'textOutput',
- strategy: 'tiered',
- tiers: [
- { rate: 10, upTo: 200_000 },
- { rate: 15, upTo: 'infinity' },
- ],
- unit: 'millionTokens',
- },
- ],
- },
- releasedAt: '2025-05-06',
- settings: {
- searchImpl: 'params',
- searchProvider: 'google',
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -630,25 +525,6 @@ const googleChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- imageOutput: true,
- vision: true,
- },
- contextWindowTokens: 1_048_576 + 8192,
- description: 'Gemini 2.0 Flash experimental model with image generation support.',
- displayName: 'Gemini 2.0 Flash (Image Generation) Experimental',
- id: 'gemini-2.0-flash-exp-image-generation',
- maxOutput: 8192,
- pricing: {
- units: [
- { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- releasedAt: '2025-03-14',
- type: 'chat',
- },
{
abilities: {
vision: true,
diff --git a/packages/model-bank/src/aiModels/groq.ts b/packages/model-bank/src/aiModels/groq.ts
index 0cee605b639..84de6facb30 100644
--- a/packages/model-bank/src/aiModels/groq.ts
+++ b/packages/model-bank/src/aiModels/groq.ts
@@ -148,19 +148,6 @@ const groqChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- contextWindowTokens: 131_072,
- displayName: 'Llama Guard 4 12B',
- id: 'meta-llama/llama-guard-4-12b',
- maxOutput: 1024,
- pricing: {
- units: [
- { name: 'textInput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
contextWindowTokens: 512,
displayName: 'Llama Prompt Guard 2 22M',
diff --git a/packages/model-bank/src/aiModels/infiniai.ts b/packages/model-bank/src/aiModels/infiniai.ts
index 7cdd170b354..42708288311 100644
--- a/packages/model-bank/src/aiModels/infiniai.ts
+++ b/packages/model-bank/src/aiModels/infiniai.ts
@@ -24,6 +24,48 @@ const infiniaiChatModels: AIChatModelCard[] = [
releasedAt: '2026-03-17',
type: 'chat',
},
+ {
+ abilities: {
+ functionCall: true,
+ },
+ contextWindowTokens: 131_072,
+ description:
+ 'DeepSeek-V3.2 is a model that balances high computational efficiency with excellent reasoning and agent performance.',
+ displayName: 'DeepSeek V3.2',
+ id: 'deepseek-v3.2',
+ maxOutput: 8192,
+ pricing: {
+ currency: 'CNY',
+ units: [
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ releasedAt: '2025-12-02',
+ type: 'chat',
+ },
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ },
+ contextWindowTokens: 131_072,
+ description:
+ 'DeepSeek-V3.2 Thinking is the thinking mode variant of DeepSeek-V3.2, focused on reasoning tasks.',
+ displayName: 'DeepSeek V3.2 Thinking',
+ enabled: true,
+ id: 'deepseek-v3.2-thinking',
+ maxOutput: 65_536,
+ pricing: {
+ currency: 'CNY',
+ units: [
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ releasedAt: '2025-12-02',
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
diff --git a/packages/model-bank/src/aiModels/mistral.ts b/packages/model-bank/src/aiModels/mistral.ts
index 82ea97687dc..d85bc527555 100644
--- a/packages/model-bank/src/aiModels/mistral.ts
+++ b/packages/model-bank/src/aiModels/mistral.ts
@@ -27,7 +27,8 @@ const mistralChatModels: AIChatModelCard[] = [
functionCall: true,
},
contextWindowTokens: 262_144,
- description: 'Devstral Small 2 excels at using tools to explore code bases, edit multiple files, and power software engineering agents.',
+ description:
+ 'Devstral Small 2 excels at using tools to explore code bases, edit multiple files, and power software engineering agents.',
displayName: 'Devstral Small 2',
id: 'labs-devstral-small-2512',
pricing: {
@@ -48,7 +49,7 @@ const mistralChatModels: AIChatModelCard[] = [
'Mistral Medium 3.1 delivers state-of-the-art performance at 8Ɨ lower cost and simplifies enterprise deployment.',
displayName: 'Mistral Medium 3.1',
enabled: true,
- id: 'mistral-medium-latest',
+ id: 'mistral-medium-2508',
pricing: {
units: [
{ name: 'textInput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
@@ -66,8 +67,7 @@ const mistralChatModels: AIChatModelCard[] = [
description:
'Magistral Medium 1.2 is a frontier reasoning model from Mistral AI (Sep 2025) with vision support.',
displayName: 'Magistral Medium 1.2',
- enabled: true,
- id: 'magistral-medium-latest',
+ id: 'magistral-medium-2509',
pricing: {
units: [
{ name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
@@ -112,6 +112,26 @@ const mistralChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ vision: true,
+ },
+ contextWindowTokens: 256_000,
+ description:
+ "Mistral's powerful hybrid model unifying instruct, reasoning, and coding capabilities in a single model. 119B parameters with 6.5B active.",
+ displayName: 'Mistral Small 4',
+ id: 'mistral-small-2603',
+ pricing: {
+ units: [
+ { name: 'textInput', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ releasedAt: '2026-03-16',
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
@@ -120,7 +140,7 @@ const mistralChatModels: AIChatModelCard[] = [
description:
'Mistral Small is a cost-effective, fast, and reliable option for translation, summarization, and sentiment analysis.',
displayName: 'Mistral Small 3.2',
- id: 'mistral-small-latest',
+ id: 'mistral-small-2506',
pricing: {
units: [
{ name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
@@ -129,6 +149,26 @@ const mistralChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
+ {
+ abilities: {
+ functionCall: true,
+ vision: true,
+ },
+ contextWindowTokens: 256_000,
+ description:
+ 'Mistral Large 3, is a state-of-the-art, open-weight, general-purpose multimodal model with a granular Mixture-of-Experts architecture. It features 41B active parameters and 675B total parameters.',
+ displayName: 'Mistral Large 3',
+ enabled: true,
+ id: 'mistral-large-2512',
+ pricing: {
+ units: [
+ { name: 'textInput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ releasedAt: '2025-12-02',
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
@@ -138,7 +178,7 @@ const mistralChatModels: AIChatModelCard[] = [
description:
'Mistral Large is the flagship model, strong in multilingual tasks, complex reasoning, and code generation—ideal for high-end applications.',
displayName: 'Mistral Large 2.1',
- id: 'mistral-large-latest',
+ id: 'mistral-large-2411',
pricing: {
units: [
{ name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
@@ -247,6 +287,25 @@ const mistralChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
+ {
+ abilities: {
+ functionCall: true,
+ vision: true,
+ },
+ contextWindowTokens: 256_000,
+ description:
+ "Mistral's first open-source code agent designed for Lean 4, built for formal proof engineering in realistic repositories. 119B parameters with 6.5B active.",
+ displayName: 'Leanstral',
+ id: 'labs-leanstral-2603',
+ pricing: {
+ units: [
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ releasedAt: '2026-03-16',
+ type: 'chat',
+ },
];
export const allModels = [...mistralChatModels];
diff --git a/packages/model-bank/src/aiModels/ollamacloud.ts b/packages/model-bank/src/aiModels/ollamacloud.ts
index 84f4be95773..78d03c7a2e8 100644
--- a/packages/model-bank/src/aiModels/ollamacloud.ts
+++ b/packages/model-bank/src/aiModels/ollamacloud.ts
@@ -253,6 +253,58 @@ const ollamaCloudModels: AIChatModelCard[] = [
id: 'qwen3-vl:235b',
type: 'chat',
},
+ {
+ abilities: {
+ functionCall: true,
+ vision: true,
+ },
+ contextWindowTokens: 262_144,
+ description:
+ 'Ministral 3 3B is the smallest and most efficient model in the Ministral 3 series, offering strong language and vision capabilities in a compact package. Designed for edge deployment, it delivers high performance on various hardware including local setups.',
+ displayName: 'Ministral 3 3B',
+ id: 'ministral-3:3b',
+ releasedAt: '2025-12-02',
+ type: 'chat',
+ },
+ {
+ abilities: {
+ functionCall: true,
+ vision: true,
+ },
+ contextWindowTokens: 262_144,
+ description:
+ 'Ministral 3 8B is a powerful and efficient model in the Ministral 3 series, delivering top-tier text and vision capabilities. Built for edge deployment, it delivers high performance on various hardware including local setups.',
+ displayName: 'Ministral 3 8B',
+ id: 'ministral-3:8b',
+ releasedAt: '2025-12-02',
+ type: 'chat',
+ },
+ {
+ abilities: {
+ functionCall: true,
+ vision: true,
+ },
+ contextWindowTokens: 262_144,
+ description:
+ 'Ministral 3 14B is the largest model in the Ministral 3 series, delivering state-of-the-art performance comparable to the larger Mistral Small 3.2 24B counterpart. Optimized for local deployment, it delivers high performance on various hardware including local setups.',
+ displayName: 'Ministral 3 14B',
+ id: 'ministral-3:14b',
+ releasedAt: '2025-12-02',
+ type: 'chat',
+ },
+ {
+ abilities: {
+ functionCall: true,
+ vision: true,
+ },
+ contextWindowTokens: 262_144,
+ description:
+ 'Mistral Large 3 is a state-of-the-art open-weight general-purpose multimodal model with a refined Mixture of Experts architecture. It has 41B active parameters and 675B total parameters.',
+ displayName: 'Mistral Large 3',
+ id: 'mistral-large-3:675b',
+ releasedAt: '2025-12-02',
+ type: 'chat',
+ },
];
export const allModels = [...ollamaCloudModels];
diff --git a/packages/model-bank/src/aiModels/openrouter.ts b/packages/model-bank/src/aiModels/openrouter.ts
index abc1d251b32..053cfe35cb6 100644
--- a/packages/model-bank/src/aiModels/openrouter.ts
+++ b/packages/model-bank/src/aiModels/openrouter.ts
@@ -30,15 +30,68 @@ const openrouterChatModels: AIChatModelCard[] = [
releasedAt: '2025-08-21',
type: 'chat',
},
+ {
+ abilities: {
+ imageOutput: true,
+ reasoning: true,
+ vision: true,
+ },
+ contextWindowTokens: 65_536 + 65_536,
+ description:
+ 'Gemini 3.1 Flash Image Preview, a.k.a. "Nano Banana 2," is Google’s latest state of the art image generation and editing model, delivering Pro-level visual quality at Flash speed. It combines advanced contextual understanding with fast, cost-efficient inference, making complex image generation and iterative edits significantly more accessible.',
+ displayName: 'Nano Banana 2',
+ id: 'google/gemini-3.1-flash-image-preview',
+ maxOutput: 65_536,
+ pricing: {
+ approximatePricePerImage: 0.067,
+ units: [
+ { name: 'imageOutput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 0.25, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ releasedAt: '2026-02-26',
+ settings: {
+ extendParams: ['imageAspectRatio2', 'imageResolution2', 'thinkingLevel4'],
+ },
+ type: 'chat',
+ },
+ {
+ abilities: {
+ imageOutput: true,
+ reasoning: true,
+ vision: true,
+ },
+ contextWindowTokens: 131_072 + 32_768,
+ description:
+ 'Nano Banana Pro is Google’s most advanced image-generation and editing model, built on Gemini 3 Pro. It extends the original Nano Banana with significantly improved multimodal reasoning, real-world grounding, and high-fidelity visual synthesis. The model generates context-rich graphics, from infographics and diagrams to cinematic composites, and can incorporate real-time information via Search grounding.',
+ displayName: 'Nano Banana Pro',
+ id: 'google/gemini-3-pro-image-preview',
+ maxOutput: 32_768,
+ pricing: {
+ approximatePricePerImage: 0.134,
+ units: [
+ { name: 'imageOutput', rate: 120, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ releasedAt: '2025-11-20',
+ settings: {
+ extendParams: ['imageAspectRatio', 'imageResolution'],
+ },
+ type: 'chat',
+ },
{
abilities: {
imageOutput: true,
vision: true,
},
contextWindowTokens: 32_768 + 8192,
- description: 'Gemini 2.5 Flash experimental model with image generation support.',
+ description:
+ 'Gemini 2.5 Flash Image, a.k.a. "Nano Banana," is now generally available. It is a state of the art image generation model with contextual understanding. It is capable of image generation, edits, and multi-turn conversations.',
displayName: 'Nano Banana',
- id: 'google/gemini-2.5-flash-image-preview',
+ id: 'google/gemini-2.5-flash-image',
maxOutput: 8192,
pricing: {
approximatePricePerImage: 0.039,
@@ -48,7 +101,10 @@ const openrouterChatModels: AIChatModelCard[] = [
{ name: 'textOutput', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
],
},
- releasedAt: '2025-08-26',
+ releasedAt: '2025-10-07',
+ settings: {
+ extendParams: ['imageAspectRatio', 'imageResolution'],
+ },
type: 'chat',
},
{
diff --git a/packages/model-bank/src/aiModels/qwen.ts b/packages/model-bank/src/aiModels/qwen.ts
index d234d973d9d..2c8fa066f9a 100644
--- a/packages/model-bank/src/aiModels/qwen.ts
+++ b/packages/model-bank/src/aiModels/qwen.ts
@@ -33,12 +33,12 @@ const qwenChatModels: AIChatModelCard[] = [
reasoning: true,
search: true,
},
- contextWindowTokens: 204_800,
+ contextWindowTokens: 196_608,
description:
'MiniMax-M2.5 is a flagship open-source large model from MiniMax, focusing on solving complex real-world tasks. Its core strengths are multi-language programming capabilities and the ability to solve complex tasks as an Agent.',
displayName: 'MiniMax-M2.5',
id: 'MiniMax-M2.5',
- maxOutput: 131_072,
+ maxOutput: 32_768,
pricing: {
currency: 'CNY',
units: [
diff --git a/packages/model-bank/src/aiModels/volcengine.ts b/packages/model-bank/src/aiModels/volcengine.ts
index de8f14763be..db634a56a1b 100644
--- a/packages/model-bank/src/aiModels/volcengine.ts
+++ b/packages/model-bank/src/aiModels/volcengine.ts
@@ -511,6 +511,30 @@ const doubaoChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ },
+ config: {
+ deploymentName: 'kimi-k2-thinking-251104',
+ },
+ contextWindowTokens: 262_144,
+ description:
+ 'Kimi-K2 is a MoE architecture basic model launched by Moonshot AI with super strong code and agent capabilities. It has a total parameter of 1T and an activation parameter of 32B.In benchmark performance tests in major categories such as general knowledge reasoning, programming, mathematics, and agents, the performance of the K2 model exceeds that of other mainstream open source models.',
+ displayName: 'Kimi K2 Thinking',
+ id: 'kimi-k2-thinking',
+ maxOutput: 32_768,
+ pricing: {
+ currency: 'CNY',
+ units: [
+ { name: 'textInput_cacheRead', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 16, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
diff --git a/packages/model-bank/src/aiModels/zhipu.ts b/packages/model-bank/src/aiModels/zhipu.ts
index f408c2a9778..b865aa042f1 100644
--- a/packages/model-bank/src/aiModels/zhipu.ts
+++ b/packages/model-bank/src/aiModels/zhipu.ts
@@ -4,6 +4,66 @@ import { type AIChatModelCard, type AIImageModelCard } from '../types/aiModel';
// ref: https://docs.bigmodel.cn/cn/guide/start/model-overview
const zhipuChatModels: AIChatModelCard[] = [
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ search: true,
+ },
+ contextWindowTokens: 200_000,
+ description:
+ 'GLM-5-Turbo is a foundation model deeply optimized for agentic scenarios. It has been specifically optimized for core requirements of agent tasks from the training phase, enhancing key capabilities such as tool invocation, command following, and long-chain execution. It is ideal for building high-performance agent assistants.',
+ displayName: 'GLM-5-Turbo',
+ id: 'glm-5-turbo',
+ maxOutput: 131_072,
+ pricing: {
+ currency: 'CNY',
+ units: [
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 1.2,
+ '[0.032, infinity]': 1.8,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textInput_cacheRead',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 5,
+ '[0.032, infinity]': 7,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textInput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 22,
+ '[0.032, infinity]': 26,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textOutput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ ],
+ },
+ releasedAt: '2026-03-15',
+ settings: {
+ extendParams: ['enableReasoning'],
+ searchImpl: 'params',
+ },
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
diff --git a/packages/model-runtime/src/providers/aihubmix/index.ts b/packages/model-runtime/src/providers/aihubmix/index.ts
index 90225b6e534..6e13a825891 100644
--- a/packages/model-runtime/src/providers/aihubmix/index.ts
+++ b/packages/model-runtime/src/providers/aihubmix/index.ts
@@ -13,7 +13,7 @@ export interface AiHubMixModelCard {
owned_by: string;
}
-const baseURL = 'https://aihubmix.com';
+const baseURL = 'https://api.aihubmix.com';
export const params: CreateRouterRuntimeOptions = {
debug: {
diff --git a/packages/model-runtime/src/providers/openrouter/index.test.ts b/packages/model-runtime/src/providers/openrouter/index.test.ts
index edb9850fb07..45a62d4eb89 100644
--- a/packages/model-runtime/src/providers/openrouter/index.test.ts
+++ b/packages/model-runtime/src/providers/openrouter/index.test.ts
@@ -347,6 +347,132 @@ describe('LobeOpenRouterAI - custom features', () => {
expect.anything(),
);
});
+
+ describe('image model handling', () => {
+ it('should add modalities for model with -image suffix', async () => {
+ await instance.chat({
+ messages: [{ content: 'Generate an image', role: 'user' }],
+ model: 'openai/dall-e-3-image',
+ });
+
+ expect(instance['client'].chat.completions.create).toHaveBeenCalledWith(
+ expect.objectContaining({
+ modalities: ['image', 'text'],
+ }),
+ expect.anything(),
+ );
+ });
+
+ it('should add modalities for model with flux in name', async () => {
+ await instance.chat({
+ messages: [{ content: 'Generate an image', role: 'user' }],
+ model: 'black-forest-labs/flux-pro',
+ });
+
+ expect(instance['client'].chat.completions.create).toHaveBeenCalledWith(
+ expect.objectContaining({
+ modalities: ['image', 'text'],
+ }),
+ expect.anything(),
+ );
+ });
+
+ it('should not add modalities for non-image model', async () => {
+ await instance.chat({
+ messages: [{ content: 'Hello', role: 'user' }],
+ model: 'openai/gpt-4',
+ });
+
+ expect(instance['client'].chat.completions.create).toHaveBeenCalledWith(
+ expect.not.objectContaining({
+ modalities: expect.anything(),
+ }),
+ expect.anything(),
+ );
+ });
+
+ it('should add image_config with aspect_ratio for image model', async () => {
+ await instance.chat({
+ messages: [{ content: 'Generate an image', role: 'user' }],
+ model: 'openai/dall-e-3-image',
+ imageAspectRatio: '16:9',
+ });
+
+ expect(instance['client'].chat.completions.create).toHaveBeenCalledWith(
+ expect.objectContaining({
+ modalities: ['image', 'text'],
+ image_config: { aspect_ratio: '16:9' },
+ }),
+ expect.anything(),
+ );
+ });
+
+ it('should add image_config with image_size for image model', async () => {
+ await instance.chat({
+ messages: [{ content: 'Generate an image', role: 'user' }],
+ model: 'openai/dall-e-3-image',
+ imageResolution: '4K',
+ } as any);
+
+ expect(instance['client'].chat.completions.create).toHaveBeenCalledWith(
+ expect.objectContaining({
+ modalities: ['image', 'text'],
+ image_config: { image_size: '4K' },
+ }),
+ expect.anything(),
+ );
+ });
+
+ it('should map 512px to 0.5K in image_config.image_size', async () => {
+ await instance.chat({
+ messages: [{ content: 'Generate an image', role: 'user' }],
+ model: 'openai/dall-e-3-image',
+ imageResolution: '512px',
+ } as any);
+
+ expect(instance['client'].chat.completions.create).toHaveBeenCalledWith(
+ expect.objectContaining({
+ modalities: ['image', 'text'],
+ image_config: { image_size: '0.5K' },
+ }),
+ expect.anything(),
+ );
+ });
+
+ it('should combine aspect_ratio and image_size in image_config', async () => {
+ await instance.chat({
+ messages: [{ content: 'Generate an image', role: 'user' }],
+ model: 'openai/dall-e-3-image',
+ imageAspectRatio: '16:9',
+ imageResolution: '2K',
+ } as any);
+
+ expect(instance['client'].chat.completions.create).toHaveBeenCalledWith(
+ expect.objectContaining({
+ modalities: ['image', 'text'],
+ image_config: { aspect_ratio: '16:9', image_size: '2K' },
+ }),
+ expect.anything(),
+ );
+ });
+
+ it('should omit aspect_ratio when imageAspectRatio is auto', async () => {
+ await instance.chat({
+ messages: [{ content: 'Generate an image', role: 'user' }],
+ model: 'openai/dall-e-3-image',
+ imageAspectRatio: 'auto',
+ imageResolution: '2K',
+ } as any);
+
+ expect(instance['client'].chat.completions.create).toHaveBeenCalledWith(
+ expect.objectContaining({
+ modalities: ['image', 'text'],
+ image_config: { image_size: '2K' },
+ }),
+ expect.anything(),
+ );
+ });
+ });
});
describe('models mapping', () => {
diff --git a/packages/model-runtime/src/providers/openrouter/index.ts b/packages/model-runtime/src/providers/openrouter/index.ts
index b2fa4378266..eea5cbb34a9 100644
--- a/packages/model-runtime/src/providers/openrouter/index.ts
+++ b/packages/model-runtime/src/providers/openrouter/index.ts
@@ -14,7 +14,16 @@ export const params = {
baseURL: 'https://openrouter.ai/api/v1',
chatCompletion: {
handlePayload: (payload) => {
- const { reasoning_effort, thinking, reasoning: _reasoning, thinkingLevel, ...rest } = payload;
+ const {
+ reasoning_effort,
+ thinking,
+ reasoning: _reasoning,
+ thinkingLevel,
+ imageAspectRatio,
+ imageResolution,
+ model,
+ ...rest
+ } = payload;
let reasoning: OpenRouterReasoning | undefined;
@@ -37,8 +46,35 @@ export const params = {
}
}
+ // Add modalities and image_config for image generation models
+ const isImageModel = model.includes('-image') || model.includes('flux');
+ const modalities =
+ (payload as any).modalities ?? (isImageModel ? ['image', 'text'] : undefined);
+
+ // Map imageResolution to image_size: '512px' → '0.5K', others pass through
+ const imageSizeValue = imageResolution
+ ? imageResolution === '512px'
+ ? '0.5K'
+ : imageResolution
+ : undefined;
+
+ // 'auto' means use model default — omit the parameter
+ const aspectRatioValue =
+ imageAspectRatio && imageAspectRatio !== 'auto' ? imageAspectRatio : undefined;
+
+ const image_config =
+ (payload as any).image_config ??
+ (isImageModel && (aspectRatioValue || imageSizeValue)
+ ? {
+ ...(aspectRatioValue && { aspect_ratio: aspectRatioValue }),
+ ...(imageSizeValue && { image_size: imageSizeValue }),
+ }
+ : undefined);
+
return {
...rest,
+ ...(image_config && { image_config }),
+ ...(modalities && { modalities }),
model: payload.enabledSearch ? `${payload.model}:online` : payload.model,
...(reasoning && { reasoning }),
stream: payload.stream ?? true,
diff --git a/packages/model-runtime/src/types/chat.ts b/packages/model-runtime/src/types/chat.ts
index 6116ceff1f2..8328e67dabd 100644
--- a/packages/model-runtime/src/types/chat.ts
+++ b/packages/model-runtime/src/types/chat.ts
@@ -7,13 +7,13 @@ export type LLMRoleType = 'user' | 'system' | 'assistant' | 'function' | 'tool';
export type ChatResponseFormat =
| { type: 'json_object' }
| {
- json_schema: {
- name: string;
- schema: Record<string, any>;
- strict?: boolean;
- };
- type: 'json_schema';
+ json_schema: {
+ name: string;
+ schema: Record<string, any>;
+ strict?: boolean;
};
+ type: 'json_schema';
+ };
interface UserMessageContentPartThinking {
signature: string;
@@ -80,9 +80,9 @@ export interface ChatStreamPayload {
*/
imageAspectRatio?: string;
/**
- * @title Image resolution for image generation (e.g., '1K', '2K', '4K')
+ * @title Image resolution for image generation (e.g., '512px', '1K', '2K', '4K')
*/
- imageResolution?: '1K' | '2K' | '4K';
+ imageResolution?: '512px' | '1K' | '2K' | '4K';
logprobs?: boolean;
/**
* @title Maximum length of generated text
diff --git a/packages/model-runtime/src/utils/modelParse.ts b/packages/model-runtime/src/utils/modelParse.ts
index f00471a4ec5..ea4848f0eda 100644
--- a/packages/model-runtime/src/utils/modelParse.ts
+++ b/packages/model-runtime/src/utils/modelParse.ts
@@ -63,6 +63,11 @@ export const MODEL_LIST_CONFIGS = {
reasoningKeywords: ['-m'],
visionKeywords: ['-vl', 'Text-01'],
},
+ mistral: {
+ functionCallKeywords: ['mistral', 'ministral', 'pixtral'],
+ reasoningKeywords: ['magistral'],
+ visionKeywords: ['magistral', 'pixtral', 'ministral', 'mistral'],
+ },
moonshot: {
functionCallKeywords: ['moonshot', 'kimi'],
reasoningKeywords: ['thinking', 'k2.5'],
@@ -147,6 +152,7 @@ export const MODEL_OWNER_DETECTION_CONFIG = {
llama: ['llama', 'llava'],
longcat: ['longcat'],
minimax: ['minimax'],
+ mistral: ['mistral', 'ministral', 'magistral', 'pixtral'],
moonshot: ['moonshot', 'kimi'],
openai: ['o1', 'o3', 'o4', 'gpt-'],
qwen: ['qwen', 'qwq', 'qvq'],