🔬 Track OpenAI Admin API usage and costs automatically with Google Sheets

⚡ 219 views · 🔬 Document Extraction & Analysis

Description

Overview

This workflow aims to help you and your team track your expenses with OpenAI It automatically collects your OpenAI organization’s API usage and cost data every few days and saves it to a ready-to-use Google Sheets template. It pulls detailed metrics for every project and API key, including token usage, model breakdowns, and costs per line item, making it easy for your team to analyze and track spend over time!

Who is it for

How to get started

How it works

  1. Trigger: The workflow runs automatically on a schedule (every 3 days by default, but you can adjust).
  2. Fetch Data: Calls OpenAI’s Admin API to get all token usage and cost details for the reporting window.
  3. Enrich Data: Resolves project names and API key names for clarity in reports.
  4. Write to Sheets: Appends new usage and cost data to your Google Sheet, with one row per project/key/period.

Google Sheets Template

Notes

Extra

Service

If you need help implementing the template or modifying it, just reach out đź’Ś

đź”— Nodes Used

Google Sheets, HTTP Request, Schedule Trigger

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup