Skip to main content
Use the account billing and activity endpoints to monitor spend and operational usage. Both endpoints require a provisioning key.

Endpoints at a glance

Why These Endpoints Matter

Use them to:
  • monitor remaining funds before expensive operations
  • analyze usage by model, day, or API key
  • build internal dashboards or budget alerts
  • attribute spend across projects or environments

Get Balance

Response shape:
The balance is returned as a string representing a USD amount.

Get Activity

The activity payload includes:
  • total requests and total cost
  • token usage
  • daily breakdowns
  • top models
  • per-key usage
Use the optional days query parameter to control the lookback window. The supported range is 1-30, with a default of 30. Results are cached briefly for performance, so clients should avoid assuming fully uncached real-time aggregation.

Practical Uses

  • trigger low-balance alerts
  • find the most expensive model families in the last week or month
  • compare production vs staging usage if each environment has its own API key
  • attribute spend back to teams or internal services