Real-time pricing data from OpenAI official website
Access pricing data via JSON API:
GET https://bes-dev.github.io/openai-pricing-api/api.json
{
"models": { ... },
"timestamp": "2025-01-27T12:00:00Z",
"models_count": 20,
"source": "openai_official_pricing_page"
}
GET https://bes-dev.github.io/openai-pricing-api/pricing.json
GET https://bes-dev.github.io/openai-pricing-api/history.json
fetch('./api.json')
.then(res => res.json())
.then(data => {
console.log('Models:', data.models);
console.log('Updated:', data.timestamp);
});
import requests
url = 'https://bes-dev.github.io/openai-pricing-api/api.json'
data = requests.get(url).json()
for model_name, model_data in data['models'].items():
print(f"{model_name}: {model_data}")