Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/common/constants/knownModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ const MODEL_DEFINITIONS = {
tokenizerOverride: "openai/gpt-5",
},
// GPT-5.6 Terra - balanced everyday tier, released July 9, 2026.
// GPT-5.5-class quality at half the cost: $2.50/M input, $15/M output; 1.05M context.
// GPT-5.5-class quality at a fraction of the cost: $2/M input, $12/M output; 1.05M context.
GPT_56_TERRA: {
provider: "openai",
providerModelId: "gpt-5.6-terra",
aliases: ["terra"],
tokenizerOverride: "openai/gpt-5",
},
// GPT-5.6 Luna - fastest, most cost-efficient tier, released July 9, 2026.
// $1/M input, $6/M output; 1.05M context (GA model page; 400K was a stale launch value).
// $0.20/M input, $1.20/M output; 1.05M context (GA model page; 400K was a stale launch value).
GPT_56_LUNA: {
provider: "openai",
providerModelId: "gpt-5.6-luna",
Expand Down
13 changes: 7 additions & 6 deletions src/common/utils/tokens/displayUsage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,13 @@ describe("createDisplayUsage", () => {
expect(result!.input.tokens).toBe(500);
expect(result!.cached.tokens).toBe(100000);
expect(result!.cacheCreate.tokens).toBe(5000);
// Luna base rates: $1/M input, $0.10/M cache read (0.1x), $1.25/M cache
// write (1.25x), $6/M output.
expect(result!.input.cost_usd).toBeCloseTo(0.0005);
expect(result!.cached.cost_usd).toBeCloseTo(0.01);
expect(result!.cacheCreate.cost_usd).toBeCloseTo(0.00625);
expect(result!.output.cost_usd).toBeCloseTo(0.006);
// Luna base rates: $0.20/M input, $0.02/M cache read (0.1x), $0.25/M cache
// write (1.25x), $1.20/M output. These land near 1e-3, so the default
// toBeCloseTo precision of 2 would accept any of them; pin it explicitly.
expect(result!.input.cost_usd).toBeCloseTo(0.0001, 10);
expect(result!.cached.cost_usd).toBeCloseTo(0.002, 10);
expect(result!.cacheCreate.cost_usd).toBeCloseTo(0.00125, 10);
expect(result!.output.cost_usd).toBeCloseTo(0.0012, 10);
});

describe("tiered long-context pricing", () => {
Expand Down
4 changes: 2 additions & 2 deletions src/common/utils/tokens/modelStats.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ describe("getModelStats", () => {
test.each([
// [model, input, output, cacheRead, cacheCreation]
["openai:gpt-5.6-sol", 0.000005, 0.00003, 0.0000005, 0.00000625],
["openai:gpt-5.6-terra", 0.0000025, 0.000015, 0.00000025, 0.000003125],
["openai:gpt-5.6-luna", 0.000001, 0.000006, 0.0000001, 0.00000125],
["openai:gpt-5.6-terra", 0.000002, 0.000012, 0.0000002, 0.0000025],
["openai:gpt-5.6-luna", 0.0000002, 0.0000012, 0.00000002, 0.00000025],
] as const)(
"resolves %s with the GA pricing and limits",
(model, input, output, cacheRead, cacheCreation) => {
Expand Down
46 changes: 24 additions & 22 deletions src/common/utils/tokens/models-extra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,20 +300,21 @@ export const modelsExtra: Record<string, ModelData> = {

// GPT-5.6 Terra - Released July 9, 2026 (balanced everyday tier).
// GA docs: 1.05M context window, 128K max output, Feb 16 2026 cutoff (family).
// Base pricing: $2.50/M input, $15/M output, $0.25/M cached input; cache
// writes 1.25x the active input rate ($3.125/M base). Same 272K long-context
// tier as Sol (2x input / 1.5x output for the full request).
// Base pricing (OpenAI's July 30, 2026 price cut): $2/M input, $12/M output,
// $0.20/M cached input; cache writes 1.25x the active input rate ($2.50/M
// base). Same 272K long-context tier as Sol (2x input / 1.5x output for the
// full request).
"gpt-5.6-terra": {
max_input_tokens: 1050000,
max_output_tokens: 128000,
input_cost_per_token: 0.0000025, // $2.50 per million input tokens (<272K prompt tokens)
input_cost_per_token_above_200k_tokens: 0.000005, // $5 per million input tokens (>272K)
output_cost_per_token: 0.000015, // $15 per million output tokens (<272K prompt tokens)
output_cost_per_token_above_200k_tokens: 0.0000225, // $22.50 per million output tokens (>272K)
cache_read_input_token_cost: 0.00000025, // $0.25 per million cached input tokens (<272K)
cache_read_input_token_cost_above_200k_tokens: 0.0000005, // $0.50 per million cached input tokens (>272K)
cache_creation_input_token_cost: 0.000003125, // $3.125 per million tokens (1.25x input)
cache_creation_input_token_cost_above_200k_tokens: 0.00000625, // $6.25 per million tokens (1.25x long-context input)
input_cost_per_token: 0.000002, // $2 per million input tokens (<272K prompt tokens)
input_cost_per_token_above_200k_tokens: 0.000004, // $4 per million input tokens (>272K)
output_cost_per_token: 0.000012, // $12 per million output tokens (<272K prompt tokens)
output_cost_per_token_above_200k_tokens: 0.000018, // $18 per million output tokens (>272K)
cache_read_input_token_cost: 0.0000002, // $0.20 per million cached input tokens (<272K)
cache_read_input_token_cost_above_200k_tokens: 0.0000004, // $0.40 per million cached input tokens (>272K)
cache_creation_input_token_cost: 0.0000025, // $2.50 per million tokens (1.25x input)
cache_creation_input_token_cost_above_200k_tokens: 0.000005, // $5 per million tokens (1.25x long-context input)
tiered_pricing_threshold_tokens: 272000, // OpenAI's published boundary is 272K (field names say 200K)
litellm_provider: "openai",
mode: "chat",
Expand All @@ -327,20 +328,21 @@ export const modelsExtra: Record<string, ModelData> = {
// GPT-5.6 Luna - Released July 9, 2026 (fastest, most cost-efficient tier).
// GA model page: 1.05M context window (the 400K figure was a stale launch
// value that caused premature compaction), 128K max output, Feb 16 2026 cutoff.
// Base pricing: $1/M input, $6/M output, $0.10/M cached input; cache writes
// 1.25x the active input rate ($1.25/M base). Same 272K long-context tier as
// Sol (2x input / 1.5x output for the full request).
// Base pricing (OpenAI's July 30, 2026 price cut): $0.20/M input, $1.20/M
// output, $0.02/M cached input; cache writes 1.25x the active input rate
// ($0.25/M base). Same 272K long-context tier as Sol (2x input / 1.5x output
// for the full request).
"gpt-5.6-luna": {
max_input_tokens: 1050000,
max_output_tokens: 128000,
input_cost_per_token: 0.000001, // $1 per million input tokens (<272K prompt tokens)
input_cost_per_token_above_200k_tokens: 0.000002, // $2 per million input tokens (>272K)
output_cost_per_token: 0.000006, // $6 per million output tokens (<272K prompt tokens)
output_cost_per_token_above_200k_tokens: 0.000009, // $9 per million output tokens (>272K)
cache_read_input_token_cost: 0.0000001, // $0.10 per million cached input tokens (<272K)
cache_read_input_token_cost_above_200k_tokens: 0.0000002, // $0.20 per million cached input tokens (>272K)
cache_creation_input_token_cost: 0.00000125, // $1.25 per million tokens (1.25x input)
cache_creation_input_token_cost_above_200k_tokens: 0.0000025, // $2.50 per million tokens (1.25x long-context input)
input_cost_per_token: 0.0000002, // $0.20 per million input tokens (<272K prompt tokens)
input_cost_per_token_above_200k_tokens: 0.0000004, // $0.40 per million input tokens (>272K)
output_cost_per_token: 0.0000012, // $1.20 per million output tokens (<272K prompt tokens)
output_cost_per_token_above_200k_tokens: 0.0000018, // $1.80 per million output tokens (>272K)
cache_read_input_token_cost: 0.00000002, // $0.02 per million cached input tokens (<272K)
cache_read_input_token_cost_above_200k_tokens: 0.00000004, // $0.04 per million cached input tokens (>272K)
cache_creation_input_token_cost: 0.00000025, // $0.25 per million tokens (1.25x input)
cache_creation_input_token_cost_above_200k_tokens: 0.0000005, // $0.50 per million tokens (1.25x long-context input)
tiered_pricing_threshold_tokens: 272000, // OpenAI's published boundary is 272K (field names say 200K)
litellm_provider: "openai",
mode: "chat",
Expand Down
Loading