The price configuration of the Azure openai model is inconsistent with the official website,and leads to cost calculation error. #6974

Closed
opened 2026-02-21 18:18:12 -05:00 by yindo · 1 comment
Owner

Originally created by @MrLiangLong on GitHub (Nov 27, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.12.1

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

The price displayed in the code:

  1. gpt-35-turbo input=0.0005 output=0.0015
  2. gpt-4o: input=5.00 output=15.00
  3. gpt-4o-2024-08-06:input=5.00 output=15.00

✔️ Expected Behavior

The prices displayed on the official website:

  1. gpt-35-turbo input=0.0003 output=0.006
  2. gpt-4o: input=2.50 output=10.00
  3. gpt-4o-2024-08-06:input=2.50 output=10.00

Actual Behavior

model price configuration error leads to cost calculation error。

Originally created by @MrLiangLong on GitHub (Nov 27, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.12.1 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce The price displayed in the code: 1. gpt-35-turbo input=0.0005 output=0.0015 2. gpt-4o: input=5.00 output=15.00 3. gpt-4o-2024-08-06:input=5.00 output=15.00 ### ✔️ Expected Behavior The prices displayed on the official website: 1. gpt-35-turbo input=0.0003 output=0.006 2. gpt-4o: input=2.50 output=10.00 3. gpt-4o-2024-08-06:input=2.50 output=10.00 ### ❌ Actual Behavior model price configuration error leads to cost calculation error。
yindo added the 🐞 bug label 2026-02-21 18:18:12 -05:00
yindo closed this issue 2026-02-21 18:18:12 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 27, 2024):

Hello @MrLiangLong! 👋 I'm here to help you with bug fixes, answer questions, and assist you in becoming a contributor. If you need any assistance, feel free to ask!

I found a similar closed issue regarding incorrect pricing of certain LLM models, which was resolved by a pull request that revised the pricing [1]. You might want to check if the pricing configuration in your version of Dify has been updated since the resolution of that issue.

The pricing configuration for Azure OpenAI models in the Dify codebase is defined in the file api/core/model_runtime/model_providers/azure_openai/_constant.py. You can verify and update the pricing details in this file to match the official website's prices. The PriceConfig class is used to specify the pricing details for each model, including the input and output costs, unit, and currency [2].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Nov 27, 2024): <!-- Greeting --> Hello @MrLiangLong! 👋 I'm here to help you with bug fixes, answer questions, and assist you in becoming a contributor. If you need any assistance, feel free to ask! <!-- Answer --> I found a similar closed issue regarding incorrect pricing of certain LLM models, which was resolved by a pull request that revised the pricing <sup>[[1]](https://github.com/langgenius/dify/issues/6962)</sup>. You might want to check if the pricing configuration in your version of Dify has been updated since the resolution of that issue. The pricing configuration for Azure OpenAI models in the Dify codebase is defined in the file `api/core/model_runtime/model_providers/azure_openai/_constant.py`. You can verify and update the pricing details in this file to match the official website's prices. The `PriceConfig` class is used to specify the pricing details for each model, including the input and output costs, unit, and currency <sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/azure_openai/_constant.py)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6974