44 lines
1.3 KiB
Python
44 lines
1.3 KiB
Python
"""
|
|
AI Constants - Model pricing, valid models, and configuration constants
|
|
"""
|
|
# Model pricing (per 1M tokens) - EXACT from reference plugin model-rates-config.php
|
|
MODEL_RATES = {
|
|
'gpt-4.1': {'input': 2.00, 'output': 8.00},
|
|
'gpt-4o-mini': {'input': 0.15, 'output': 0.60},
|
|
'gpt-4o': {'input': 2.50, 'output': 10.00},
|
|
'gpt-5.1': {'input': 1.25, 'output': 10.00},
|
|
'gpt-5.2': {'input': 1.75, 'output': 14.00},
|
|
}
|
|
|
|
# Image model pricing (per image) - EXACT from reference plugin
|
|
IMAGE_MODEL_RATES = {
|
|
'dall-e-3': 0.040,
|
|
'dall-e-2': 0.020,
|
|
'gpt-image-1': 0.042,
|
|
'gpt-image-1-mini': 0.011,
|
|
}
|
|
|
|
# Valid OpenAI image generation models (only these work with /v1/images/generations endpoint)
|
|
VALID_OPENAI_IMAGE_MODELS = {
|
|
'dall-e-3',
|
|
'dall-e-2',
|
|
# Note: gpt-image-1 and gpt-image-1-mini are NOT valid for OpenAI's /v1/images/generations endpoint
|
|
}
|
|
|
|
# Valid image sizes per model (from OpenAI official documentation)
|
|
VALID_SIZES_BY_MODEL = {
|
|
'dall-e-3': ['1024x1024', '1024x1792', '1792x1024'],
|
|
'dall-e-2': ['256x256', '512x512', '1024x1024'],
|
|
}
|
|
|
|
# Default model
|
|
DEFAULT_AI_MODEL = 'gpt-4.1'
|
|
|
|
# JSON mode supported models
|
|
JSON_MODE_MODELS = ['gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo-preview', 'gpt-5.1', 'gpt-5.2']
|
|
|
|
# Debug mode - controls console logging
|
|
# Set to False in production to disable verbose logging
|
|
DEBUG_MODE = True
|
|
|