Get AI Usage
GET
/api/v1/ai/usage
const url = 'https://indepai.app/api/v1/ai/usage';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://indepai.app/api/v1/ai/usage \ --header 'Authorization: Bearer <token>'Get the authenticated user’s AI usage statistics for the current month, including requests used, limit, and remaining.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”AI usage statistics
Media typeapplication/json
object
success
required
boolean
data
required
object
used
required
Number of AI requests used this month
integer
limit
required
Monthly AI request limit for the current tier
integer
remaining
required
AI requests remaining this month
integer
resetDate
required
When the monthly counter resets
string format: date-time
Example
{ "success": true, "data": { "used": 12, "limit": 50, "remaining": 38, "resetDate": "2024-01-15T10:30:00Z" }}Unauthorized
Media typeapplication/json
object
success
required
Always false for error responses
boolean
error
required
Error type
string
code
Machine-readable error code
string
details
Detailed validation errors
Array<object>
object
path
required
Path to the invalid field
string
message
required
Error message
string
Example
{ "success": false, "error": "Validation error", "code": "VALIDATION_ERROR", "details": [ { "path": "currentAge", "message": "Must be between 18 and 100" } ]}