Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions apps/web/src/lib/ai/core/ai-providers-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export const AI_PROVIDERS = {
'anthropic/claude-3-haiku': 'Claude 3 Haiku',

// OpenAI Models (2025)
'openai/gpt-5.2': 'GPT-5.2',
'openai/gpt-5.2-codex': 'GPT-5.2 Codex',
'openai/gpt-5.2-mini': 'GPT-5.2 Mini',
Comment thread
coderabbitai[bot] marked this conversation as resolved.
'openai/gpt-5.2-nano': 'GPT-5.2 Nano',
'openai/gpt-5.1': 'GPT-5.1',
'openai/gpt-5.1-codex': 'GPT-5.1 Codex',
'openai/gpt-5.1-codex-mini': 'GPT-5.1 Codex Mini',
Expand Down Expand Up @@ -160,6 +164,12 @@ export const AI_PROVIDERS = {
openai: {
name: 'OpenAI',
models: {
// GPT-5.2 Models (2025)
'gpt-5.2': 'GPT-5.2',
'gpt-5.2-codex': 'GPT-5.2 Codex',
'gpt-5.2-mini': 'GPT-5.2 Mini',
'gpt-5.2-nano': 'GPT-5.2 Nano',

// GPT-5.1 Models (2025)
'gpt-5.1': 'GPT-5.1',
'gpt-5.1-codex': 'GPT-5.1 Codex',
Expand Down
17 changes: 17 additions & 0 deletions apps/web/src/lib/ai/core/model-capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ const capabilityLogger = loggers.ai.child({ module: 'model-capabilities' });
* Includes models that can process images, PDFs with images, etc.
*/
const VISION_CAPABLE_MODELS: Record<string, boolean> = {
// OpenAI GPT-5.2 Models (all have vision)
'gpt-5.2': true,
'gpt-5.2-codex': true,
'gpt-5.2-mini': true,
'gpt-5.2-nano': true,
'openai/gpt-5.2': true,
'openai/gpt-5.2-codex': true,
'openai/gpt-5.2-mini': true,
'openai/gpt-5.2-nano': true,

// OpenAI GPT-5.1 Models (all have vision)
'gpt-5.1': true,
'gpt-5.1-codex': true,
'openai/gpt-5.1': true,
'openai/gpt-5.1-codex': true,
'openai/gpt-5.1-codex-mini': true,

// OpenAI GPT-5 Models (all have vision)
'gpt-5': true,
'gpt-5-mini': true,
Expand Down
12 changes: 12 additions & 0 deletions packages/lib/src/monitoring/ai-context-calculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ export function getContextWindowSize(model: string, provider?: string): number {

// OpenAI models
if (providerLower === 'openai' || modelLower.includes('gpt')) {
// GPT-5.2 models (400k/256k context)
if (modelLower.includes('gpt-5.2')) {
if (modelLower.includes('mini') || modelLower.includes('nano')) {
return 256_000;
}
return 400_000;
}
// GPT-5.1 models (400k context)
if (modelLower.includes('gpt-5.1')) {
return 400_000;
}
// GPT-5.0 models (272k/128k context)
if (modelLower.includes('gpt-5')) {
if (modelLower.includes('mini') || modelLower.includes('nano')) {
return 128_000;
Expand Down
18 changes: 17 additions & 1 deletion packages/lib/src/monitoring/ai-monitoring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export const AI_PRICING = {
'anthropic/claude-opus-4.1': { input: 15.00, output: 75.00 },

// OpenRouter Paid Models - OpenAI
'openai/gpt-5.2': { input: 1.75, output: 14.00 },
'openai/gpt-5.2-codex': { input: 1.75, output: 14.00 },
'openai/gpt-5.2-mini': { input: 0.35, output: 2.80 },
'openai/gpt-5.2-nano': { input: 0.07, output: 0.56 },
'openai/gpt-5.1': { input: 10.00, output: 40.00 },
'openai/gpt-5.1-codex': { input: 10.00, output: 40.00 },
'openai/gpt-5.1-codex-mini': { input: 5.00, output: 20.00 },
Expand Down Expand Up @@ -90,7 +94,11 @@ export const AI_PRICING = {
'gemini-1.5-flash-8b': { input: 0.0375, output: 0.15 },
'gemini-1.5-pro': { input: 1.25, output: 5.00 },

// OpenAI Direct Models (platform.openai.com/docs/pricing, Dec 2025)
// OpenAI Direct Models (platform.openai.com/docs/pricing, Jan 2026)
'gpt-5.2': { input: 1.75, output: 14.00 },
'gpt-5.2-codex': { input: 1.75, output: 14.00 },
'gpt-5.2-mini': { input: 0.35, output: 2.80 },
'gpt-5.2-nano': { input: 0.07, output: 0.56 },
'gpt-5.1': { input: 10.00, output: 40.00 },
'gpt-5.1-codex': { input: 10.00, output: 40.00 },
'gpt-5': { input: 1.25, output: 10.00 },
Expand Down Expand Up @@ -189,6 +197,10 @@ export const MODEL_CONTEXT_WINDOWS = {
'anthropic/claude-opus-4.1': 200000,

// OpenRouter Models - OpenAI
'openai/gpt-5.2': 400000,
'openai/gpt-5.2-codex': 400000,
'openai/gpt-5.2-mini': 256000,
'openai/gpt-5.2-nano': 256000,
'openai/gpt-5.1': 400000,
'openai/gpt-5.1-codex': 400000,
'openai/gpt-5.1-codex-mini': 400000,
Expand Down Expand Up @@ -262,6 +274,10 @@ export const MODEL_CONTEXT_WINDOWS = {
'gemini-1.5-pro': 2000000,

// OpenAI Direct Models
'gpt-5.2': 400000,
'gpt-5.2-codex': 400000,
'gpt-5.2-mini': 256000,
'gpt-5.2-nano': 256000,
'gpt-5.1': 400000,
'gpt-5.1-codex': 400000,
'gpt-5': 272000,
Expand Down