curl "https://agentgate.mynewapi.com/v1/credits/usage?startDate=2024-01-01&tenantId=acme-corp" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"transactions": [
{
"id": "txn_abc123",
"type": "deduction",
"amount": 150,
"runId": "run_xyz789",
"tenantId": "acme-corp",
"tenantUserId": "user_123",
"createdAt": "2024-01-15T10:35:00Z"
},
{
"id": "txn_abc122",
"type": "purchase",
"amount": 10000,
"createdAt": "2024-01-01T00:00:00Z"
}
],
"total": 25,
"limit": 50,
"offset": 0
}
Credits
Get Usage History
Get credit transaction history
GET
/
v1
/
credits
/
usage
curl "https://agentgate.mynewapi.com/v1/credits/usage?startDate=2024-01-01&tenantId=acme-corp" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"transactions": [
{
"id": "txn_abc123",
"type": "deduction",
"amount": 150,
"runId": "run_xyz789",
"tenantId": "acme-corp",
"tenantUserId": "user_123",
"createdAt": "2024-01-15T10:35:00Z"
},
{
"id": "txn_abc122",
"type": "purchase",
"amount": 10000,
"createdAt": "2024-01-01T00:00:00Z"
}
],
"total": 25,
"limit": 50,
"offset": 0
}
string
Filter by start date (ISO 8601).
string
Filter by end date (ISO 8601).
string
Filter by tenant ID.
string
Filter by tenant user ID.
string
Filter by transaction type:
deduction, purchase, refund.integer
default:50
Results per page (max 100).
integer
default:0
Number of results to skip.
array
Array of credit transactions.
integer
Total number of matching transactions.
curl "https://agentgate.mynewapi.com/v1/credits/usage?startDate=2024-01-01&tenantId=acme-corp" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"transactions": [
{
"id": "txn_abc123",
"type": "deduction",
"amount": 150,
"runId": "run_xyz789",
"tenantId": "acme-corp",
"tenantUserId": "user_123",
"createdAt": "2024-01-15T10:35:00Z"
},
{
"id": "txn_abc122",
"type": "purchase",
"amount": 10000,
"createdAt": "2024-01-01T00:00:00Z"
}
],
"total": 25,
"limit": 50,
"offset": 0
}