🧠 Weekly Cost Report
Generate the weekly LLM API cost report, render it to PDF, post to Discord, and commit.
Steps
- Refresh usage data — Run:
python3 /home/openclaw/.openclaw/agents/root/workspace/scripts/usage_summary.py --all - Generate the Markdown report — Run:
bash /home/openclaw/.openclaw/agents/root/workspace/scripts/generate_cost_report.shThe script prints the path of the generated
.mdfile. - Render to HTML — Use the
md_to_htmltool:input_path: the MD file path from step 2output_path: same path but.htmlextensiontemplate_path:/home/openclaw/git/octo/agents/root/reports/api-cost/template.html
- Render to PDF — Use the
html_to_pdftool:input_path: the HTML file from step 3output_path: same path but.pdfextension
- Post to Discord — Use the
messagetool with only these parameters:action:"send"target:"channel:1480763223392260116"message: brief summary text (date range, total cost, daily average)media: the PDF file path (e.g./home/openclaw/git/octo/agents/root/reports/api-cost/2026-06-15.pdf)mimeType:"application/pdf"filename: e.g."2026-06-15-weekly-llm-cost-report.pdf"
Do not include any poll-related fields (
pollDurationHours,pollOption,pollMulti, etc.) — their presence causes the tool to reject the call with a “Poll fields require action poll” error even when empty. - Commit and push — Run:
cd /home/openclaw/git/octo && git add agents/root/reports/api-cost/ && git commit -m 'chore: weekly cost report' && git push