fix(openai): correct stale pricing for gpt-4o family and gpt-5.x pro/5.5#3176
Open
KartikMouli wants to merge 1 commit into
Open
fix(openai): correct stale pricing for gpt-4o family and gpt-5.x pro/5.5#3176KartikMouli wants to merge 1 commit into
KartikMouli wants to merge 1 commit into
Conversation
Updates per https://developers.openai.com/api/docs/pricing and https://platform.openai.com/docs/models: - gpt-4o: 5.00/15.00 -> 2.50/10.00 (post-2024-08-06 standard price) - chatgpt-4o-latest: 2.50/10.00 -> 5.00/15.00 (chat-latest premium) - gpt-4o-audio-preview, gpt-4o-audio-preview-2025-06-03: 5.00/15.00 -> 2.50/10.00 (text I/O matches gpt-4o) - gpt-5.5: output 22.50 -> 30.00 - gpt-5.5-pro: 15.00/90.00 -> 30.00/180.00 - gpt-5.4-pro: output 135.00 -> 180.00 Bumps openai plugin to 0.4.1.
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the OpenAI plugin version to 0.4.1 and adjusts the pricing configuration for several models, including ChatGPT-4o, GPT-4o, and the GPT-5 series. A review comment identifies a missing trailing newline in the gpt-4o-audio-preview-2025-06-03.yaml file, suggesting its addition for POSIX compliance and consistency.
| input: '2.50' | ||
| output: '10.00' | ||
| unit: '0.000001' | ||
| currency: USD No newline at end of file |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Several models in the OpenAI provider have stale or incorrect pricing in their YAMLs. The most impactful is the
gpt-4o↔chatgpt-4o-latestswap that has been live since the v1.0.0 plugin migration — anyone using Dify's usage stats forgpt-4ohas been billed against double the actual rate. This PR corrects 7 YAMLs against OpenAI's current official pricing.All values verified against https://developers.openai.com/api/docs/pricing (the current official OpenAI pricing page) and https://platform.openai.com/docs/models.
Pricing corrections
models/openai/models/llm/gpt-4o.yamlgpt-4omodels/openai/models/llm/chatgpt-4o-latest.yamlchat-latest(ChatGPT model) is priced higher thangpt-4o; values look swapped with abovemodels/openai/models/llm/gpt-4o-audio-preview.yamlgpt-4o; audio I/O is metered separatelymodels/openai/models/llm/gpt-4o-audio-preview-2025-06-03.yamlmodels/openai/models/llm/gpt-5.5.yamlmodels/openai/models/llm/gpt-5.5-pro.yamlgpt-5.4-prostructuremodels/openai/models/llm/gpt-5.4-pro.yamlThe latter three were introduced in #2981 (merged 2026-04-26) which added the GPT-5.5 family; the values appear to have been estimated before final pricing was published.
Why this matters
gpt-4ois one of the most widely used models on Dify. The current5.00 / 15.00configuration causes Dify's cost-estimation UI and token-spend dashboards to display 2× the actual OpenAI bill. The reverse is true forchatgpt-4o-latest(showing 50% of the actual cost). This has been quietly wrong since the v1.0.0 plugin migration (Feb 2025).This PR contains Changes to Non-Plugin
This PR contains Changes to Non-LLM Models Plugin
This PR contains Changes to LLM Models Plugin
YAML pricing fields only — no runtime/behavior changes. Token consumption metrics shown in the Dify UI and exposed via APIs will now reflect actual OpenAI billing for affected models.
Version Control
models/openai/manifest.yaml: 0.4.0 → 0.4.1, PATCH for backwards-compatible fix)Dify Plugin SDK Version
dify_plugin>=0.3.0,<0.6.0is in requirements.txt (no SDK changes in this PR)Environment Verification
SaaS Environment
fix(gemini): update pricing configuration for Gemini models) which made an analogous pricing-only YAML correction.