Configure your usage
Adjust the sliders to match how you use Claude. Estimates assume prompt caching is active (which Claude Code uses automatically).
Claude Code caches CLAUDE.md, MCP schemas, and system prompts automatically. Higher cache rate = cheaper API costs.
Adjust the sliders to see your estimate.
Track it live in your terminal
Terminal setup guide →Add this snippet to your Claude Code statusline command to see the estimated API cost update in real time as you work — so you know exactly what you're saving each session.
# In your statusline command (receives JSON via stdin):
input=$(cat)
model_id=$(echo "$input" | jq -r '.model.id // empty')
total_input=$(echo "$input" | jq -r '.context_window.total_input_tokens // 0')
total_output=$(echo "$input" | jq -r '.context_window.total_output_tokens // 0')
cache_write=$(echo "$input" | jq -r '.context_window.current_usage.cache_creation_input_tokens // 0')
cache_read=$(echo "$input" | jq -r '.context_window.current_usage.cache_read_input_tokens // 0')
# Pricing lookup (per million tokens: input / output / cache-write / cache-read)
case "$model_id" in
*opus-4*) ip=15; op=75; cwp="18.75"; crp="1.5" ;;
*sonnet-4*) ip=3; op=15; cwp="3.75"; crp="0.3" ;;
*haiku-4*) ip=0.8; op=4; cwp="1.0"; crp="0.08" ;;
*) ip=3; op=15; cwp="3.75"; crp="0.3" ;;
esac
cost=$(awk "BEGIN {printf \"%.2f\", ($total_input*$ip + $total_output*$op + \
$cache_write*$cwp + $cache_read*$crp)/1000000}")
echo "~\$$cost"
Paste this into your ~/.claude/statusline-command.sh. Claude Code pipes JSON with cumulative token counts to the statusline command on every render.