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.

💄 style: Add GPT-5 pro model (#9594)

sxjeru775f30b6144f
diff --git a/packages/model-bank/src/aiModels/aihubmix.ts b/packages/model-bank/src/aiModels/aihubmix.ts
index dc7d5d5b464..8044bfee4b8 100644
--- a/packages/model-bank/src/aiModels/aihubmix.ts
+++ b/packages/model-bank/src/aiModels/aihubmix.ts
@@ -1,6 +1,31 @@
import { AIChatModelCard } from '../types/aiModel';
const aihubmixModels: AIChatModelCard[] = [
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ search: true,
+ vision: true,
+ },
+ contextWindowTokens: 400_000,
+ description: 'GPT-5 pro 使用更多计算来更深入地思考,并持续提供更好的答案。',
+ displayName: 'GPT-5 pro',
+ id: 'gpt-5-pro',
+ maxOutput: 272_000,
+ pricing: {
+ units: [
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 120, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ releasedAt: '2025-10-06',
+ settings: {
+ extendParams: ['textVerbosity'],
+ searchImpl: 'params',
+ },
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
diff --git a/packages/model-bank/src/aiModels/nvidia.ts b/packages/model-bank/src/aiModels/nvidia.ts
index 6f880874738..46070fe1dfc 100644
--- a/packages/model-bank/src/aiModels/nvidia.ts
+++ b/packages/model-bank/src/aiModels/nvidia.ts
@@ -9,8 +9,24 @@ const nvidiaChatModels: AIChatModelCard[] = [
contextWindowTokens: 131_072,
description:
'DeepSeek V3.1:下一代推理模型,提升了复杂推理与链路思考能力,适合需要深入分析的任务。',
- displayName: 'DeepSeek V3.1',
+ displayName: 'DeepSeek V3.1 Terminus',
enabled: true,
+ id: 'deepseek-ai/deepseek-v3.1-terminus',
+ maxOutput: 16_384,
+ settings: {
+ extendParams: ['enableReasoning'],
+ },
+ type: 'chat',
+ },
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ },
+ contextWindowTokens: 131_072,
+ description:
+ 'DeepSeek V3.1:下一代推理模型,提升了复杂推理与链路思考能力,适合需要深入分析的任务。',
+ displayName: 'DeepSeek V3.1',
id: 'deepseek-ai/deepseek-v3.1',
maxOutput: 16_384,
settings: {
diff --git a/packages/model-bank/src/aiModels/openai.ts b/packages/model-bank/src/aiModels/openai.ts
index f598baa9c80..854e2275048 100644
--- a/packages/model-bank/src/aiModels/openai.ts
+++ b/packages/model-bank/src/aiModels/openai.ts
@@ -18,6 +18,31 @@ export const gptImage1ParamsSchema: ModelParamsSchema = {
};
export const openaiChatModels: AIChatModelCard[] = [
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ search: true,
+ vision: true,
+ },
+ contextWindowTokens: 400_000,
+ description: 'GPT-5 pro 使用更多计算来更深入地思考,并持续提供更好的答案。',
+ displayName: 'GPT-5 pro',
+ id: 'gpt-5-pro',
+ maxOutput: 272_000,
+ pricing: {
+ units: [
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 120, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ releasedAt: '2025-10-06',
+ settings: {
+ extendParams: ['textVerbosity'],
+ searchImpl: 'params',
+ },
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
@@ -614,7 +639,7 @@ export const openaiChatModels: AIChatModelCard[] = [
contextWindowTokens: 128_000,
description: 'GPT-4o Audio Preview 模型,支持音频输入输出',
displayName: 'GPT-4o Audio Preview',
- id: 'gpt-4o-audio-preview', // deprecated on 2025-10-10
+ id: 'gpt-4o-audio-preview',
maxOutput: 16_384,
pricing: {
units: [
@@ -1046,9 +1071,63 @@ export const openaiImageModels: AIImageModelCard[] = [
{ name: 'imageInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
{ name: 'imageInput_cacheRead', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
{ name: 'imageOutput', rate: 40, strategy: 'fixed', unit: 'millionTokens' },
+ {
+ lookup: {
+ prices: {
+ 'low_1024x1024': 0.011,
+ 'low_1024x1536': 0.016,
+ 'low_1536x1024': 0.016,
+ 'medium_1024x1024': 0.042,
+ 'medium_1024x1536': 0.063,
+ 'medium_1536x1024': 0.063,
+ 'high_1024x1024': 0.167,
+ 'high_1024x1536': 0.25,
+ 'high_1536x1024': 0.25,
+ },
+ pricingParams: ['quality', 'size'],
+ },
+ name: 'imageGeneration',
+ strategy: 'lookup',
+ unit: 'image',
+ },
+ ],
+ },
+ resolutions: ['1024x1024', '1024x1536', '1536x1024'],
+ type: 'image',
+ },
+ {
+ description: '成本更低的 GPT Image 1 版本,原生支持文本与图像输入并生成图像输出。',
+ displayName: 'GPT Image 1 Mini',
+ enabled: true,
+ id: 'gpt-image-1-mini',
+ parameters: gptImage1ParamsSchema,
+ pricing: {
+ units: [
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput_cacheRead', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'imageInput', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'imageInput_cacheRead', rate: 0.25, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'imageOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
+ {
+ lookup: {
+ prices: {
+ 'low_1024x1024': 0.005,
+ 'low_1024x1536': 0.006,
+ 'low_1536x1024': 0.006,
+ 'medium_1024x1024': 0.011,
+ 'medium_1024x1536': 0.015,
+ 'medium_1536x1024': 0.015,
+ },
+ pricingParams: ['quality', 'size'],
+ },
+ name: 'imageGeneration',
+ strategy: 'lookup',
+ unit: 'image',
+ },
],
},
resolutions: ['1024x1024', '1024x1536', '1536x1024'],
+ releasedAt: '2025-10-06',
type: 'image',
},
{
diff --git a/packages/model-runtime/src/const/models.ts b/packages/model-runtime/src/const/models.ts
index 37419995563..a681fa8608a 100644
--- a/packages/model-runtime/src/const/models.ts
+++ b/packages/model-runtime/src/const/models.ts
@@ -36,6 +36,8 @@ export const responsesAPIModels = new Set([
'computer-use-preview',
'computer-use-preview-2025-03-11',
'gpt-5-codex',
+ 'gpt-5-pro',
+ 'gpt-5-pro-2025-10-06',
]);
/**
diff --git a/packages/model-runtime/src/providers/openai/index.ts b/packages/model-runtime/src/providers/openai/index.ts
index 8db424e2d4f..b0d03233d66 100644
--- a/packages/model-runtime/src/providers/openai/index.ts
+++ b/packages/model-runtime/src/providers/openai/index.ts
@@ -81,23 +81,27 @@ export const LobeOpenAI = createOpenAICompatibleRuntime({
const openaiTools = enabledSearch
? [
- ...(tools || []),
- {
- type: 'web_search',
- ...(oaiSearchContextSize && {
- search_context_size: oaiSearchContextSize,
- }),
- },
- ]
+ ...(tools || []),
+ {
+ type: 'web_search',
+ ...(oaiSearchContextSize && {
+ search_context_size: oaiSearchContextSize,
+ }),
+ },
+ ]
: tools;
if (prunePrefixes.some((prefix) => model.startsWith(prefix))) {
+ const reasoning = payload.reasoning
+ ? { ...payload.reasoning, summary: 'auto' }
+ : { summary: 'auto' };
+ if (model.startsWith('gpt-5-pro')) {
+ reasoning.effort = 'high';
+ }
return pruneReasoningPayload({
...rest,
model,
- reasoning: payload.reasoning
- ? { ...payload.reasoning, summary: 'auto' }
- : { summary: 'auto' },
+ reasoning,
...(enableServiceTierFlex && supportsFlexTier(model) && { service_tier: 'flex' }),
stream: payload.stream ?? true,
tools: openaiTools as any,
diff --git a/packages/model-runtime/src/providers/openrouter/index.ts b/packages/model-runtime/src/providers/openrouter/index.ts
index e2553a53453..e8695d5b7dc 100644
--- a/packages/model-runtime/src/providers/openrouter/index.ts
+++ b/packages/model-runtime/src/providers/openrouter/index.ts
@@ -4,8 +4,8 @@ import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactor
import { processMultiProviderModelList } from '../../utils/modelParse';
import { OpenRouterModelCard, OpenRouterReasoning } from './type';
-const formatPrice = (price: string) => {
- if (price === '-1') return undefined;
+const formatPrice = (price?: string) => {
+ if (price === undefined || price === '-1') return undefined;
return Number((Number(price) * 1e6).toPrecision(5));
};
@@ -81,6 +81,9 @@ export const LobeOpenRouterAI = createOpenAICompatibleRuntime({
const inputPrice = formatPrice(endpoint?.pricing?.prompt);
const outputPrice = formatPrice(endpoint?.pricing?.completion);
+ const cachedInputPrice = formatPrice(endpoint?.pricing?.input_cache_read);
+ const writeCacheInputPrice = formatPrice(endpoint?.pricing?.input_cache_write);
+
const isFree = (inputPrice === 0 || outputPrice === 0) && !displayName.endsWith('(free)');
if (isFree) {
displayName += ' (free)';
@@ -98,6 +101,8 @@ export const LobeOpenRouterAI = createOpenAICompatibleRuntime({
: undefined,
pricing: {
input: inputPrice,
+ cachedInput: cachedInputPrice,
+ writeCacheInput: writeCacheInputPrice,
output: outputPrice,
},
reasoning: endpoint?.supports_reasoning || false,
diff --git a/packages/model-runtime/src/providers/openrouter/type.ts b/packages/model-runtime/src/providers/openrouter/type.ts
index 91483541591..cd56b060aed 100644
--- a/packages/model-runtime/src/providers/openrouter/type.ts
+++ b/packages/model-runtime/src/providers/openrouter/type.ts
@@ -1,8 +1,10 @@
interface ModelPricing {
completion: string;
- image: string;
+ image?: string;
+ input_cache_read?: string;
+ input_cache_write?: string;
prompt: string;
- request: string;
+ request?: string;
}
export interface OpenRouterModelCard {
diff --git a/packages/model-runtime/src/providers/vercelaigateway/index.ts b/packages/model-runtime/src/providers/vercelaigateway/index.ts
index 149c8cb925f..57d990a8c0e 100644
--- a/packages/model-runtime/src/providers/vercelaigateway/index.ts
+++ b/packages/model-runtime/src/providers/vercelaigateway/index.ts
@@ -13,6 +13,8 @@ export interface VercelAIGatewayModelCard {
pricing?: {
input?: string | number;
output?: string | number;
+ input_cache_read?: string | number;
+ input_cache_write?: string | number;
};
tags?: string[];
type?: string;
@@ -68,6 +70,9 @@ export const LobeVercelAIGatewayAI = createOpenAICompatibleRuntime({
const inputPrice = formatPrice(m.pricing?.input);
const outputPrice = formatPrice(m.pricing?.output);
+ const cachedInputPrice = formatPrice(m.pricing?.input_cache_read);
+ const writeCacheInputPrice = formatPrice(m.pricing?.input_cache_write);
+
let displayName = m.name ?? m.id;
if (inputPrice === 0 && outputPrice === 0) {
displayName += ' (free)';
@@ -82,8 +87,10 @@ export const LobeVercelAIGatewayAI = createOpenAICompatibleRuntime({
id: m.id,
maxOutput: typeof m.max_tokens === 'number' ? m.max_tokens : undefined,
pricing: {
+ cachedInput: cachedInputPrice,
input: inputPrice,
output: outputPrice,
+ writeCacheInput: writeCacheInputPrice,
},
reasoning: tags.includes('reasoning') || false,
type: m.type === 'embedding' ? 'embedding' : 'chat',
diff --git a/packages/model-runtime/src/utils/modelParse.ts b/packages/model-runtime/src/utils/modelParse.ts
index 6f5247a8be5..1b9d18ac6d6 100644
--- a/packages/model-runtime/src/utils/modelParse.ts
+++ b/packages/model-runtime/src/utils/modelParse.ts
@@ -326,13 +326,25 @@ const processModelCard = (
return undefined;
}
- const formatPricing = (pricing?: { input?: number; output?: number; units?: any[] }) => {
+ const formatPricing = (pricing?: {
+ cachedInput?: number;
+ input?: number;
+ output?: number;
+ units?: any[];
+ writeCacheInput?: number;
+ }) => {
if (!pricing || typeof pricing !== 'object') return undefined;
if (Array.isArray(pricing.units)) {
return { units: pricing.units };
}
- const { input, output } = pricing;
- if (typeof input !== 'number' && typeof output !== 'number') return undefined;
+ const { input, output, cachedInput, writeCacheInput } = pricing;
+ if (
+ typeof input !== 'number' &&
+ typeof output !== 'number' &&
+ typeof cachedInput !== 'number' &&
+ typeof writeCacheInput !== 'number'
+ )
+ return undefined;
const units = [];
if (typeof input === 'number') {
@@ -351,6 +363,22 @@ const processModelCard = (
unit: 'millionTokens' as const,
});
}
+ if (typeof cachedInput === 'number') {
+ units.push({
+ name: 'textInput_cacheRead' as const,
+ rate: cachedInput,
+ strategy: 'fixed' as const,
+ unit: 'millionTokens' as const,
+ });
+ }
+ if (typeof writeCacheInput === 'number') {
+ units.push({
+ name: 'textInput_cacheWrite' as const,
+ rate: writeCacheInput,
+ strategy: 'fixed' as const,
+ unit: 'millionTokens' as const,
+ });
+ }
return { units };
};