Templates / Track OpenAI Admin API usage and costs automatically with Google Sheets

Track OpenAI Admin API usage and costs automatically with Google Sheets

Ready for 3.0

by Agent Studio ✓ · 292 views · created 2025-07-14 · Document Extraction

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This workflow has 26 nodes and runs on a schedule (every day). Along the way it connects Google Sheets.

How it runs

Trigger: On a schedule (every day).

  1. OpenAI Admin - Get cost (HTTP Request): calls an HTTP API
  2. OpenAI Admin - get token usage (HTTP Request): calls an HTTP API
  3. Merge: merges the data from its input branches
  4. Set api_key and project ids (Edit Fields (Set)): sets or maps fields
  5. Merge: merges the data from its input branches
  6. Get project_ids (Code): runs custom JavaScript code
  7. Merge: merges the data from its input branches
  8. Split Out: splits a list into separate items
  9. Add api_key name to token usage (Code): runs custom JavaScript code
  10. OpenAI Admin - Get Project details (HTTP Request): calls an HTTP API

…plus 15 more steps. See the full node list below.

Services it uses

Google Sheets

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.

Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.

Nodes used (8)

From the author

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…

Excerpt from Agent Studio's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.