# Article Name 3 Ways to Monitor Spending on Your OpenAI Account # Article Summary Explore three practical methods to monitor spending on your OpenAI account and avoid unexpected charges while managing your budget # Original HTML URL on Toriihq.com https://www.toriihq.com/articles/how-to-monitor-spending-openai # Details Keeping tabs on spending in your OpenAI account can save you from surprise bills and wasted credits. It’s easy to lose track when multiple projects, API keys, and models run at once. I’ll walk you through three practical ways to monitor usage, set budgets, and use the billing dashboard, alerts, and quotas so you don’t get hit with an unexpected charge. ## Use OpenAI's UI Here, you'll use the OpenAI web console to view, filter, and export your account usage and invoices so you can track spending without touching the API. ### Open the Usage dashboard - Sign in to the OpenAI dashboard and go to the Usage page (platform.openai.com/account/usage). - The page shows a cost chart and a summary of recent charges, which is the quickest place to spot spikes. ### Pick the date range and basic filters - Use the date selector to choose today, last 7 days, the current billing cycle, or a custom range. - If you want monthly reports, set the custom range to the billing period. - Look at the top-line totals (total spent over your selected range) to get a quick sense of where you stand. ### Break down costs by model, product, or day - Use the breakdown or filter controls to group costs by model, endpoint, or by day. - Scan for expensive models or specific days with big jumps. That shows where to look next. - Click a bar or row (where the UI lets you drill in) to see itemized usage for that day or model. ### Export detailed usage for analysis - From the Usage page, choose the export or download option to get a CSV of detailed usage. - Exported CSVs typically include date, product/model, tokens or compute, and cost - use that in a spreadsheet for charts or internal reporting. - Narrow the date range or filters before exporting if you only need a slice of data. ### Review invoices and payment settings - Open the Billing section (platform.openai.com/account/billing/overview) to find invoices and payment methods. - Download PDF invoices for accounting and match them to your exported usage if you need line-item detail. - Update or add a payment method from the Billing page so charges are processed cleanly. ### Communicate findings and set a routine - Save the CSV and invoice PDFs to your finance folder and share the key numbers with stakeholders. - Run the Usage page monthly (or weekly if spending is high) and export a short report so surprises are rare. OpenAI’s help docs point to these same UI pages (Usage and Billing) for monitoring and exporting billing data - use those pages as your single source of truth in the console. ## Use Torii Rather than interacting with OpenAI directly, you can use Torii [https://www.toriihq.com/], a SaaS Management Platform, to keep an eye on OpenAI expenses. SMPs give teams a centralized place to manage SaaS subscriptions and integrations, making it straightforward to programmatically onboard/offboard users, review subscription details, and more. Instead of performing the manual steps in OpenAI, Torii lets you automate the workflow so the update happens automatically when a specified trigger occurs. Triggers might include a new hire, an employee departure, a contract renewal, or similar events - which can save time when these changes happen often. To monitor spending in OpenAI from within Torii, do the following: ### 1. Sign up for Torii Contact Torii [https://www.toriihq.com/], and ask for your free two-week proof-of-concept. ### 2. Connect your OpenAI account to Torii After your Torii account is active, link OpenAI to Torii (assuming you already have an OpenAI account). Here are the instructions for the OpenAI integration [https://support.toriihq.com/hc/en-us/articles/32590037715739-OpenAI-Integration]. ### 3. Create a Torii workflow for OpenAI Inside Torii you can build automated workflows to track OpenAI spend. Go to the Workflows tab, define a trigger, and configure an action that monitors OpenAI costs. Whenever the trigger is activated, the workflow will run and update OpenAI so. ## Use OpenAI's API Here, you'll call OpenAI's billing and usage endpoints to pull spending data and check remaining credits programmatically. ### 1. Choose the billing endpoints to call - GET /v1/usage?startdate=YYYY-MM-DD&enddate=YYYY-MM-DD - gives usage totals over a date range and usually a per-day breakdown. - GET /v1/dashboard/billing/subscription - returns plan and billing-cycle details. - GET /v1/dashboard/billing/creditgrants - returns free-credit grants and remaining credit balances. Use these three endpoints together to get raw spend, plan details, and any credits that reduce your net cost. ### 2. Make authenticated requests - Set your API key in an environment variable, for example OPENAIAPIKEY. Example curl for usage (replace dates and your env var as needed): Example curl for subscription: Example curl for credit grants: ### 3. Parse the responses and convert units - The usage endpoint typically returns a total field and per-day entries. Confirm the field names in the OpenAI docs for your version. - Amounts are commonly reported in cents or smallest currency units. If the endpoint returns totalusage in cents, convert to dollars with totalusage / 100. - If the response includes a daily list, sum that list to verify the total. Example in Python to sum per-day amounts (assumes each item has totalusage in cents): ### 4. Check credits and subscription details - Call the subscription endpoint to see billing cycle, plan limits, and any soft limits. Use that to map usage to expected billing windows. - Call the credit grants endpoint to see granted credit amounts and remaining credit. Subtract applicable credits from total usage to get net spend. Example: ### 5. Handle pagination and rate limits - If the usage response paginates, follow the response’s pagination fields (for example a hasmore flag or a next cursor) and request until done. - Respect 429 responses: back off, then retry. Use exponential backoff for retries. ### 6. Automate daily checks and simple alerts - Run the usage query for yesterday each morning to catch unexpected daily spikes. Fetch subscription and credit endpoints once per billing cycle or when values change. - Calculate rolling totals (7-, 30-day) by querying the usage endpoint with different date ranges and compare to your budget thresholds. - If totals exceed thresholds, trigger an alert from your system. The API calls above are the only OpenAI steps needed to get the data for those checks. ### 7. Verify results against the dashboard periodically Use the same date ranges and compare the API totals to billing reports in the OpenAI docs or dashboard endpoints to confirm your parsing and unit conversions are correct. If numbers don’t match, re-check which fields represent cents vs. Dollars and whether credits were applied. That’s the flow: call the usage endpoint for raw spend, pull subscription and credit endpoints to adjust for plan and grants, parse and convert amounts, handle pagination and rate limits, and run these checks on a schedule to catch surprises.