Track monthly OpenAI token usage with Google Sheets and Gmail reports
Ready for 3.0What this workflow does
This workflow has 9 nodes and runs on a schedule (every month). Along the way it connects Google Sheets, Google Drive and Gmail. It also calls api.openai.com over HTTP.
How it runs
Trigger: On a schedule (every month).
- Create Monthly Report from Template (Google Drive): copy
- Fetch OpenAI Usage Data (HTTP Request): calls api.openai.com
- Transform Usage to Daily Breakdown (Code): runs custom JavaScript code
- Append Data to Google Sheet (Google Sheets): append
- Export Sheet as Excel (Google Drive): download
- Export Sheet as PDF for Email (Google Drive): download
- Archive Report to Drive (Google Drive): uses Google Drive
- Email Report to Stakeholder (Gmail): uses Gmail
Services it uses
HTTP calls to: api.openai.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (6)
- HTTP Request
n8n-nodes-base.httpRequest - Code
n8n-nodes-base.code - Google Sheets
n8n-nodes-base.googleSheets - Google Drive
n8n-nodes-base.googleDrive - Gmail
n8n-nodes-base.gmail - Schedule Trigger
n8n-nodes-base.scheduleTrigger
From the author
Who's this for Finance teams, AI developers, product managers, and business owners who need to monitor and control OpenAI API costs across different models and projects. If you're using GPT-4, GPT-3.5, or other OpenAI models and want to track spending…