# Get User’s Credit Usage

<mark style="color:blue;">`POST`</mark> `/users/{user_id}/credits/usage`

### **Overview**

Retrieves **a list of credit usage records** for a specific user.

This endpoint allows clients to track how and when a user’s credits were used, including metadata such as description, amount, and timestamp.

**Typical use cases**

* Displaying a user’s credit usage history
* Auditing credit consumption for a given period&#x20;

### Header

| Name                               | Value              |
| ---------------------------------- | ------------------ |
| Content-Type                       | `application/json` |
| Authorization <sup>(API Key)</sup> | `Bearer <API Key>` |

### Path

| Name      | Description                                                                                                                                                                                                 |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `user_id` | <p>User identifier (user\_id). <br>Optional on create — if not provided, a system-generated ID will be used<br><br><a href="../user/user_id-and-klaim_id" class="button secondary">More description</a></p> |

### Response

{% tabs %}
{% tab title="200" %}

```json
{
    "message": "fetch resource successfully",
    "data": [
        {
            "user_id": "GtQ5Oezk6cOvSmPgxsMR",
            "created_at": 1753317736835,
            "credit_change": 1,
            "credit_balance": 706,
            "source_type": "api",
            "description": "paid for credit"
        }...
    ]
    "lastKey": {
        "prefix_app_id": "_credit-usage_appId1",
        "type_id": "20240213010101_abcde"
    }
}
```

***

### Attributes

<table><thead><tr><th width="222">Attribute</th><th width="128">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>starting_after</code></td><td>Object</td><td>A cursor to use in pagination.<br><br><a href="../other-details/pagination" class="button secondary">Show child attributes</a></td></tr></tbody></table>
{% endtab %}

{% tab title="404" %}
This HTTP status is returned when **no user profile entity is found** for the given userId.

```json
{
    "message": "Can not find user with the given user_id."
}
```

{% endtab %}
{% endtabs %}
