-
-
Couldn't load subscription status.
- Fork 13.9k
💰 feat: add pricing info for Azure GPT-5 series models #9833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
💰 feat: add pricing info for Azure GPT-5 series models #9833
Conversation
Added comprehensive pricing information for all Azure OpenAI GPT-5 series models: - GPT-5 Pro: $15/$120 per million tokens (input/output) - GPT-5 Codex: $1.25/$10 per million tokens with cache support - GPT-5: $1.25/$10 per million tokens with cache support - GPT-5 Mini: $0.25/$2 per million tokens with cache support - GPT-5 Nano: $0.05/$0.4 per million tokens with cache support - GPT-5 Chat: $1.25/$10 per million tokens with cache support Pricing aligns with OpenAI official rates and includes cache read pricing where applicable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
Someone is attempting to deploy a commit to the LobeHub Community Team on Vercel. A member of the Team first needs to authorize it. |
Reviewer's GuideThis PR enriches Azure GPT-5 series support by embedding detailed pricing schemes into model definitions, registering the new GPT-5 variants in the provider config and constants list, and extending system-role mapping logic to encompass all GPT-5 models. Class diagram for new Azure GPT-5 series model cards with pricingclassDiagram
class AIChatModelCard {
abilities
config
contextWindowTokens
description
displayName
enabled
id
maxOutput
pricing
releasedAt
type
}
class Pricing {
units
}
class PricingUnit {
name
rate
strategy
unit
}
AIChatModelCard --> Pricing
Pricing --> PricingUnit
AIChatModelCard "1" --o "1" Pricing
Pricing "1" --o "*" PricingUnit
class GPT5_Pro {
abilities: functionCall, reasoning, structuredOutput, vision
config: deploymentName = 'gpt-5-pro'
contextWindowTokens: 400_000
pricing: textInput $15, textOutput $120 per million tokens
}
class GPT5_Codex {
abilities: functionCall, structuredOutput
config: deploymentName = 'gpt-5-codex'
contextWindowTokens: 400_000
pricing: textInput $1.25, textOutput $10, textInput_cacheRead $0.125 per million tokens
}
class GPT5 {
abilities: functionCall, reasoning, structuredOutput, vision
config: deploymentName = 'gpt-5'
contextWindowTokens: 400_000
pricing: textInput $1.25, textOutput $10, textInput_cacheRead $0.125 per million tokens
}
class GPT5_Mini {
abilities: functionCall, reasoning, structuredOutput, vision
config: deploymentName = 'gpt-5-mini'
contextWindowTokens: 400_000
pricing: textInput $0.25, textOutput $2, textInput_cacheRead $0.025 per million tokens
}
class GPT5_Nano {
abilities: functionCall, reasoning, structuredOutput, vision
config: deploymentName = 'gpt-5-nano'
contextWindowTokens: 400_000
pricing: textInput $0.05, textOutput $0.4, textInput_cacheRead $0.005 per million tokens
}
class GPT5_Chat {
abilities: vision
config: deploymentName = 'gpt-5-chat'
contextWindowTokens: 128_000
pricing: textInput $1.25, textOutput $10, textInput_cacheRead $0.125 per million tokens
}
AIChatModelCard <|-- GPT5_Pro
AIChatModelCard <|-- GPT5_Codex
AIChatModelCard <|-- GPT5
AIChatModelCard <|-- GPT5_Mini
AIChatModelCard <|-- GPT5_Nano
AIChatModelCard <|-- GPT5_Chat
Class diagram for updated system-role mapping logic in LobeAzureOpenAIclassDiagram
class LobeAzureOpenAI {
+sendMessage(message, model)
}
LobeAzureOpenAI : sendMessage(message, model)
LobeAzureOpenAI : // system role conversion logic
LobeAzureOpenAI : // now includes GPT-5 models
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
TestGru AssignmentSummary
Files
Tip You can |
|
Thank you for raising your pull request and contributing to our Community |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- The GPT-5 Chat entry in modelProviders/azure.ts is missing an
enabled: trueflag—please add it for consistency with the other models. - Several GPT-5 pricing blocks repeat identical cacheRead rates—consider extracting a shared unit definition or confirming the rates are consistent across all variants.
- The system role mapping uses
model.includes('gpt-5'), which may match unintended IDs—consider matching against a specific list or exact patterns for each GPT-5 variant.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The GPT-5 Chat entry in modelProviders/azure.ts is missing an `enabled: true` flag—please add it for consistency with the other models.
- Several GPT-5 pricing blocks repeat identical cacheRead rates—consider extracting a shared unit definition or confirming the rates are consistent across all variants.
- The system role mapping uses `model.includes('gpt-5')`, which may match unintended IDs—consider matching against a specific list or exact patterns for each GPT-5 variant.
## Individual Comments
### Comment 1
<location> `packages/const/src/models.ts:38-40` </location>
<code_context>
'computer-use-preview-2025-03-11',
+ 'gpt-5-codex',
+ 'gpt-5-pro',
+ 'gpt-5-pro-2025-10-06',
]);
</code_context>
<issue_to_address>
**suggestion:** Review the need for both 'gpt-5-pro' and 'gpt-5-pro-2025-10-06' in the model set.
If these are separate models, please clarify their distinctions; if not, consider merging to prevent confusion.
```suggestion
'gpt-5-codex',
// 'gpt-5-pro' is the general release, while 'gpt-5-pro-2025-10-06' is a dated preview version.
'gpt-5-pro',
'gpt-5-pro-2025-10-06',
```
</issue_to_address>
### Comment 2
<location> `packages/model-runtime/src/providers/azureOpenai/index.ts:54` </location>
<code_context>
role:
// Convert 'system' role to 'user' or 'developer' based on the model
- (model.includes('o1') || model.includes('o3')) && message.role === 'system'
+ (model.includes('o1') || model.includes('o3') || model.includes('gpt-5')) &&
+ message.role === 'system'
? [...systemToUserModels].some((sub) => model.includes(sub))
</code_context>
<issue_to_address>
**issue:** Check for unintended matches with 'model.includes('gpt-5')'.
This approach may unintentionally match variants like 'gpt-5-codex' or 'gpt-5-mini'. Use a stricter comparison if you only want the base 'gpt-5' model.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| 'gpt-5-codex', | ||
| 'gpt-5-pro', | ||
| 'gpt-5-pro-2025-10-06', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Review the need for both 'gpt-5-pro' and 'gpt-5-pro-2025-10-06' in the model set.
If these are separate models, please clarify their distinctions; if not, consider merging to prevent confusion.
| 'gpt-5-codex', | |
| 'gpt-5-pro', | |
| 'gpt-5-pro-2025-10-06', | |
| 'gpt-5-codex', | |
| // 'gpt-5-pro' is the general release, while 'gpt-5-pro-2025-10-06' is a dated preview version. | |
| 'gpt-5-pro', | |
| 'gpt-5-pro-2025-10-06', |
Removed all GPT-5 series model configurations from Azure provider: - GPT-5 Pro - GPT-5 Codex - GPT-5 - GPT-5 Mini - GPT-5 Nano - GPT-5 Chat These models are not yet officially released by Azure OpenAI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9833 +/- ##
==========================================
- Coverage 84.55% 84.55% -0.01%
==========================================
Files 943 944 +1
Lines 64465 64508 +43
Branches 7604 7901 +297
==========================================
+ Hits 54508 54542 +34
- Misses 9957 9966 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
💻 Change Type
🔀 Description of Change
Added comprehensive support for Azure OpenAI GPT-5 series models:
Model Bank & Pricing (
packages/model-bank/src/aiModels/azure.ts):API Constants (
packages/const/src/models.ts):Runtime Provider (
packages/model-runtime/src/providers/azureOpenai/index.ts):Note: As per reviewer feedback, removed the model provider configuration from
src/config/modelProviders/azure.ts.📝 Additional Information
The GPT-5 series models are defined in the model bank with complete specifications but are not exposed in the default provider configuration yet. They can be enabled once Azure officially releases these models.