OpenAI has introduced the Usage API, an API that allows enterprises to track their activity across the OpenAI API. With the Usage API, OpenAI API usage and costs can be assessed programmatically, the company said.
Announced December 4, the OpenAI Usage API monitors token usage by minute, hour, or day and filters usage data by factors such as model, API key, project ID, and user ID. Users can check daily spending via a costs endpoint for budget oversight. The Usage API, OpenAI said, is built for scalability, security, and compliance, for enterprise teams to manage costs, optimize workflows, and make quicker decisions.
While the Usage API delivers granular usage data, it may not always reconcile perfectly with costs due to minor differences in how usage and spend are recorded, OpenAI said. For financial purposes, OpenAI recommends using the Costs endpoint or the Costs tab in the Usage Dashboard, which will reconcile back to a billing invoice.