Configuration¶
Configure the Green module via openclaw.json.
Basic Configuration¶
{
"green": {
"enabled": true
}
}
Full Configuration¶
{
"green": {
"enabled": true,
"defaultGridCarbon": 400,
"factorOverrides": {
"anthropic:claude-sonnet-4": {
"inputCo2PerMillionTokens": 120,
"outputCo2PerMillionTokens": 360,
"confidence": 0.5
}
},
"dailyAlertThreshold": 1000,
"showInStatus": true
}
}
Options Reference¶
enabled¶
| Type | Default | Description |
|---|---|---|
boolean |
true |
Enable or disable tracking entirely |
When false, no carbon traces are recorded.
defaultGridCarbon¶
| Type | Default | Description |
|---|---|---|
number |
400 |
Grid carbon intensity (gCO₂/kWh) |
This value is used when regional grid data is unavailable.
Reference values:
| Region | gCO₂/kWh | Notes |
|---|---|---|
| World average | 400 | Default |
| US average | 380 | EPA eGRID |
| California | 220 | Cleaner grid |
| France | 60 | Nuclear-heavy |
| Poland | 650 | Coal-heavy |
| Germany | 350 | Mixed |
factorOverrides¶
| Type | Default | Description |
|---|---|---|
object |
{} |
Override carbon factors per model |
Use to provide custom factors when you have better data:
{
"factorOverrides": {
"provider:model": {
"inputCo2PerMillionTokens": 100,
"outputCo2PerMillionTokens": 300,
"cacheReadCo2PerMillionTokens": 10,
"waterMlPerMillionTokens": 2000,
"confidence": 0.8,
"source": "measured"
}
}
}
dailyAlertThreshold¶
| Type | Default | Description |
|---|---|---|
number |
null |
Alert threshold in grams CO₂ per day |
When set, alerts trigger if daily emissions exceed this value.
{
"dailyAlertThreshold": 1000
}
showInStatus¶
| Type | Default | Description |
|---|---|---|
boolean |
true |
Include green summary in openclaw status |
Environment Variables¶
Configuration can also be set via environment:
| Variable | Config Path | Description |
|---|---|---|
OPENCLAW_GREEN_ENABLED |
green.enabled |
Enable tracking |
OPENCLAW_GREEN_GRID_CARBON |
green.defaultGridCarbon |
Grid intensity |
Config Precedence¶
- Environment variables (highest)
openclaw.jsonin working directory~/.openclaw/openclaw.json- Default values (lowest)
Validation¶
Invalid configuration is logged but doesn't crash:
[WARN] green.defaultGridCarbon: must be positive, using 400
Examples¶
Minimal (Defaults)¶
{
"green": {}
}
Uses all defaults: enabled, 400 gCO₂/kWh.
Privacy-Conscious¶
{
"green": {
"enabled": false
}
}
No tracking at all.
With Daily Alerts¶
{
"green": {
"dailyAlertThreshold": 500
}
}
Alerts if daily emissions exceed 500g CO₂.
European Deployment¶
{
"green": {
"defaultGridCarbon": 300
}
}
Uses EU average grid carbon.
With Custom Factors¶
{
"green": {
"factorOverrides": {
"anthropic:claude-sonnet-4": {
"inputCo2PerMillionTokens": 100,
"outputCo2PerMillionTokens": 300,
"confidence": 0.7,
"source": "research"
}
}
}
}
Custom factors for a specific model.