REST API
AI Impact Calculator API
Calculate the carbon footprint, energy usage, and water consumption of any AI model call from your own application. One endpoint, zero setup.
Base URL
https://aiimpactcalculator.com/api/v1Authentication
Pass your API key as a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEYℹ️
Try it now — no signup needed
Use the demo key aic_demo_key_12345 to make live requests below. Limited to 100 requests/month.
Endpoint
POST
/api/v1/calculateRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | AI model key (see table below) |
| tokens | number | Yes | Number of tokens (or images for image-gen) |
| grid | string | No | Power grid key (default: global-avg) |
| custom_wh_per_1k | number | Conditional | Required when model is custom |
Model Values
| model | Description | Energy rate |
|---|---|---|
| gpt-4 | GPT-4 / Claude 3 Opus | 4.5 Wh / 1k tokens |
| gpt-3.5 | GPT-3.5 / Llama-70b | 0.5 Wh / 1k tokens |
| llama-7b | Small (7B) Models | 0.1 Wh / 1k tokens |
| image-gen | Image Generation | 2.9 Wh / image |
| custom | Custom | Provide custom_wh_per_1k |
Grid Values
| grid | Description | Intensity |
|---|---|---|
| global-avg | Global Average | 475 gCO2e/kWh |
| us-avg | US Average | 380 gCO2e/kWh |
| eu-avg | EU Average | 250 gCO2e/kWh |
| hydro-green | Green Grid (Hydro/Wind) | 20 gCO2e/kWh |
| coal-heavy | Coal Heavy | 820 gCO2e/kWh |
Example Response
{
"model": "gpt-4",
"tokens": 50000,
"grid": "eu-avg",
"energy_kwh": 0.225,
"carbon_gco2e": 56.25,
"water_liters": 0.405,
"equivalents": {
"smartphones_charged": 18.75,
"km_driven": 0.331,
"led_hours": 25.0,
"netflix_hours_sd": 0.88,
"emails_equivalent": 14
},
"plan": "free",
"rate_limit": {
"limit": 100,
"remaining": 99,
"reset_at": "2026-04-01T00:00:00.000Z"
},
"methodology_url": "https://aiimpactcalculator.com/methodology"
}Code Snippets
curl -X POST https://aiimpactcalculator.com/api/v1/calculate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-4",
"tokens": 50000,
"grid": "eu-avg"
}'Error Codes
| HTTP Status | code | Meaning |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 400 | INVALID_MODEL | Unknown model value |
| 400 | INVALID_TOKENS | tokens must be a positive number |
| 400 | INVALID_GRID | Unknown grid value |
| 400 | MISSING_CUSTOM_RATE | custom_wh_per_1k required for custom model |
| 400 | BAD_REQUEST | Malformed JSON body |
| 429 | RATE_LIMIT_EXCEEDED | Monthly request limit reached |
Rate Limiting
Limits are per calendar month and reset on the 1st. The current usage is returned in every response under rate_limit, and in these response headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 2026-04-01T00:00:00.000ZPricing
| Plan | Price | Requests/mo | Best for |
|---|---|---|---|
| Free | $0 / mo | 100 | Evaluation, personal projects |
| Indie | $9 / mo | 5,000 | Solo devs, small apps |
| Pro | $29 / mo | 50,000 | SaaS products, agencies |
| Business | $99 / mo | 500,000 | Enterprise, ESG reporting |
Need a custom plan or higher volume? Contact us.
Try It Live
Uses the demo key. Runs against the real API.
Ready to integrate?
The demo key is rate-limited. Contact us to get a production key, or use the methodology to understand how the numbers are calculated.
Read the Methodology