> ## Documentation Index
> Fetch the complete documentation index at: https://mind-e.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Credit History

> Get a paginated list of credit transactions.

## Endpoint

```
GET /credits/history
```

## Authentication

Required.

## Query parameters

<ParamField query="limit" type="number">
  Number of transactions to return. Default: `50`, max: `100`.
</ParamField>

<ParamField query="offset" type="number">
  Number of transactions to skip. Default: `0`.
</ParamField>

<ParamField query="agentId" type="string">
  Filter by agent ID.
</ParamField>

<ParamField query="type" type="string">
  Filter by transaction type: `usage`, `purchase`, `bonus`, `refund`, or `adjustment`.
</ParamField>

<ParamField query="feature" type="string">
  Filter by feature (e.g., `chat`, `tts`).
</ParamField>

<ParamField query="startDate" type="string">
  Filter from this date (ISO 8601).
</ParamField>

<ParamField query="endDate" type="string">
  Filter until this date (ISO 8601).
</ParamField>

## Response

<ResponseField name="success" type="boolean" />

<ResponseField name="transactions" type="array">
  <Expandable>
    <ResponseField name="id" type="string">Transaction ID</ResponseField>
    <ResponseField name="agentId" type="string">Agent ID (if applicable)</ResponseField>
    <ResponseField name="type" type="string">Transaction type</ResponseField>
    <ResponseField name="amount" type="number">Credits consumed (negative) or added (positive)</ResponseField>
    <ResponseField name="balanceAfter" type="number">Balance after this transaction</ResponseField>
    <ResponseField name="feature" type="string">Feature that consumed credits</ResponseField>
    <ResponseField name="metadata" type="object">Additional details including breakdown and source</ResponseField>
    <ResponseField name="createdAt" type="string">ISO 8601 timestamp</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="pagination" type="object">
  <Expandable>
    <ResponseField name="total" type="number">Total number of transactions</ResponseField>
    <ResponseField name="limit" type="number">Current page size</ResponseField>
    <ResponseField name="offset" type="number">Current offset</ResponseField>
    <ResponseField name="hasMore" type="boolean">Whether there are more results</ResponseField>
    <ResponseField name="nextOffset" type="number">Offset for the next page (null if no more)</ResponseField>
  </Expandable>
</ResponseField>

## Example

```bash theme={null}
curl "https://api.mind-e.co/credits/history?limit=10&type=usage" \
  -H "Authorization: Bearer sk_live_your_key_here"
```
