Skip to main content
GET
https://agentgate.mynewapi.com
/
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
}
startDate
string
Filter by start date (ISO 8601).
endDate
string
Filter by end date (ISO 8601).
tenantId
string
Filter by tenant ID.
tenantUserId
string
Filter by tenant user ID.
type
string
Filter by transaction type: deduction, purchase, refund.
limit
integer
default:50
Results per page (max 100).
offset
integer
default:0
Number of results to skip.
transactions
array
Array of credit transactions.
total
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
}