From bd3cae17f4c095cd811120e3d521d86ea4b0e1b0 Mon Sep 17 00:00:00 2001 From: Ian Webster Date: Wed, 19 Aug 2026 20:41:51 -0700 Subject: [PATCH 1/2] fix: estimate costs for Daybreak Blue --- sdk/typescript/src/cost.ts | 6 +++++- sdk/typescript/tests-ts/api.test.ts | 9 +++++---- sdk/typescript/tests-ts/cost.test.ts | 4 +++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/sdk/typescript/src/cost.ts b/sdk/typescript/src/cost.ts index 764a1e759..b2142d758 100644 --- a/sdk/typescript/src/cost.ts +++ b/sdk/typescript/src/cost.ts @@ -866,9 +866,13 @@ export function estimateScanCost( usage: unknown, ): ScanCost | null { if (model === undefined) return null; - const pricingModel = model.startsWith("openai.") + let pricingModel = model.startsWith("openai.") ? model.slice("openai.".length) : model; + // https://developers.openai.com/api/docs/pricing#cyber-models + if (pricingModel === "gpt-daybreak-blue-latest") { + pricingModel = "gpt-5.6-sol"; + } const pricing = MODEL_PRICING_NANODOLLARS[pricingModel]; const normalized = tokenUsage(usage); if (pricing === undefined || normalized === null) return null; diff --git a/sdk/typescript/tests-ts/api.test.ts b/sdk/typescript/tests-ts/api.test.ts index ead5d09c2..2064b300d 100644 --- a/sdk/typescript/tests-ts/api.test.ts +++ b/sdk/typescript/tests-ts/api.test.ts @@ -3117,7 +3117,8 @@ describe("CodexSecurity orchestration", () => { } }); - test("uses selected profile pricing for live and persisted scan cost", async () => { + const pricedModels = ["gpt-5.6-terra", "gpt-daybreak-blue-latest"]; + test.each(pricedModels)("tracks live and saved %s costs", async (model) => { const root = await temporaryDirectory(); const repository = join(root, "repository"); const codexHome = join(root, "codex-home"); @@ -3133,7 +3134,7 @@ describe("CodexSecurity orchestration", () => { output_tokens: 3, reasoning_output_tokens: 1, }; - const expectedCost = estimateScanCost("gpt-5.6-terra", usage); + const expectedCost = estimateScanCost(model, usage); expect(expectedCost).not.toBeNull(); if (expectedCost === null) throw new Error("Missing selected-model price"); @@ -3147,7 +3148,7 @@ describe("CodexSecurity orchestration", () => { model_reasoning_effort: "low", profiles: { review: { - model: "gpt-5.6-terra", + model, model_reasoning_effort: "high", }, }, @@ -3190,7 +3191,7 @@ describe("CodexSecurity orchestration", () => { onCost: (cost) => costs.push({ ...cost }), }); - expect(result.turnResult.model).toBe("gpt-5.6-terra"); + expect(result.turnResult.model).toBe(model); expect(result.cost).toEqual(expectedCost); expect(costs).toEqual([expectedCost]); diff --git a/sdk/typescript/tests-ts/cost.test.ts b/sdk/typescript/tests-ts/cost.test.ts index ce3fa8f4a..497d63e97 100644 --- a/sdk/typescript/tests-ts/cost.test.ts +++ b/sdk/typescript/tests-ts/cost.test.ts @@ -184,6 +184,7 @@ describe("scan cost", () => { for (const [model, expectedUsd] of [ ["openai.gpt-5.6", 35], ["openai.gpt-5.6-sol", 35], + ["openai.gpt-daybreak-blue-latest", 35], ["openai.gpt-5.6-terra", 14], ["openai.gpt-5.6-luna", 1.4], ] as const) { @@ -196,8 +197,9 @@ describe("scan cost", () => { expect(estimateScanCost("openai.unknown-model", usage)).toBeNull(); }); - test("uses current Terra and Luna input, cache, and output rates", () => { + test("uses current input, cache, and output rates", () => { for (const [model, input, cached, write, output] of [ + ["gpt-daybreak-blue-latest", 5, 0.5, 6.25, 30], ["gpt-5.6-terra", 2, 0.2, 2.5, 12], ["gpt-5.6-luna", 0.2, 0.02, 0.25, 1.2], ] as const) { From 95b68a6d1c1fb22e5776a179a1012f83f07dbebf Mon Sep 17 00:00:00 2001 From: Ian Webster Date: Wed, 19 Aug 2026 21:40:45 -0700 Subject: [PATCH 2/2] fix: add separate Daybreak model prices --- sdk/typescript/src/cost.ts | 9 ++++----- sdk/typescript/tests-ts/api.test.ts | 6 +++++- sdk/typescript/tests-ts/cost.test.ts | 2 ++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/sdk/typescript/src/cost.ts b/sdk/typescript/src/cost.ts index b2142d758..dc2710511 100644 --- a/sdk/typescript/src/cost.ts +++ b/sdk/typescript/src/cost.ts @@ -95,6 +95,9 @@ const MODEL_PRICING_NANODOLLARS: Readonly> = { "gpt-5.6-sol": [5_000, 500, 6_250, 30_000], "gpt-5.6-terra": [2_000, 200, 2_500, 12_000], "gpt-5.6-luna": [200, 20, 250, 1_200], + // https://developers.openai.com/api/docs/pricing#cyber-models + "gpt-daybreak-blue-latest": [5_000, 500, 6_250, 30_000], + "gpt-daybreak-red-latest": [12_500, 1_250, 15_625, 75_000], }; const COST_POLL_INTERVAL_MS = 100; @@ -866,13 +869,9 @@ export function estimateScanCost( usage: unknown, ): ScanCost | null { if (model === undefined) return null; - let pricingModel = model.startsWith("openai.") + const pricingModel = model.startsWith("openai.") ? model.slice("openai.".length) : model; - // https://developers.openai.com/api/docs/pricing#cyber-models - if (pricingModel === "gpt-daybreak-blue-latest") { - pricingModel = "gpt-5.6-sol"; - } const pricing = MODEL_PRICING_NANODOLLARS[pricingModel]; const normalized = tokenUsage(usage); if (pricing === undefined || normalized === null) return null; diff --git a/sdk/typescript/tests-ts/api.test.ts b/sdk/typescript/tests-ts/api.test.ts index 2064b300d..0c547f889 100644 --- a/sdk/typescript/tests-ts/api.test.ts +++ b/sdk/typescript/tests-ts/api.test.ts @@ -3117,7 +3117,11 @@ describe("CodexSecurity orchestration", () => { } }); - const pricedModels = ["gpt-5.6-terra", "gpt-daybreak-blue-latest"]; + const pricedModels = [ + "gpt-5.6-terra", + "gpt-daybreak-blue-latest", + "gpt-daybreak-red-latest", + ]; test.each(pricedModels)("tracks live and saved %s costs", async (model) => { const root = await temporaryDirectory(); const repository = join(root, "repository"); diff --git a/sdk/typescript/tests-ts/cost.test.ts b/sdk/typescript/tests-ts/cost.test.ts index 497d63e97..ca006c27c 100644 --- a/sdk/typescript/tests-ts/cost.test.ts +++ b/sdk/typescript/tests-ts/cost.test.ts @@ -185,6 +185,7 @@ describe("scan cost", () => { ["openai.gpt-5.6", 35], ["openai.gpt-5.6-sol", 35], ["openai.gpt-daybreak-blue-latest", 35], + ["openai.gpt-daybreak-red-latest", 87.5], ["openai.gpt-5.6-terra", 14], ["openai.gpt-5.6-luna", 1.4], ] as const) { @@ -200,6 +201,7 @@ describe("scan cost", () => { test("uses current input, cache, and output rates", () => { for (const [model, input, cached, write, output] of [ ["gpt-daybreak-blue-latest", 5, 0.5, 6.25, 30], + ["gpt-daybreak-red-latest", 12.5, 1.25, 15.625, 75], ["gpt-5.6-terra", 2, 0.2, 2.5, 12], ["gpt-5.6-luna", 0.2, 0.02, 0.25, 1.2], ] as const) {