Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Reports, Analytics & Dashboards

Reports, Analytics & Dashboards

Track OpenAI API Usage and Costs in Google Sheets

On a schedule, this pulls token usage and costs from the OpenAI Admin API per project and key and logs them to Google Sheets.

The steps

  1. Schedule Trigger
  2. OpenAI Admin - get token usage
  3. OpenAI Admin - Get cost
  4. Remove Duplicates
  5. Set api_key and project ids
  6. Set api_key id and name
  7. Add api_key name to token usage
  8. Get project_ids
  9. Merge token, usage, projects
  10. Merge token and usage
  11. Structure usage, cost, projects
  12. Split Out api_key and project
  13. Split Out Usage
  14. Split Out Cost

26 steps in total.

Similar automations