Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

Add GPT-5.6 model family

Louis Beaumont1825bfcb7ba0
diff --git a/apps/screenpipe-app-tauri/components/rewind/ai-presets-selector.tsx b/apps/screenpipe-app-tauri/components/rewind/ai-presets-selector.tsx
index bdeae93af..3cd46f14c 100644
--- a/apps/screenpipe-app-tauri/components/rewind/ai-presets-selector.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/ai-presets-selector.tsx
@@ -380,8 +380,9 @@ export function AIProviderConfig({
}
}
} catch { /* ignore */ }
- // Fallback: Codex models available via ChatGPT subscription
+ // Fallback: known models for ChatGPT connections when model discovery fails.
setOpenAIModels([
+ { id: "gpt-5.6-terra" }, { id: "gpt-5.6" }, { id: "gpt-5.6-sol" }, { id: "gpt-5.6-luna" },
{ id: "gpt-5.5" }, { id: "gpt-5.5-codex" },
{ id: "gpt-5.4" }, { id: "gpt-5.3-codex" },
{ id: "gpt-5.2-codex" }, { id: "gpt-5.2" }, { id: "gpt-5.1-codex-max" },
@@ -488,7 +489,7 @@ export function AIProviderConfig({
...formData,
provider: "openai-chatgpt",
url: "https://api.openai.com/v1",
- model: "gpt-5.5",
+ model: "gpt-5.6-terra",
});
}}
>
@@ -747,7 +748,7 @@ export function AIProviderConfig({
id="model"
type="text"
list="chatgpt-models"
- placeholder="gpt-5.5"
+ placeholder="gpt-5.6-terra"
value={formData.model || ""}
onChange={(e) =>
setFormData({ ...formData, model: e.target.value })
diff --git a/apps/screenpipe-app-tauri/lib/utils/chatgpt-preset.test.ts b/apps/screenpipe-app-tauri/lib/utils/chatgpt-preset.test.ts
index b32bfa37c..af9c9359b 100644
--- a/apps/screenpipe-app-tauri/lib/utils/chatgpt-preset.test.ts
+++ b/apps/screenpipe-app-tauri/lib/utils/chatgpt-preset.test.ts
@@ -6,11 +6,19 @@ import { describe, expect, it } from "vitest";
import { pickBestChatGptModel } from "./chatgpt-preset";
describe("pickBestChatGptModel", () => {
- it("skips ChatGPT Codex-only model ids that the account provider rejects", () => {
+ it("prefers the balanced GPT-5.6 Terra model when it is available", () => {
+ expect(pickBestChatGptModel(["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna"])).toBe("gpt-5.6-terra");
+ });
+
+ it("uses the GPT-5.6 alias when variants are unavailable", () => {
+ expect(pickBestChatGptModel(["gpt-5.5", "gpt-5.6"])).toBe("gpt-5.6");
+ });
+
+ it("skips ChatGPT Codex-only model ids that the account provider rejects", () => {
expect(pickBestChatGptModel(["gpt-5.5-codex", "gpt-5.4"])).toBe("gpt-5.4");
});
- it("falls back to a supported default when only unsupported Codex ids are listed", () => {
- expect(pickBestChatGptModel(["gpt-5.5-codex"])).toBe("gpt-5.5");
+ it("falls back to the default when only unsupported Codex ids are listed", () => {
+ expect(pickBestChatGptModel(["gpt-5.5-codex"])).toBe("gpt-5.6-terra");
});
});
diff --git a/apps/screenpipe-app-tauri/lib/utils/chatgpt-preset.ts b/apps/screenpipe-app-tauri/lib/utils/chatgpt-preset.ts
index 0b1c9d806..8e4a000bd 100644
--- a/apps/screenpipe-app-tauri/lib/utils/chatgpt-preset.ts
+++ b/apps/screenpipe-app-tauri/lib/utils/chatgpt-preset.ts
@@ -4,8 +4,21 @@
import { commands, type AIPreset } from "@/lib/utils/tauri";
-// preferred models in priority order (latest/best first)
-const PREFERRED_MODELS = ["gpt-5.5", "gpt-5.4", "gpt-4.1", "gpt-4.5", "gpt-4o", "gpt-4"];
+// Terra is the balanced default. Prefer it before the more expensive Sol when
+// both are available through the user's ChatGPT connection.
+const DEFAULT_CHATGPT_MODEL = "gpt-5.6-terra";
+const PREFERRED_MODELS = [
+ DEFAULT_CHATGPT_MODEL,
+ "gpt-5.6",
+ "gpt-5.6-sol",
+ "gpt-5.6-luna",
+ "gpt-5.5",
+ "gpt-5.4",
+ "gpt-4.1",
+ "gpt-4.5",
+ "gpt-4o",
+ "gpt-4",
+];
function isUnsupportedCodexModel(model: string): boolean {
return /-codex$/i.test(model);
@@ -19,7 +32,7 @@ export function pickBestChatGptModel(models: string[]): string {
}
// fallback: first model containing "gpt-4" or just the first model
return (
- supported.find((m) => m.includes("gpt-4")) || supported[0] || "gpt-5.5"
+ supported.find((m) => m.includes("gpt-4")) || supported[0] || DEFAULT_CHATGPT_MODEL
);
}
@@ -37,7 +50,7 @@ export async function ensureChatGptPreset(
if (hasChatGptPreset) return null;
// fetch available models
- let model = "gpt-5.5";
+ let model = DEFAULT_CHATGPT_MODEL;
try {
const res = await commands.chatgptOauthModels();
if (res.status === "ok" && res.data.length > 0) {
diff --git a/packages/ai-gateway/src/handlers/models.ts b/packages/ai-gateway/src/handlers/models.ts
index bf7d38b2d..37c97f1f8 100644
--- a/packages/ai-gateway/src/handlers/models.ts
+++ b/packages/ai-gateway/src/handlers/models.ts
@@ -284,6 +284,56 @@ const CURATED_MODELS: ModelEntry[] = [
warning: 'confidential chat/audio model, but current enclave vLLM does not support tool calls yet — avoid for skills or pipes that need tools',
},
// ── OpenAI API (shown only when OPENAI_API_KEY is configured) ──
+ {
+ id: 'gpt-5.6-sol',
+ object: 'model',
+ owned_by: 'openai',
+ name: 'GPT-5.6 Sol',
+ description: 'frontier GPT-5.6 model for the hardest reasoning, coding, and agentic work',
+ tags: ['premium', 'reasoning', 'coding', 'vision', 'new'],
+ free: false,
+ context_window: 1050000,
+ best_for: ['hard reasoning', 'agentic coding', 'complex analysis', 'vision'],
+ speed: 'slow',
+ intelligence: 'highest',
+ cost_tier: 'high',
+ recommended_for: ['chat', 'analysis', 'coding'],
+ warning: 'frontier-priced — reserve for high-value work; choose GPT-5.6 Terra or Luna when cost matters',
+ requires_env: 'OPENAI_API_KEY',
+ },
+ {
+ id: 'gpt-5.6-terra',
+ object: 'model',
+ owned_by: 'openai',
+ name: 'GPT-5.6 Terra',
+ description: 'balanced GPT-5.6 model for strong coding, reasoning, and everyday professional work',
+ tags: ['premium', 'reasoning', 'coding', 'vision', 'new'],
+ free: false,
+ context_window: 1050000,
+ best_for: ['professional work', 'coding', 'analysis', 'vision'],
+ speed: 'medium',
+ intelligence: 'highest',
+ cost_tier: 'medium',
+ recommended_for: ['chat', 'analysis', 'coding'],
+ warning: 'expensive for continuous high-volume pipes — use GPT-5.6 Luna for those workloads',
+ requires_env: 'OPENAI_API_KEY',
+ },
+ {
+ id: 'gpt-5.6-luna',
+ object: 'model',
+ owned_by: 'openai',
+ name: 'GPT-5.6 Luna',
+ description: 'cost-efficient GPT-5.6 model for high-volume extraction, classification, and pipe workloads',
+ tags: ['premium', 'fast', 'vision', 'new'],
+ free: false,
+ context_window: 1050000,
+ best_for: ['high-volume', 'extraction', 'classification', 'vision'],
+ speed: 'fast',
+ intelligence: 'high',
+ cost_tier: 'low',
+ recommended_for: ['pipes', 'chat', 'analysis'],
+ requires_env: 'OPENAI_API_KEY',
+ },
{
id: 'gpt-5.5',
object: 'model',
diff --git a/packages/ai-gateway/src/providers/openai.ts b/packages/ai-gateway/src/providers/openai.ts
index 7ea5ba1b0..6af031855 100644
--- a/packages/ai-gateway/src/providers/openai.ts
+++ b/packages/ai-gateway/src/providers/openai.ts
@@ -16,6 +16,15 @@ type OpenAIChatStream = AsyncIterable<ChatCompletionChunk> & {
controller: { abort: () => void };
};
+/**
+ * GPT-5.6 reports prompt-cache writes separately. Keep the gateway's
+ * OpenAI-compatible cache-creation field so the shared cost logger can apply
+ * the 1.25x write rate, while accepting either documented response shape.
+ */
+function getCacheWriteTokens(usage: any): number {
+ return usage?.cache_write_tokens ?? usage?.prompt_tokens_details?.cache_write_tokens ?? 0;
+}
+
/**
* OpenAI rejects tool_call ids longer than 40 chars. Other models mint longer
* ids that arrive in conversation history; remap any over-length id to a short
@@ -302,6 +311,7 @@ export class OpenAIProvider implements AIProvider {
prompt_tokens_details: {
cached_tokens: usage.prompt_tokens_details?.cached_tokens || 0,
},
+ cache_creation_input_tokens: getCacheWriteTokens(usage),
},
})}\n\n`
)
@@ -453,8 +463,8 @@ export class OpenAIProvider implements AIProvider {
},
],
// Pass usage through (was dropped — non-streaming OpenAI requests
- // were cost-logged with estimated token counts). cached_tokens =
- // OpenAI automatic prompt caching, billed at a discount.
+ // were cost-logged with estimated token counts). Cache writes are
+ // normalized to the gateway's cache-creation field for cost tracking.
...(response.usage
? {
usage: {
@@ -466,6 +476,7 @@ export class OpenAIProvider implements AIProvider {
prompt_tokens_details: {
cached_tokens: response.usage.prompt_tokens_details?.cached_tokens ?? 0,
},
+ cache_creation_input_tokens: getCacheWriteTokens(response.usage),
},
}
: {}),
diff --git a/packages/ai-gateway/src/services/cost-tracker.ts b/packages/ai-gateway/src/services/cost-tracker.ts
index b9d373f95..52a9c928e 100644
--- a/packages/ai-gateway/src/services/cost-tracker.ts
+++ b/packages/ai-gateway/src/services/cost-tracker.ts
@@ -21,13 +21,20 @@ interface ModelPricing {
// Anthropic prompt-caching multipliers (5-minute TTL writes — the only TTL we use)
const CLAUDE_CACHE = { cacheRead: 0.1, cacheWrite: 1.25 };
-// OpenAI bills cached input at 90% off across the gpt-5 family (no write charge)
+// GPT-5 through GPT-5.5 bill cached input at 90% off, with no write charge.
const GPT5_CACHE = { cacheRead: 0.1 };
+// GPT-5.6 also bills cache reads at 90% off, but cache writes cost 1.25x input.
+const GPT56_CACHE = { cacheRead: 0.1, cacheWrite: 1.25 };
// Gemini 2.5 implicit caching bills cached tokens at 25% of input price
const GEMINI25_CACHE = { cacheRead: 0.25 };
const MODEL_PRICING: Record<string, ModelPricing> = {
// OpenAI API
+ // GPT-5.6: Sol is the flagship/default, Terra is balanced, Luna is high-volume.
+ 'gpt-5.6': { input: 5.00, output: 30.00, ...GPT56_CACHE },
+ 'gpt-5.6-sol': { input: 5.00, output: 30.00, ...GPT56_CACHE },
+ 'gpt-5.6-terra': { input: 2.50, output: 15.00, ...GPT56_CACHE },
+ 'gpt-5.6-luna': { input: 1.00, output: 6.00, ...GPT56_CACHE },
'gpt-5.5-pro': { input: 30.00, output: 180.00, ...GPT5_CACHE },
'gpt-5.5': { input: 5.00, output: 30.00, ...GPT5_CACHE },
'gpt-5.4-pro': { input: 30.00, output: 180.00, ...GPT5_CACHE },
@@ -337,7 +344,7 @@ export function hasPricing(model: string | null | undefined): boolean {
}
// Output $/Mtok at/above which a model is "frontier" — too expensive for an
-// unattended high-volume pipe. Catches opus (25-75), fable-5 (50), gpt-5.5 (30),
+// unattended high-volume pipe. Catches opus (25-75), fable-5 (50), gpt-5.6 Sol (30), gpt-5.5 (30),
// gpt-*-pro (180); leaves sonnet (15), gpt-5.4 (15), haiku/flash/glm through.
const FRONTIER_OUTPUT_USD = 20;
/** Frontier/premium models that shouldn't run on background/pipe traffic. */
diff --git a/packages/ai-gateway/src/services/usage-tracker.ts b/packages/ai-gateway/src/services/usage-tracker.ts
index a7afa35eb..80a160528 100644
--- a/packages/ai-gateway/src/services/usage-tracker.ts
+++ b/packages/ai-gateway/src/services/usage-tracker.ts
@@ -124,6 +124,10 @@ const MODEL_WEIGHTS: Record<string, number> = {
// Auto — smart routing, free
'auto': 0,
// OpenAI API
+ 'gpt-5.6': 6,
+ 'gpt-5.6-sol': 6,
+ 'gpt-5.6-terra': 3,
+ 'gpt-5.6-luna': 1,
'gpt-5.5-pro': 36,
'gpt-5.5': 6,
'gpt-5.4-pro': 36,
diff --git a/packages/ai-gateway/src/test/cost-tracker.unit.test.ts b/packages/ai-gateway/src/test/cost-tracker.unit.test.ts
index 7a6caf8fe..428b0916d 100644
--- a/packages/ai-gateway/src/test/cost-tracker.unit.test.ts
+++ b/packages/ai-gateway/src/test/cost-tracker.unit.test.ts
@@ -68,6 +68,15 @@ describe('getModelCost — cache-aware pricing', () => {
expect(cost).toBeCloseTo(0.035, 10);
});
+ it('bills GPT-5.6 cache writes at 1.25x input price', () => {
+ // GPT-5.6 Terra: $2.50/M in. A 10k-token cache write costs $0.03125.
+ const cost = getModelCost('gpt-5.6-terra', 10_000, 0, {
+ cache_creation_tokens: 10_000,
+ });
+ expect(cost).toBeCloseTo(0.03125, 10);
+ expect(cost).toBeGreaterThan(getModelCost('gpt-5.6-terra', 10_000, 0));
+ });
+
it('bills gemini-2.5 cached input at 0.25x', () => {
// gemini-2.5-flash: $0.15/M in. 100k input, 80k cached:
// (20k + 80k*0.25) * $0.15/M = 40k * $0.15/M = 0.006
@@ -129,9 +138,9 @@ describe('getModelCost — cache-aware pricing', () => {
});
it('isFrontierModel flags the premium tier (blocked on pipes), not mid/cheap', () => {
- for (const m of ['claude-opus-4-8', 'claude-opus-4-6', 'claude-fable-5', 'gpt-5.5', 'gpt-5.5-pro', 'gpt-5.4-pro'])
+ for (const m of ['claude-opus-4-8', 'claude-opus-4-6', 'claude-fable-5', 'gpt-5.6-sol', 'gpt-5.5', 'gpt-5.5-pro', 'gpt-5.4-pro'])
expect(isFrontierModel(m)).toBe(true);
- for (const m of ['claude-sonnet-4-5', 'gpt-5.4', 'gpt-5.4-mini', 'claude-haiku-4-5', 'glm-5', 'gemini-3.5-flash', 'gpt-5-nano'])
+ for (const m of ['claude-sonnet-4-5', 'gpt-5.6-terra', 'gpt-5.6-luna', 'gpt-5.4', 'gpt-5.4-mini', 'claude-haiku-4-5', 'glm-5', 'gemini-3.5-flash', 'gpt-5-nano'])
expect(isFrontierModel(m)).toBe(false);
});
});
diff --git a/packages/ai-gateway/src/test/openai-models.unit.test.ts b/packages/ai-gateway/src/test/openai-models.unit.test.ts
index 771231d8d..8371c3976 100644
--- a/packages/ai-gateway/src/test/openai-models.unit.test.ts
+++ b/packages/ai-gateway/src/test/openai-models.unit.test.ts
@@ -43,6 +43,9 @@ describe('OpenAI API model catalog', () => {
it('advertises current OpenAI chat models when OPENAI_API_KEY is configured', async () => {
const ids = await listedModelIds();
+ expect(ids).toContain('gpt-5.6-sol');
+ expect(ids).toContain('gpt-5.6-terra');
+ expect(ids).toContain('gpt-5.6-luna');
expect(ids).toContain('gpt-5.5');
expect(ids).toContain('gpt-5.5-pro');
expect(ids).toContain('gpt-5.4');
@@ -55,6 +58,7 @@ describe('OpenAI API model catalog', () => {
it('hides OpenAI models until OPENAI_API_KEY is configured', async () => {
const ids = await listedModelIds({ OPENAI_API_KEY: '' });
+ expect(ids).not.toContain('gpt-5.6-terra');
expect(ids).not.toContain('gpt-5.5');
expect(ids).not.toContain('gpt-5.5-pro');
expect(ids).not.toContain('gpt-5.4');
@@ -137,7 +141,9 @@ describe('OpenAI API accounting and routing', () => {
it('routes GPT models through the direct OpenAI provider', () => {
const provider = createProvider('gpt-5.5', env());
expect(provider).toBeInstanceOf(OpenAIProvider);
+ expect(createProvider('gpt-5.6-terra', env())).toBeInstanceOf(OpenAIProvider);
expect(inferProvider('gpt-5.4-mini')).toBe('openai');
+ expect(inferProvider('gpt-5.6-luna')).toBe('openai');
expect(inferProvider('o4-mini')).toBe('openai');
});
@@ -152,6 +158,9 @@ describe('OpenAI API accounting and routing', () => {
});
it('uses exact OpenAI prices instead of the unknown-model fallback', () => {
+ expect(getModelCost('gpt-5.6-sol', null, null)).toBeCloseTo(0.025, 6);
+ expect(getModelCost('gpt-5.6-terra', null, null)).toBeCloseTo(0.0125, 6);
+ expect(getModelCost('gpt-5.6-luna', null, null)).toBeCloseTo(0.005, 6);
expect(getModelCost('gpt-5.5', null, null)).toBeCloseTo(0.025, 6);
expect(getModelCost('gpt-5.3-codex', null, null)).toBeCloseTo(0.0105, 6);
expect(getModelCost('gpt-5.4-nano', null, null)).toBeCloseTo(0.001025, 6);
@@ -173,6 +182,9 @@ describe('OpenAI API accounting and routing', () => {
});
it('assigns quota weights for expensive and cheap OpenAI models', () => {
+ expect(getModelWeight('gpt-5.6-sol')).toBe(6);
+ expect(getModelWeight('gpt-5.6-terra')).toBe(3);
+ expect(getModelWeight('gpt-5.6-luna')).toBe(1);
expect(getModelWeight('gpt-5.5-pro')).toBe(36);
expect(getModelWeight('gpt-5.5')).toBe(6);
expect(getModelWeight('gpt-5.4-pro')).toBe(36);
diff --git a/packages/ai-gateway/src/test/provider-usage.unit.test.ts b/packages/ai-gateway/src/test/provider-usage.unit.test.ts
index 851da3f49..18c877e2a 100644
--- a/packages/ai-gateway/src/test/provider-usage.unit.test.ts
+++ b/packages/ai-gateway/src/test/provider-usage.unit.test.ts
@@ -51,6 +51,7 @@ describe('OpenAIProvider usage reporting', () => {
completion_tokens: 50,
total_tokens: 5_050,
prompt_tokens_details: { cached_tokens: 4_000 },
+ cache_write_tokens: 200,
},
};
}
@@ -73,6 +74,7 @@ describe('OpenAIProvider usage reporting', () => {
expect(usageEvent.usage.prompt_tokens).toBe(5_000);
expect(usageEvent.usage.completion_tokens).toBe(50);
expect(usageEvent.usage.prompt_tokens_details.cached_tokens).toBe(4_000);
+ expect(usageEvent.usage.cache_creation_input_tokens).toBe(200);
expect(text.trim().endsWith('data: [DONE]')).toBe(true);
});
@@ -110,6 +112,7 @@ describe('OpenAIProvider usage reporting', () => {
completion_tokens: 30,
total_tokens: 1_230,
prompt_tokens_details: { cached_tokens: 1_024 },
+ cache_write_tokens: 176,
},
}));
const response = await provider.createCompletion(body);
@@ -118,6 +121,7 @@ describe('OpenAIProvider usage reporting', () => {
expect(json.usage.completion_tokens).toBe(30);
expect(json.usage.total_tokens).toBe(1_230);
expect(json.usage.prompt_tokens_details.cached_tokens).toBe(1_024);
+ expect(json.usage.cache_creation_input_tokens).toBe(176);
});
it('omits usage when upstream provides none (no fake zeros)', async () => {