diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index 0b63359a8..d6f4c0fa3 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -16,6 +16,7 @@ - Fixed "Selected model is at capacity" provider errors ending the turn instead of being retried ([#10278](https://github.com/earendil-works/pi/issues/10278)) - Fixed Cloudflare AI Gateway Claude models failing with a 404 by using dashed model IDs (`claude-opus-5-5` instead of `claude-opus-5.5`), which Anthropic requires - Fixed Sign in with ChatGPT continuing when its callback port is taken by another login, which made the browser show "OAuth state mismatch"; it now fails with a port-in-use error ([#10265](https://github.com/earendil-works/pi/issues/10265)) +- Fixed Amazon Bedrock OpenAI models costing requests above 272k input tokens at the short-context rate; Bedrock models now include the pricing tiers listed on models.dev ([#10326](https://github.com/earendil-works/pi/issues/10326)) ## [1.0.0] - 2026-10-01 diff --git a/packages/ai/scripts/generate-models.ts b/packages/ai/scripts/generate-models.ts index bafbf93d9..d9629d32e 100644 --- a/packages/ai/scripts/generate-models.ts +++ b/packages/ai/scripts/generate-models.ts @@ -1790,12 +1790,8 @@ async function loadModelsDevData(): Promise[]> { baseUrl: getBedrockBaseUrl(id), reasoning: m.reasoning === true, input: (m.modalities?.input?.includes("image") ? ["text", "image"] : ["text"]) as ("text" | "image")[], - cost: { - input: m.cost?.input || 0, - output: m.cost?.output || 0, - cacheRead: m.cost?.cache_read || 0, - cacheWrite: m.cost?.cache_write || 0, - }, + // Includes models.dev pricing tiers, e.g. the long-context tier for OpenAI models (#10326). + cost: getModelsDevCost(m.cost), contextWindow: m.limit?.context || 4096, maxTokens: m.limit?.output || 4096, ...(m.structured_output === true && { compat: { supportsStrictMode: true } }),