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
3 changes: 3 additions & 0 deletions sdk/typescript/src/cost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ const MODEL_PRICING_NANODOLLARS: Readonly<Record<string, ModelPricing>> = {
"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;
Expand Down
13 changes: 9 additions & 4 deletions sdk/typescript/tests-ts/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3117,7 +3117,12 @@ 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",
"gpt-daybreak-red-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");
Expand All @@ -3133,7 +3138,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");

Expand All @@ -3147,7 +3152,7 @@ describe("CodexSecurity orchestration", () => {
model_reasoning_effort: "low",
profiles: {
review: {
model: "gpt-5.6-terra",
model,
model_reasoning_effort: "high",
},
},
Expand Down Expand Up @@ -3190,7 +3195,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]);

Expand Down
6 changes: 5 additions & 1 deletion sdk/typescript/tests-ts/cost.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ 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-daybreak-red-latest", 87.5],
["openai.gpt-5.6-terra", 14],
["openai.gpt-5.6-luna", 1.4],
] as const) {
Expand All @@ -196,8 +198,10 @@ 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-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) {
Expand Down
Loading