From 3f18ec93cd72bc5c269c7f99a80d54e4b7365665 Mon Sep 17 00:00:00 2001 From: Bohdan Podvirnyi Date: Fri, 20 Feb 2026 14:02:21 +0200 Subject: [PATCH] Add GPT-5.3 Codex pricing --- .../Vendored/CostUsage/CostUsagePricing.swift | 8 ++++++++ Tests/CodexBarTests/CostUsagePricingTests.swift | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing.swift b/Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing.swift index 0e6557a6..ffc7b1b9 100644 --- a/Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing.swift +++ b/Sources/CodexBarCore/Vendored/CostUsage/CostUsagePricing.swift @@ -41,6 +41,14 @@ enum CostUsagePricing { inputCostPerToken: 1.75e-6, outputCostPerToken: 1.4e-5, cacheReadInputCostPerToken: 1.75e-7), + "gpt-5.3": CodexPricing( + inputCostPerToken: 1.75e-6, + outputCostPerToken: 1.4e-5, + cacheReadInputCostPerToken: 1.75e-7), + "gpt-5.3-codex": CodexPricing( + inputCostPerToken: 1.75e-6, + outputCostPerToken: 1.4e-5, + cacheReadInputCostPerToken: 1.75e-7), ] private static let claude: [String: ClaudePricing] = [ diff --git a/Tests/CodexBarTests/CostUsagePricingTests.swift b/Tests/CodexBarTests/CostUsagePricingTests.swift index edef3a88..f70e8d55 100644 --- a/Tests/CodexBarTests/CostUsagePricingTests.swift +++ b/Tests/CodexBarTests/CostUsagePricingTests.swift @@ -8,6 +8,7 @@ struct CostUsagePricingTests { #expect(CostUsagePricing.normalizeCodexModel("openai/gpt-5-codex") == "gpt-5") #expect(CostUsagePricing.normalizeCodexModel("gpt-5.2-codex") == "gpt-5.2") #expect(CostUsagePricing.normalizeCodexModel("gpt-5.1-codex-max") == "gpt-5.1") + #expect(CostUsagePricing.normalizeCodexModel("gpt-5.3-codex-max") == "gpt-5.3") } @Test @@ -20,6 +21,16 @@ struct CostUsagePricingTests { #expect(cost != nil) } + @Test + func codexCostSupportsGpt53CodexMax() { + let cost = CostUsagePricing.codexCostUSD( + model: "gpt-5.3-codex-max", + inputTokens: 100, + cachedInputTokens: 10, + outputTokens: 5) + #expect(cost != nil) + } + @Test func normalizesClaudeOpus41DatedVariants() { #expect(CostUsagePricing.normalizeClaudeModel("claude-opus-4-1-20250805") == "claude-opus-4-1")