> ## 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.

# 搜索积分变动历史

## 响应示例

```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
  }
}
```

### 响应字段

#### `items[]` — 积分变动记录

| 字段              | 类型     | 描述                      |
| --------------- | ------ | ----------------------- |
| `id`            | string | 记录 ID（UUID）             |
| `serviceName`   | string | 服务名称（如 `chat`、`gemini`） |
| `apiPath`       | string | API 请求路径                |
| `apiMethod`     | string | HTTP 方法                 |
| `finalAmount`   | number | 本次请求扣减的积分               |
| `beforeCredits` | number | 扣减前积分余额                 |
| `afterCredits`  | number | 扣减后积分余额                 |
| `traceId`       | string | 请求追踪 ID                 |
| `createdAt`     | string | 创建时间（ISO 8601）          |

#### `meta` — 分页信息

| 字段             | 类型     | 描述     |
| -------------- | ------ | ------ |
| `totalItems`   | number | 总记录数   |
| `itemCount`    | number | 当前页记录数 |
| `itemsPerPage` | number | 每页大小   |
| `totalPages`   | number | 总页数    |
| `currentPage`  | number | 当前页码   |

<Info>
  `dateRange` 参数是必填的。最大日期范围跨度为 **90 天**。时间戳单位为**毫秒**。
</Info>

<Tip>
  `beforeCredits` 和 `afterCredits` 之间的差值等于 `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

````