Weekly Fireworks AI spend recap to Slack and Sheets

Every Monday at 9am, log last week's Fireworks AI usage to a Google Sheet and post a top-spend summary to Slack with a week-over-week change.

Deterministic Code
Fireworks AIGoogle SheetsSlackFinanceOperationsAI ReportsDaily DigestsNotifications & Alerts

Build me a deterministic weekly Fireworks AI spend recap as a code workflow. It should run every Monday at 9am in the workspace timezone via a cron trigger, with no manual steps.

Workflow inputs I want exposed: (1) slack_channel — the Slack channel to post the recap in, default #ai-spend; (2) spend_threshold_usd — the weekly total spend above which the message gets flagged with a 🚨 emoji; (3) sheet_id and sheet_tab — the Google Sheet and tab that stores the weekly history, default tab name "Fireworks Weekly Usage"; (4) top_n_models — how many models to highlight in the Slack message, default 3.

Step 1: Call the Fireworks AI "Get Billing Usage" operation for the last 7 days (week ending the previous Sunday in workspace timezone), grouped by model. I want rows that include model name, request count, prompt tokens, completion tokens, and rated cost in USD.

Step 2: Before writing anything new, call the Google Sheets "Get Values" operation on the history tab to read the previous week's total rated cost. Use the most recent week_ending_date row(s) already in the sheet. If the sheet is empty, treat the previous total as null so the workflow handles the very first run cleanly.

Step 3: Use the Google Sheets "Append Values" operation to append one row per model returned in step 1 to the "Fireworks Weekly Usage" tab. Column layout: week_ending_date, model, request_count, prompt_tokens, completion_tokens, rated_cost_usd. Pin this column order — the workflow author must not reshuffle it because step 2 reads it back.

Step 4: In code, compute the summary for Slack: total rated cost this week, the top N models by rated cost (default 3) with their cost and share of total, and the absolute + percent week-over-week change in total cost using the value from step 2 (omit the delta line entirely if the previous total is null). Set a flag boolean = (total cost > spend_threshold_usd).

Step 5: Format a short Slack message (mrkdwn, a few lines, no walls of text). Header line should include the week-ending date and total spend, prefixed with 🚨 if the flag is true. Then a "Top models" section listing the top N as `model — $cost (share%)`. Then a "vs last week" line with the signed dollar and percent change, or omit it on the first run. Send via the Slack "Send a Message" operation to {{slack_channel}}.

Constraints: every step is a known node with structured inputs (fireworks-ai Get Billing Usage, google-sheets Get Values + Append Values, slack Send a Message). No LLM nodes, no agent steps — this is a deterministic code workflow. Fail loudly if Fireworks returns no usage rows for the week so we notice silent breakage instead of posting an empty recap.

Additional information

What does this prompt do?
  • Pulls the last 7 days of Fireworks AI usage and rated cost, broken down by model.
  • Appends one row per model to a Google Sheet so you build a clean weekly history.
  • Posts a short Slack digest with the top 3 models by spend and the change versus last week.
  • Adds a flag emoji to the message when total weekly spend exceeds a threshold you set.
What do I need to use this?
  • A Fireworks AI account with billing turned on.
  • A Google Sheet you can append rows to (one tab for the weekly history).
  • A Slack workspace and the channel you want the recap posted in.
  • A weekly spend threshold you want to be alerted above.
How can I customize it?
  • Change the day and time the recap runs (default is Monday at 9am).
  • Pick which Slack channel receives the message and update the spend threshold.
  • Point at a different sheet or tab, or rename the columns to match an existing tracker.
  • Adjust how many models are highlighted in the Slack summary (default is top 3).

Frequently asked questions

Do I need a paid Fireworks AI plan to use this?
Any Fireworks AI account with billing enabled can pull rated usage. If you have not turned billing on, you will not see cost numbers.
Where does the week-over-week comparison come from?
From the Google Sheet itself. Before appending the new rows, the workflow reads the previous week's total back out of the sheet, so the history is the source of truth.
Can I track a specific team, project, or API key instead of the whole account?
Yes. The Fireworks step lets you filter by deployment, API key, or a custom tag, so you can scope the recap to one team or one product.
Can I run this daily instead of weekly?
Yes. Switch the schedule to daily and shorten the lookback window. The sheet keeps a row per run regardless of cadence.
What happens the very first week, when there is no previous total to compare against?
The Slack message simply skips the week-over-week line on the first run and starts comparing from week two onward.

Stop guessing at your AI bill.

Connect Fireworks AI, Google Sheets, and Slack once, and Geni files a clean spend recap every Monday morning.