Fun
LLM token energy & cost estimator API
Estimate the electricity used to run N tokens (or queries) through an LLM, plus dollar cost and CO2, with fun comparisons (phone charges, LED-bulb hours, Google searches, EV miles). Rough Wh/token by model class x datacenter PUE x grid carbon x $/kWh, deterministic. Answers 'how much electricity does an LLM query use', 'cost to run a million tokens', 'carbon footprint of an AI prompt', 'energy per token'.
Price$0.01per request
MethodPOST
Route/v1/fun/llm-energy
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
funenergyelectricityllmtokenscarboncostai
API URL
Integration docshttps://x402.hexl.dev/v1/fun/llm-energyExample request
{
"tokens": 1000000,
"model": "gpt-4o"
}Example response
{
"tokens": 1000000,
"model": "gpt-4o",
"whPerToken": 0.0003,
"pue": 1.2,
"energyWh": 360,
"energyKwh": 0.36,
"costUsd": 0.0576,
"co2Grams": 144,
"waterLiters": 0.648,
"waterBottles500ml": 1.3,
"comparisons": {
"phoneChargesEquivalent": 18.95,
"ledBulbHours": 36
}
}Input schema
{
"type": "object",
"properties": {
"tokens": {
"type": "number",
"examples": [
1000000
]
},
"queries": {
"type": "number",
"examples": [
1000
]
},
"tokensPerQuery": {
"type": "number",
"examples": [
500
]
},
"model": {
"type": "string",
"examples": [
"gpt-4o",
"llama-70b",
"claude-opus"
]
},
"pricePerKwh": {
"type": "number",
"examples": [
0.16
]
},
"gridGramsCo2PerKwh": {
"type": "number",
"examples": [
400
]
},
"pue": {
"type": "number",
"examples": [
1.2
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}