Add OpenRouter pricing for missing OpenAI models#329
Add OpenRouter pricing for missing OpenAI models#329nirnaim wants to merge 3 commits intopydantic:mainfrom
Conversation
Add pricing for new OpenAI models and date-suffixed aliases: - gpt-4.1-mini (+ cache_read) / gpt-4.1-mini-2025-04-14 - gpt-5 / gpt-5-2025-08-07 - gpt-5-mini / gpt-5-mini-2025-08-07 - gpt-5.1-codex-mini / gpt-5.1-codex-mini-20251113 - gpt-5.3-codex / gpt-5.3-codex-20260224 - gpt-5.4 (tiered pricing) / gpt-5.4-20260305 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds missing OpenRouter pricing entries/aliases for several OpenAI models so requests to date-suffixed model IDs map to the correct price definitions.
Changes:
- Extend
openai/gpt-4.1-miniandopenai/gpt-5-minimatching to include date-suffixed aliases; addcache_read_mtokforgpt-4.1-mini. - Add a date-suffixed alias for
openai/gpt-5. - Add new model entries for
openai/gpt-5.3-codexandopenai/gpt-5.4(including tiered pricing forgpt-5.4).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| or: | ||
| - equals: openai/gpt-5.1-codex-mini | ||
| - equals: openai/gpt-5.1-codex-mini-20251113 | ||
| prices: | ||
| input_mtok: 0.25 | ||
| cache_read_mtok: 0.025 | ||
| output_mtok: 2 | ||
| prices_checked: 2025-11-29 | ||
|
|
||
| - id: openai/gpt-5.3-codex | ||
| match: | ||
| or: | ||
| - equals: openai/gpt-5.3-codex | ||
| - equals: openai/gpt-5.3-codex-20260224 | ||
| prices: | ||
| input_mtok: 1.75 | ||
| cache_read_mtok: 0.175 | ||
| output_mtok: 14 | ||
|
|
||
| - id: openai/gpt-5.4 | ||
| match: | ||
| or: | ||
| - equals: openai/gpt-5.4 | ||
| - equals: openai/gpt-5.4-20260305 |
There was a problem hiding this comment.
The date-suffixed OpenAI model aliases use mixed date formats (e.g., openai/gpt-5-mini-2025-08-07 is YYYY-MM-DD, but openai/gpt-5.1-codex-mini-20251113 / openai/gpt-5.3-codex-20260224 / openai/gpt-5.4-20260305 are YYYYMMDD). In this file, other OpenAI date-suffixed models consistently use YYYY-MM-DD (e.g., openai/gpt-4o-2024-08-06, openai/o1-preview-2024-09-12). Please double-check the actual OpenRouter model IDs; if they are YYYY-MM-DD, update these aliases, or consider matching both formats to be robust.
| - id: openai/gpt-5.3-codex | ||
| match: | ||
| or: | ||
| - equals: openai/gpt-5.3-codex | ||
| - equals: openai/gpt-5.3-codex-20260224 | ||
| prices: | ||
| input_mtok: 1.75 | ||
| cache_read_mtok: 0.175 | ||
| output_mtok: 14 | ||
|
|
||
| - id: openai/gpt-5.4 | ||
| match: | ||
| or: | ||
| - equals: openai/gpt-5.4 | ||
| - equals: openai/gpt-5.4-20260305 | ||
| prices: | ||
| input_mtok: | ||
| base: 2.5 | ||
| tiers: | ||
| - start: 272000 | ||
| price: 5 | ||
| cache_read_mtok: | ||
| base: 0.25 | ||
| tiers: | ||
| - start: 272000 | ||
| price: 0.5 | ||
| output_mtok: | ||
| base: 15 | ||
| tiers: | ||
| - start: 272000 | ||
| price: 22.5 | ||
|
|
There was a problem hiding this comment.
The newly added openai/gpt-5.3-codex and openai/gpt-5.4 entries don’t include prices_checked, while the surrounding gpt-5* models in this section do (e.g., openai/gpt-5, openai/gpt-5-mini, openai/gpt-5.1-codex-mini). Adding prices_checked for these new price definitions would keep metadata consistent and make future audits easier.
| - start: 272000 | ||
| price: 5 | ||
| cache_read_mtok: | ||
| base: 0.25 | ||
| tiers: | ||
| - start: 272000 | ||
| price: 0.5 | ||
| output_mtok: | ||
| base: 15 | ||
| tiers: | ||
| - start: 272000 | ||
| price: 22.5 |
There was a problem hiding this comment.
🚩 Tiered pricing for gpt-5.4 uses a different tier threshold than existing models
The new openai/gpt-5.4 entry uses start: 272000 for its tier thresholds, while existing tiered entries (e.g., Anthropic models like claude-sonnet-4 around lines 280-340) use start: 200000. This is likely intentional — different models can have different context window breakpoints for tiered pricing — but it's worth confirming this 272K threshold is correct for gpt-5.4.
Was this helpful? React with 👍 or 👎 to provide feedback.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| - equals: openai/gpt-5.1 | ||
| - equals: openai/gpt-5.1-chat | ||
| - equals: openai/gpt-5.1-codex | ||
| - equals: openai/gpt-5-2025-08-07 |
There was a problem hiding this comment.
🚩 Date suffix format inconsistency across OpenRouter model aliases
The newly added date-suffixed model aliases use two different date formats: dashed dates like openai/gpt-5-2025-08-07 and openai/gpt-4.1-mini-2025-04-14, vs compact dates like openai/gpt-5.1-codex-mini-20251113, openai/gpt-5.3-codex-20260224, and openai/gpt-5.4-20260305. This appears to reflect the actual model identifiers used by OpenRouter's API rather than a formatting error, but it's worth confirming these IDs match what OpenRouter actually serves.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
Re: date format inconsistency — the date-suffixed model IDs (both |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
gpt-4.1-mini+ cache_read pricing /gpt-4.1-mini-2025-04-14gpt-5/gpt-5-2025-08-07gpt-5-mini/gpt-5-mini-2025-08-07gpt-5.1-codex-mini/gpt-5.1-codex-mini-20251113gpt-5.3-codex/gpt-5.3-codex-20260224gpt-5.4(tiered pricing) /gpt-5.4-20260305Test plan
make build-pricessucceedsmake lintpassesmake typecheckpasses (0 errors)make testpasses (424 passed, 41 xfailed)🤖 Generated with Claude Code