| | package operation_setting |
| |
|
| | import "strings" |
| |
|
| | const ( |
| | |
| | WebSearchPriceHigh = 25.00 |
| | WebSearchPrice = 10.00 |
| | |
| | FileSearchPrice = 2.5 |
| | ) |
| |
|
| | const ( |
| | GPTImage1Low1024x1024 = 0.011 |
| | GPTImage1Low1024x1536 = 0.016 |
| | GPTImage1Low1536x1024 = 0.016 |
| | GPTImage1Medium1024x1024 = 0.042 |
| | GPTImage1Medium1024x1536 = 0.063 |
| | GPTImage1Medium1536x1024 = 0.063 |
| | GPTImage1High1024x1024 = 0.167 |
| | GPTImage1High1024x1536 = 0.25 |
| | GPTImage1High1536x1024 = 0.25 |
| | ) |
| |
|
| | const ( |
| | |
| | Gemini25FlashPreviewInputAudioPrice = 1.00 |
| | Gemini25FlashProductionInputAudioPrice = 1.00 |
| | Gemini25FlashLitePreviewInputAudioPrice = 0.50 |
| | Gemini25FlashNativeAudioInputAudioPrice = 3.00 |
| | Gemini20FlashInputAudioPrice = 0.70 |
| | GeminiRoboticsER15InputAudioPrice = 1.00 |
| | ) |
| |
|
| | const ( |
| | |
| | ClaudeWebSearchPrice = 10.00 |
| | ) |
| |
|
| | func GetClaudeWebSearchPricePerThousand() float64 { |
| | return ClaudeWebSearchPrice |
| | } |
| |
|
| | func GetWebSearchPricePerThousand(modelName string, contextSize string) float64 { |
| | |
| | |
| | |
| | |
| | |
| | isNormalPriceModel := |
| | strings.HasPrefix(modelName, "o3") || |
| | strings.HasPrefix(modelName, "o4") || |
| | strings.HasPrefix(modelName, "gpt-5") |
| | var priceWebSearchPerThousandCalls float64 |
| | if isNormalPriceModel { |
| | priceWebSearchPerThousandCalls = WebSearchPrice |
| | } else { |
| | priceWebSearchPerThousandCalls = WebSearchPriceHigh |
| | } |
| | return priceWebSearchPerThousandCalls |
| | } |
| |
|
| | func GetFileSearchPricePerThousand() float64 { |
| | return FileSearchPrice |
| | } |
| |
|
| | func GetGeminiInputAudioPricePerMillionTokens(modelName string) float64 { |
| | if strings.HasPrefix(modelName, "gemini-2.5-flash-preview-native-audio") { |
| | return Gemini25FlashNativeAudioInputAudioPrice |
| | } else if strings.HasPrefix(modelName, "gemini-2.5-flash-preview-lite") { |
| | return Gemini25FlashLitePreviewInputAudioPrice |
| | } else if strings.HasPrefix(modelName, "gemini-2.5-flash-preview") { |
| | return Gemini25FlashPreviewInputAudioPrice |
| | } else if strings.HasPrefix(modelName, "gemini-2.5-flash") { |
| | return Gemini25FlashProductionInputAudioPrice |
| | } else if strings.HasPrefix(modelName, "gemini-2.0-flash") { |
| | return Gemini20FlashInputAudioPrice |
| | } else if strings.HasPrefix(modelName, "gemini-robotics-er-1.5") { |
| | return GeminiRoboticsER15InputAudioPrice |
| | } |
| | return 0 |
| | } |
| |
|
| | func GetGPTImage1PriceOnceCall(quality string, size string) float64 { |
| | prices := map[string]map[string]float64{ |
| | "low": { |
| | "1024x1024": GPTImage1Low1024x1024, |
| | "1024x1536": GPTImage1Low1024x1536, |
| | "1536x1024": GPTImage1Low1536x1024, |
| | }, |
| | "medium": { |
| | "1024x1024": GPTImage1Medium1024x1024, |
| | "1024x1536": GPTImage1Medium1024x1536, |
| | "1536x1024": GPTImage1Medium1536x1024, |
| | }, |
| | "high": { |
| | "1024x1024": GPTImage1High1024x1024, |
| | "1024x1536": GPTImage1High1024x1536, |
| | "1536x1024": GPTImage1High1536x1024, |
| | }, |
| | } |
| |
|
| | if qualityMap, exists := prices[quality]; exists { |
| | if price, exists := qualityMap[size]; exists { |
| | return price |
| | } |
| | } |
| |
|
| | return GPTImage1High1024x1024 |
| | } |
| |
|