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" \
-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"
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" \
-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": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/scripts/burnrate.sh"
}
]
}
]
}
}
Using an older version of Claude Code? Use this format instead:
{
"hooks": {
"SessionEnd": [
{
"type": "command",
"command": "~/.claude/hooks/scripts/burnrate.sh"
}
]
}
}
Run the script manually to make sure it works:
~/.claude/hooks/scripts/burnrate.sh