๐ŸŽฏ Email weekly AI agent cost and token reports with Alephant and Gmail

โšก 10 views ยท ๐ŸŽฏ AI Summarization & Classification

Description

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

  1. Runs on a weekly schedule (Monday at 9 AM).
  2. Fetches the last 7 days of usage data from Alephant AI Gateway Analytics, including cost, request count, token totals, and period-over-period changes.
  3. Applies a configured recipient email address for the report.
  4. 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.
  5. Sends the report email through Gmail to the configured recipient.

Setup

  1. Install the Alephant Analytics community node (@alephantai/n8n-nodes-alephant-analytics) in your n8n instance.
  2. Create and select an Alephant Virtual Key credential to allow the workflow to read usage summaries from your Alephant workspace.
  3. Connect a Gmail OAuth2 credential and ensure the Gmail account is allowed to send email.
  4. 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

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

๐Ÿ”— Nodes Used

Gmail, Schedule Trigger

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup