Skip to content

Credit Consumption Totals

Request

The Credit Consumption Totals endpoint calculates the total amount of credits spent during a specified timeframe. It returns the sum of all credit changes that have been made to the subscription balance during the given period. This endpoint is useful for tracking and analyzing credit consumption patterns, monitoring usage, and ensuring proper subscription management.

Security
Api-Key
Path
account_idintegerrequired
Query
date_created_endstring, (date-time)
date_created_startstring, (date-time)
curl -i -X GET \
  'https://api-v2.forager.ai/api/{account_id}/subscriptions/balance_change_logs/totals/?date_created_end=2019-08-24T14%3A15%3A22Z&date_created_start=2019-08-24T14%3A15%3A22Z' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

Bodyapplication/json
total_credits_spentstring, (decimal)^-?\d{0,10}(?:\.\d{0,2})?$required
Response
{ "total_credits_spent": "string" }