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

# Search Credits Change History

## Response Example

```json theme={null}
{
  "items": [
    {
      "id": "e6b088e3-791c-4a1c-bb14-198f0867f368",
      "serviceName": "chat",
      "apiPath": "/v1/chat/completions",
      "apiMethod": "POST",
      "finalAmount": 10,
      "beforeCredits": 9950,
      "afterCredits": 9940,
      "traceId": "1d110e91-9d69-4325-bd42-b55583ae6dc5",
      "createdAt": "2025-09-11T02:05:05.225Z"
    }
  ],
  "meta": {
    "totalItems": 128,
    "itemCount": 10,
    "itemsPerPage": 10,
    "totalPages": 13,
    "currentPage": 1
  }
}
```

### Response Fields

#### `items[]` — Credits Change Records

| Field           | Type   | Description                          |
| --------------- | ------ | ------------------------------------ |
| `id`            | string | Record ID (UUID)                     |
| `serviceName`   | string | Service name (e.g. `chat`, `gemini`) |
| `apiPath`       | string | API request path                     |
| `apiMethod`     | string | HTTP method                          |
| `finalAmount`   | number | Credits deducted for this request    |
| `beforeCredits` | number | Credits balance before deduction     |
| `afterCredits`  | number | Credits balance after deduction      |
| `traceId`       | string | Request trace ID                     |
| `createdAt`     | string | Created time (ISO 8601)              |

#### `meta` — Pagination Info

| Field          | Type   | Description                       |
| -------------- | ------ | --------------------------------- |
| `totalItems`   | number | Total number of records           |
| `itemCount`    | number | Number of records on current page |
| `itemsPerPage` | number | Page size                         |
| `totalPages`   | number | Total number of pages             |
| `currentPage`  | number | Current page number               |

<Info>
  The `dateRange` parameter is required. The maximum date range span is **90 days**. Timestamps are in **milliseconds**.
</Info>

<Tip>
  The difference between `beforeCredits` and `afterCredits` equals `finalAmount`.
</Tip>


## OpenAPI

````yaml POST /api-user/points/search
openapi: 3.0.0
info:
  title: OneAI User Open API
  description: |-
    通过 API Key 调用的开放接口。

    认证方式：在请求头中添加 `X-API-Key: <your-key>`，或通过查询参数 `?key=<your-key>` 传递。
  version: '1.0'
  contact: {}
servers:
  - url: https://dk.mountsea.ai
    description: API Gateway
security: []
tags: []
paths:
  /api-user/points/search:
    post:
      tags:
        - User Open API
      summary: 查询积分变动记录
      operationId: ApiUserController_searchPoints
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpenSearchPointsDto'
      responses:
        '201':
          description: ''
      security:
        - api-key: []
components:
  schemas:
    OpenSearchPointsDto:
      type: object
      properties:
        page:
          type: number
          description: 页码
          default: 1
        limit:
          type: number
          description: 每页条数
          default: 10
        dateRange:
          description: 日期范围（毫秒时间戳，最大跨度90天）
          allOf:
            - $ref: '#/components/schemas/OpenDateRangeDto'
        serviceId:
          type: string
          description: 服务ID（可选，不传则查全部）
      required:
        - dateRange
    OpenDateRangeDto:
      type: object
      properties:
        start:
          type: number
          minimum: 0
          description: 开始时间（毫秒时间戳）
          example: 1767801600000
        end:
          type: number
          minimum: 0
          description: 结束时间（毫秒时间戳）
          example: 1773071999999
      required:
        - start
        - end
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: X-API-Key

````