curl --location --request GET 'https://staging-api.formi.co.in/v2/usage/credits?start_date=2025-06-02&end_date=2025-06-02' \
--header 'token: abc-test-1234'
Example Response:
{
"success": true,
"message": "Credits fetched successfully",
"payload": {
"agents": [
{
"agent_id": 101,
"credits_type": "MINUTE_BASED",
"filtered_credit_usage": {
"from_date": "2023-11-01",
"to_date": "2023-11-30",
"credit_usage": 450.75
},
"available_credits": 549.25,
"total_recharge": 2000.0,
"total_usage": 1450.75
}
]
}
}
Field Descriptions:
agent_id (integer): The unique ID of the agent.
credits_type (string): The billing method for this agent. See definitions below.
filtered_credit_usage (object): An object detailing usage within the requested date range.
available_credits (float): The current remaining credit balance for the agent.
total_recharge (float): The sum of all credit refills for the agent in the specified period.
total_usage (float): The sum of all credit transactions for the agent.