Quick overview
This workflow runs twice daily to fetch remaining credits and usage from FAL AI, OpenRouter, and Apify, then compiles a formatted spend report and sends it to a Telegram chat.
How it works
- Runs on a schedule at two specific times each day using a Schedule Trigger node configured for 10:30 and 20:02 IST.
- Requests your current credit balance from the FAL AI billing endpoint with authorization headers.
- Fetches total credits and total usage from the OpenRouter credits API with bearer authentication.
- Retrieves your monthly usage details from the Apify usage API, including used and plan limits in USD, via a token query parameter.
- Passes all API responses into a JavaScript Code node that safely extracts balances, computes available amounts, and assembles a structured HTML report string.
- Sends the final report as a Telegram message to your chosen chat ID, using HTML parse mode and a link to a Google Sheets expense log.
Setup
- Add your FAL AI, OpenRouter, and Apify API keys by updating the Authorization headers and token query parameter in the three HTTP Request nodes.
- Connect a Telegram account credential in n8n and set the target Telegram chat ID in the Telegram node.
- Adjust the scheduled run times (and the report timezone, if needed) so the daily spend report arrives when you want it.