Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
06ec553
Merge pull request #3678 from lidge-jun/codex/promote-main-243-01a07240
lidge-jun Sep 5, 2026
116c2ac
Merge commit '44ea9576e27c6be8be7f13a86e32bb349368c54d' into codex/re…
invalid-email-address Sep 6, 2026
07b48da
Merge pull request #3785 from lidge-jun/codex/release-244-main-07c0
lidge-jun Sep 6, 2026
bcdf559
chore(release): promote validated 2.45.0 to main [skip ci]
invalid-email-address Sep 6, 2026
b0900e5
chore(release): promote 2.45.0 to main (#3813)
lidge-jun Sep 6, 2026
3970601
chore(release): prepare 2.46.0 stable promotion
invalid-email-address Sep 7, 2026
bba6322
Merge pull request #3851 from lidge-jun/codex/release-246-main
lidge-jun Sep 7, 2026
3d53e5f
release: prepare 2.47.0 from audited regression candidate
invalid-email-address Sep 7, 2026
eda8754
Merge commit '48ab3e1e66cfa6e0c873de2fafa4540ac61d6c7d' into codex/re…
invalid-email-address Sep 7, 2026
f9e3515
Merge commit '57252193b' into codex/release-247-main
invalid-email-address Sep 7, 2026
6f71931
release: promote 2.47.0 to main (#3929)
lidge-jun Sep 7, 2026
9a60256
Merge commit 'd0737cff3' into codex/release-247-main-final
invalid-email-address Sep 7, 2026
9e9b1d3
Merge commit 'f48c322c0' into codex/release-247-main-final
invalid-email-address Sep 7, 2026
947bae9
Merge commit '0d7652ad1' into codex/release-247-main-final
invalid-email-address Sep 7, 2026
f7f890f
release: apply final roster correction to main (#3933)
lidge-jun Sep 7, 2026
544ebee
release: promote 2.48.0 to main
invalid-email-address Sep 8, 2026
d24ff57
release: set main channel version 2.48.0
invalid-email-address Sep 8, 2026
9a27e86
Merge pull request #4011 from lidge-jun/codex/release-248-main
lidge-jun Sep 8, 2026
62849df
release: promote verified 2.49.0 product tree to main
lidge-jun Sep 9, 2026
2f3f736
Merge pull request #4117 from lidge-jun/codex/release-249-main-01a08498
lidge-jun Sep 9, 2026
3a3de88
release: promote verified 2.50.0 product tree to main
lidge-jun Sep 10, 2026
2d4d7a2
Merge pull request #4195 from lidge-jun/codex/release-250-main-01a08a81
lidge-jun Sep 10, 2026
cf456e8
release: promote verified 2.51.0 product tree to main
lidge-jun Sep 11, 2026
c155cc7
Merge pull request #4271 from lidge-jun/codex/release-251-main
lidge-jun Sep 11, 2026
75e9a11
fix(catalog): account for auxiliary model charges
luvs01 Sep 12, 2026
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
14 changes: 9 additions & 5 deletions src/codex/catalog/provider-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1425,10 +1425,11 @@ function discoveredPricingRate(value: unknown): number | undefined {
/**
* Cost class for one discovered row, read from the provider's own `pricing` object (#3666).
*
* Fail closed. Only a complete pair of non-negative numeric rates classifies at all; a missing,
* one-sided, non-numeric, or negative rate is "unknown" and therefore excluded from a free-only
* filter. Showing a paid model under a Free filter spends the user's money, while hiding a free
* one costs a click.
* Fail closed. Any positive numeric component proves the model is paid. Calling it free requires
* a complete prompt/completion pair and every published pricing component to be a non-negative
* numeric zero; an unsupported component is "unknown" because it may describe another charge.
* Showing a paid model under a Free filter spends the user's money, while hiding a free one costs
* a click.
*
* Two things that look like evidence and are not. A `:free` id suffix is an OpenRouter naming
* convention, not a price — Nous ships `:free` slugs on a provider whose `freeTier` is false on
Expand All @@ -1441,10 +1442,13 @@ function discoveredPricingRate(value: unknown): number | undefined {
export function discoveredPricingStatus(item: ProviderModelsApiItem): "free" | "paid" | "unknown" {
const pricing = plainRecord(item.pricing) ?? plainRecord(plainRecord(item.metadata)?.pricing);
if (!pricing) return "unknown";
const rates = Object.values(pricing).map(discoveredPricingRate);
if (rates.some(rate => rate !== undefined && rate > 0)) return "paid";
if (rates.some(rate => rate === undefined)) return "unknown";
const prompt = discoveredPricingRate(pricing.prompt ?? pricing.input);
const completion = discoveredPricingRate(pricing.completion ?? pricing.output);
if (prompt === undefined || completion === undefined) return "unknown";
return prompt === 0 && completion === 0 ? "free" : "paid";
return "free";
}

export function catalogHintsFromModelsApiItem(providerName: string, item: ProviderModelsApiItem): Partial<CatalogModel> {
Expand Down
22 changes: 22 additions & 0 deletions tests/codex-integration/catalog-free-pricing-status.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,28 @@ describe("discovered model pricing classification (#3666)", () => {
expect(discoveredPricingStatus({ id: "half2", pricing: { prompt: "1e-6", completion: "0" } })).toBe("paid");
});

test("auxiliary charges prevent a model from classifying free", () => {
expect(discoveredPricingStatus({
id: "request-charge",
pricing: { prompt: "0", completion: "0", request: "0.05" },
})).toBe("paid");
expect(discoveredPricingStatus({
id: "free-all-dimensions",
pricing: { prompt: "0", completion: "0", request: 0, image: "0", web_search: "0.0" },
})).toBe("free");
});

test("unsupported auxiliary pricing stays unknown rather than classifying free", () => {
expect(discoveredPricingStatus({
id: "unsupported-charge",
pricing: { prompt: 0, completion: 0, request: { amount: "0.05" } },
})).toBe("unknown");
expect(discoveredPricingStatus({
id: "invalid-auxiliary",
pricing: { prompt: 0, completion: 0, image: -1 },
})).toBe("unknown");
});

test("a provider that publishes no pricing is unknown, and the hint field is absent", () => {
expect(discoveredPricingStatus({ id: "llama3.2" })).toBe("unknown");
// Absent rather than present-and-"unknown": catalogHintsFromModelsApiItem's contract is that
Expand Down
Loading