Перейти к содержанию
НОВОЕМаркетплейс и trig8n Agent: продавайте то, что создали, и получайте планы и изменения, проверенные до того, как вы их увидите. Что нового

Библиотека / Мониторинг, эксплуатация и инциденты

Мониторинг, эксплуатация и инциденты

Учёт расхода токенов и затрат ИИ-агентов в Sheets

При вызове или запуске читает данные выполнения из API n8n, извлекает расход токенов для Claude, OpenAI, Gemini и OpenRouter и записывает ориентировочные затраты в Google Sheets.

Что делает

## Limitations ### 1. This workflow doesn't account for Prompt caching If you're consecutively sending similar prompts to OpenAI it'll automatically use Cached Tokens to reduce the cost of your requests. So our cost estimates will have a higher value than the actual cost. Other providers like Anthropic and Google have similar mechanisms. ### 2. Not tested with audio or video files This workflow was tested with text and images, but no tests were made with audio files or videos. ### 3. The cost is an estimate In the spreadsheet you can see the total cost of the requests, but that is only an estimate. If you do batch requests, prompt caching or other techniques to reduce cost, the estimate might be higher than the actual cost.

Шаги

  1. When clicking ‘Test workflow’
  2. AI Agent
  3. Call sub-workflow
  4. Think
  5. Extract token usage data
  6. Get execution data
  7. When Executed by Another Workflow
  8. Split Out
  9. Sum Token Totals - aggregate by model
  10. Record token usage
  11. Gemini
  12. OpenAI
  13. Anthropic

Похожие автоматизации