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
2 changes: 1 addition & 1 deletion packages/core/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export type Model = z.infer<typeof Model>;
export const Provider = z
.object({
id: z.string(),
env: z.array(z.string()).min(1, "Provider env cannot be empty"),
env: z.array(z.string()),
npm: z.string().min(1, "Provider npm module cannot be empty"),
api: z.string().optional(),
name: z.string().min(1, "Provider name cannot be empty"),
Expand Down
18 changes: 17 additions & 1 deletion packages/core/test/schema.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, test } from "bun:test";
import { z } from "zod";

import { AuthoredModel } from "../src/index.js";
import { AuthoredModel, Provider } from "../src/index.js";

type AuthoredModelData = z.infer<typeof AuthoredModel>;

Expand Down Expand Up @@ -31,6 +31,22 @@ describe("model schema", () => {
});
});

describe("provider schema", () => {
test("accepts OAuth-only providers without environment credentials", () => {
expect(
Provider.safeParse({
id: "openai-codex",
name: "OpenAI Codex",
env: [],
npm: "@ai-sdk/openai",
api: "https://chatgpt.com/backend-api/codex",
doc: "https://github.com/openai/codex",
models: {},
}).success,
).toBe(true);
});
});

function baseModel(overrides: Partial<AuthoredModelData>) {
return {
id: "example/model",
Expand Down
3 changes: 3 additions & 0 deletions providers/openai-codex/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions providers/openai-codex/models/gpt-5.5.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Codex exposes a 272K usable input window for GPT-5.5. The 400K total keeps
# the model's separate 128K output allowance explicit.
# https://github.com/anomalyco/models.dev/issues/3183
base_model = "openai/gpt-5.5"
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high", "xhigh"] }]

[limit]
context = 400_000
input = 272_000
output = 128_000

[experimental.modes.fast]
provider = { body = { service_tier = "priority" } }
14 changes: 14 additions & 0 deletions providers/openai-codex/models/gpt-5.6-luna.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# OpenAI corrected the Codex GPT-5.6 window to 272K in 0.144.6. The 400K total
# keeps the model's separate 128K output allowance explicit.
# https://github.com/openai/codex/releases/tag/rust-v0.144.6
# https://github.com/openai/codex/blob/rust-v0.145.0/codex-rs/models-manager/models.json
base_model = "openai/gpt-5.6-luna"
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high", "xhigh", "max"] }]

[limit]
context = 400_000
input = 272_000
output = 128_000

[experimental.modes.fast]
provider = { body = { service_tier = "priority" } }
14 changes: 14 additions & 0 deletions providers/openai-codex/models/gpt-5.6-sol.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# OpenAI corrected the Codex GPT-5.6 window to 272K in 0.144.6. The 400K total
# keeps the model's separate 128K output allowance explicit.
# https://github.com/openai/codex/releases/tag/rust-v0.144.6
# https://github.com/openai/codex/blob/rust-v0.145.0/codex-rs/models-manager/models.json
base_model = "openai/gpt-5.6-sol"
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high", "xhigh", "max"] }]

[limit]
context = 400_000
input = 272_000
output = 128_000

[experimental.modes.fast]
provider = { body = { service_tier = "priority" } }
14 changes: 14 additions & 0 deletions providers/openai-codex/models/gpt-5.6-terra.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# OpenAI corrected the Codex GPT-5.6 window to 272K in 0.144.6. The 400K total
# keeps the model's separate 128K output allowance explicit.
# https://github.com/openai/codex/releases/tag/rust-v0.144.6
# https://github.com/openai/codex/blob/rust-v0.145.0/codex-rs/models-manager/models.json
base_model = "openai/gpt-5.6-terra"
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high", "xhigh", "max"] }]

[limit]
context = 400_000
input = 272_000
output = 128_000

[experimental.modes.fast]
provider = { body = { service_tier = "priority" } }
9 changes: 9 additions & 0 deletions providers/openai-codex/provider.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ChatGPT subscription models served by the Codex backend use limits that differ
# from direct OpenAI API access. This provider intentionally has no API-key env.
# https://github.com/openai/codex/releases/tag/rust-v0.144.6
# https://github.com/openai/codex/blob/rust-v0.145.0/codex-rs/models-manager/models.json
name = "OpenAI Codex"
env = []
npm = "@ai-sdk/openai"
doc = "https://github.com/openai/codex"
api = "https://chatgpt.com/backend-api/codex"
Loading