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
52 changes: 51 additions & 1 deletion packages/types/src/providers/openai-codex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,64 @@ import type { ModelInfo } from "../model.js"

export type OpenAiCodexModelId = keyof typeof openAiCodexModels

export const openAiCodexDefaultModelId: OpenAiCodexModelId = "gpt-5.3-codex"
export const openAiCodexDefaultModelId: OpenAiCodexModelId = "gpt-5.6-sol"

/**
* Models available through the Codex OAuth flow.
* These models are accessible to ChatGPT Plus/Pro subscribers.
* Costs are 0 as they are covered by the subscription.
*/
export const openAiCodexModels = {
"gpt-5.6-sol": {
maxTokens: 128000,
contextWindow: 372000,
includedTools: ["apply_patch"],
excludedTools: ["apply_diff", "write_to_file"],
supportsImages: true,
supportsPromptCache: true,
supportsReasoningEffort: ["none", "low", "medium", "high", "xhigh", "max"],
reasoningEffort: "medium",
// Subscription-based: no per-token costs
inputPrice: 0,
outputPrice: 0,
supportsVerbosity: true,
supportsTemperature: false,
description:
"GPT-5.6 Sol: OpenAI's flagship model for frontier reasoning, coding, and agentic workflows via ChatGPT subscription",
},
"gpt-5.6-terra": {
maxTokens: 128000,
contextWindow: 372000,
includedTools: ["apply_patch"],
excludedTools: ["apply_diff", "write_to_file"],
supportsImages: true,
supportsPromptCache: true,
supportsReasoningEffort: ["none", "low", "medium", "high", "xhigh", "max"],
reasoningEffort: "medium",
// Subscription-based: no per-token costs
inputPrice: 0,
outputPrice: 0,
supportsVerbosity: true,
supportsTemperature: false,
description:
"GPT-5.6 Terra: Balanced everyday model with GPT-5.5-competitive performance via ChatGPT subscription",
},
"gpt-5.6-luna": {
maxTokens: 128000,
contextWindow: 372000,
includedTools: ["apply_patch"],
excludedTools: ["apply_diff", "write_to_file"],
supportsImages: true,
supportsPromptCache: true,
supportsReasoningEffort: ["none", "low", "medium", "high", "xhigh", "max"],
reasoningEffort: "medium",
// Subscription-based: no per-token costs
inputPrice: 0,
outputPrice: 0,
supportsVerbosity: true,
supportsTemperature: false,
description: "GPT-5.6 Luna: The fastest, most affordable member of the GPT-5.6 family via ChatGPT subscription",
},
"gpt-5.1-codex-max": {
maxTokens: 128000,
contextWindow: 400000,
Expand Down
74 changes: 73 additions & 1 deletion packages/types/src/providers/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,81 @@ import type { ModelInfo } from "../model.js"
// https://openai.com/api/pricing/
export type OpenAiNativeModelId = keyof typeof openAiNativeModels

export const openAiNativeDefaultModelId: OpenAiNativeModelId = "gpt-5.1-codex-max"
export const openAiNativeDefaultModelId: OpenAiNativeModelId = "gpt-5.6-sol"

export const openAiNativeModels = {
"gpt-5.6-sol": {
maxTokens: 128000,
contextWindow: 1_050_000,
includedTools: ["apply_patch"],
excludedTools: ["apply_diff", "write_to_file"],
supportsImages: true,
supportsPromptCache: true,
supportsReasoningEffort: ["none", "low", "medium", "high", "xhigh", "max"],
reasoningEffort: "medium",
inputPrice: 5.0,
outputPrice: 30.0,
cacheWritesPrice: 6.25,
cacheReadsPrice: 0.5,
longContextPricing: {
thresholdTokens: 272_000,
inputPriceMultiplier: 2,
outputPriceMultiplier: 1.5,
appliesToServiceTiers: ["default", "flex"],
},
supportsVerbosity: true,
supportsTemperature: false,
tiers: [
{ name: "flex", contextWindow: 1_050_000, inputPrice: 2.5, outputPrice: 15.0, cacheReadsPrice: 0.25 },
{ name: "priority", contextWindow: 1_050_000, inputPrice: 12.5, outputPrice: 75.0, cacheReadsPrice: 1.25 },
],
description: "GPT-5.6 Sol: OpenAI's flagship model for frontier reasoning, coding, and agentic workflows",
},
"gpt-5.6-terra": {
maxTokens: 128000,
contextWindow: 1_050_000,
includedTools: ["apply_patch"],
excludedTools: ["apply_diff", "write_to_file"],
supportsImages: true,
supportsPromptCache: true,
supportsReasoningEffort: ["none", "low", "medium", "high", "xhigh", "max"],
reasoningEffort: "medium",
inputPrice: 2.5,
outputPrice: 15.0,
cacheWritesPrice: 3.125,
cacheReadsPrice: 0.25,
longContextPricing: {
thresholdTokens: 272_000,
inputPriceMultiplier: 2,
outputPriceMultiplier: 1.5,
appliesToServiceTiers: ["default", "flex"],
},
supportsVerbosity: true,
supportsTemperature: false,
tiers: [
{ name: "flex", contextWindow: 1_050_000, inputPrice: 1.25, outputPrice: 7.5, cacheReadsPrice: 0.125 },
{ name: "priority", contextWindow: 1_050_000, inputPrice: 6.25, outputPrice: 37.5, cacheReadsPrice: 0.625 },
],
description: "GPT-5.6 Terra: Balanced everyday model with GPT-5.5-competitive performance at 2x lower cost",
},
"gpt-5.6-luna": {
maxTokens: 128000,
contextWindow: 400000,
includedTools: ["apply_patch"],
excludedTools: ["apply_diff", "write_to_file"],
supportsImages: true,
supportsPromptCache: true,
supportsReasoningEffort: ["none", "low", "medium", "high", "xhigh", "max"],
reasoningEffort: "medium",
inputPrice: 1.0,
outputPrice: 6.0,
cacheWritesPrice: 1.25,
cacheReadsPrice: 0.1,
supportsVerbosity: true,
supportsTemperature: false,
tiers: [{ name: "flex", contextWindow: 400000, inputPrice: 0.5, outputPrice: 3.0, cacheReadsPrice: 0.05 }],
description: "GPT-5.6 Luna: The fastest, most affordable member of the GPT-5.6 family",
},
"gpt-5.1-codex-max": {
maxTokens: 128000,
contextWindow: 400000,
Expand Down
2 changes: 1 addition & 1 deletion src/api/providers/__tests__/openai-codex.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("OpenAiCodexHandler.getModel", () => {
const handler = new OpenAiCodexHandler({ apiModelId: "not-a-real-model" })
const model = handler.getModel()

expect(model.id).toBe("gpt-5.3-codex")
expect(model.id).toBe("gpt-5.6-sol")
expect(model.info).toBeDefined()
})

Expand Down
2 changes: 1 addition & 1 deletion src/api/providers/__tests__/openai-native.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ describe("OpenAiNativeHandler", () => {
openAiNativeApiKey: "test-api-key",
})
const modelInfo = handlerWithoutModel.getModel()
expect(modelInfo.id).toBe("gpt-5.1-codex-max") // Default model
expect(modelInfo.id).toBe("gpt-5.6-sol") // Default model
expect(modelInfo.info).toBeDefined()
})
})
Expand Down
Loading