Quick overview
This workflow runs every Monday at 9 AM to pull a 7‑day usage summary from Alephant AI Gateway, calculates key metrics for AI Agents like total cost and tokens, and emails a formatted cost and usage report to a recipient via Gmail.
How it works
- Runs on a weekly schedule (Monday at 9 AM).
- Fetches the last 7 days of usage data from Alephant AI Gateway Analytics, including cost, request count, token totals, and period-over-period changes.
- Applies a configured recipient email address for the report.
- Formats the Alephant usage summary into a plain-text email with total cost (converted from cents), total requests, total tokens, and week-over-week trends.
- Sends the report email through Gmail to the configured recipient.
Setup
- Install the Alephant Analytics community node (@alephantai/n8n-nodes-alephant-analytics) in your n8n instance.
- Create and select an Alephant Virtual Key credential to allow the workflow to read usage summaries from your Alephant workspace.
- Connect a Gmail OAuth2 credential and ensure the Gmail account is allowed to send email.
- Update the recipient email value in the report configuration step and adjust the schedule if you want a different send time or cadence.
Requirements
Customization
- Change the schedule to daily or hourly by editing the Schedule Trigger interval
- Swap the Gmail node for Slack, Discord, or Send Email (SMTP) to deliver the report elsewhere
- Adjust the Usage Summary period (e.g. 24 Hours or 30 Days) to change the reporting window
- Add a second Alephant Analytics node with the Cost by Model operation to include a per-model spend breakdown
Additional info
Who's it for: Teams running production AI agents - autonomous workflows that call AI models on their own and can quietly run up cost that only surfaces on the invoice. Also useful for solo AI developers and AI-first startups who want a regular, automatic read on their AI spend without logging into a dashboard.
Documentation: https://developers.alephant.io