Run this command in your terminal to submit your usage:
npx ccusage@latest monthly --json | curl -X POST \
"https://burnrate.autonomoustech.ca/api/usage/submit" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Machine-Id: $(hostname -s)" \
-d @-
Automatically submit your usage every time a Claude Code session ends.
mkdir -p ~/.claude/hooks/scripts
This script runs ccusage and sends the data to burnrate.
API_KEY="YOUR_API_KEY"
MACHINE_ID=$(hostname -s)
npx ccusage@latest monthly --json | curl -s -X POST \
"https://burnrate.autonomoustech.ca/api/usage/submit" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-H "X-Machine-Id: $MACHINE_ID" \
-d @-
Save this as ~/.claude/hooks/scripts/burnrate.sh, then make it executable:
chmod +x ~/.claude/hooks/scripts/burnrate.sh
Add this to your ~/.claude/settings.json to run the script on every session end:
{
"hooks": {
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/scripts/burnrate.sh",
"timeout": 120
}
]
}
]
}
}
Run the script manually to make sure it works:
~/.claude/hooks/scripts/burnrate.sh