Skip to content

Add OpenRouter pricing for missing OpenAI models#329

Open
nirnaim wants to merge 3 commits intopydantic:mainfrom
nirnaim:missing_prices
Open

Add OpenRouter pricing for missing OpenAI models#329
nirnaim wants to merge 3 commits intopydantic:mainfrom
nirnaim:missing_prices

Conversation

@nirnaim
Copy link
Copy Markdown
Contributor

@nirnaim nirnaim commented Mar 29, 2026

Summary

  • Add pricing and date-suffixed aliases for OpenAI models on OpenRouter:
    • gpt-4.1-mini + cache_read pricing / 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

Test plan

  • make build-prices succeeds
  • make lint passes
  • make typecheck passes (0 errors)
  • make test passes (424 passed, 41 xfailed)

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings March 29, 2026 07:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-mini and openai/gpt-5-mini matching to include date-suffixed aliases; add cache_read_mtok for gpt-4.1-mini.
  • Add a date-suffixed alias for openai/gpt-5.
  • Add new model entries for openai/gpt-5.3-codex and openai/gpt-5.4 (including tiered pricing for gpt-5.4).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3373 to +3396
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
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +3382 to +3413
- 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

Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 4 potential issues.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment on lines +3401 to +3412
- 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
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 1 additional finding in Devin Review.

Open in Devin Review

- equals: openai/gpt-5.1
- equals: openai/gpt-5.1-chat
- equals: openai/gpt-5.1-codex
- equals: openai/gpt-5-2025-08-07
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@nirnaim
Copy link
Copy Markdown
Contributor Author

nirnaim commented Mar 29, 2026

Re: date format inconsistency — the date-suffixed model IDs (both YYYY-MM-DD and YYYYMMDD formats) match the actual model identifiers used by OpenRouter's API. These are not formatting choices on our side.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants