fix: model list
This commit is contained in:
parent
399699469b
commit
a300cd6465
1 changed files with 34 additions and 0 deletions
|
|
@ -263,6 +263,40 @@ export async function CodexAuthPlugin(input: PluginInput): Promise<Hooks> {
|
||||||
const auth = await getAuth()
|
const auth = await getAuth()
|
||||||
if (auth.type !== "oauth") return {}
|
if (auth.type !== "oauth") return {}
|
||||||
|
|
||||||
|
// Filter models to only allowed Codex models for OAuth
|
||||||
|
const allowedModels = new Set(["gpt-5.1-codex-max", "gpt-5.1-codex-mini", "gpt-5.2", "gpt-5.2-codex"])
|
||||||
|
for (const modelId of Object.keys(provider.models)) {
|
||||||
|
if (!allowedModels.has(modelId)) {
|
||||||
|
delete provider.models[modelId]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!provider.models["gpt-5.2-codex"]) {
|
||||||
|
provider.models["gpt-5.2-codex"] = {
|
||||||
|
id: "gpt-5.2-codex",
|
||||||
|
providerID: "openai",
|
||||||
|
api: {
|
||||||
|
id: "gpt-5.2-codex",
|
||||||
|
url: "https://chatgpt.com/backend-api/codex",
|
||||||
|
npm: "@ai-sdk/openai",
|
||||||
|
},
|
||||||
|
name: "GPT-5.2 Codex",
|
||||||
|
capabilities: {
|
||||||
|
temperature: false,
|
||||||
|
reasoning: true,
|
||||||
|
attachment: true,
|
||||||
|
toolcall: true,
|
||||||
|
input: { text: true, audio: false, image: true, video: false, pdf: false },
|
||||||
|
output: { text: true, audio: false, image: false, video: false, pdf: false },
|
||||||
|
},
|
||||||
|
cost: { input: 0, output: 0, cache: { read: 0, write: 0 } },
|
||||||
|
limit: { context: 400000, output: 128000 },
|
||||||
|
status: "active",
|
||||||
|
options: {},
|
||||||
|
headers: {},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Zero out costs for Codex (included with ChatGPT subscription)
|
// Zero out costs for Codex (included with ChatGPT subscription)
|
||||||
for (const model of Object.values(provider.models)) {
|
for (const model of Object.values(provider.models)) {
|
||||||
model.cost = {
|
model.cost = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue