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

# Introduction

# 用量与积分简介

欢迎使用**用量与积分**服务文档！

本服务提供开放 API，用于查询您账户的**积分余额**、**API 使用日志**和**积分变动历史**。您可以通过编程方式监控消耗量，并将账单数据集成到您自己的系统中。

## 认证方式

所有端点都需要通过 **API Key** 进行认证。您可以通过以下两种方式传递：

| 方式       | 示例                        |
| -------- | ------------------------- |
| **请求头**  | `X-API-Key: your-api-key` |
| **查询参数** | `?key=your-api-key`       |

<Warning>
  请妥善保管您的 API Key。不要在客户端代码或公开仓库中暴露它。
</Warning>

## 功能特性

* **积分余额** — 实时查询您当前的积分余额。
* **服务列表** — 获取所有可用服务及其 ID，用于筛选。
* **API 使用日志** — 搜索详细的 API 调用记录，包括状态码、消耗积分、追踪 ID 和元数据。
* **积分变动历史** — 查看积分扣减详情，包含扣减前后余额和扣减金额。

## 可用端点

| 端点                        | 方法   | 描述          |
| ------------------------- | ---- | ----------- |
| `/api-user/credits`       | GET  | 查询当前积分余额    |
| `/api-user/services`      | GET  | 列出可用服务      |
| `/api-user/usage/search`  | POST | 搜索 API 使用日志 |
| `/api-user/points/search` | POST | 搜索积分变动历史    |

## 快速开始

### 查询积分余额

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl https://dk.mountsea.ai/api-user/credits \
      -H "X-API-Key: your-api-key"
    ```

    **响应：**

    ```json theme={null}
    {
      "credits": 10000
    }
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import requests

    headers = {"X-API-Key": "your-api-key"}
    resp = requests.get("https://dk.mountsea.ai/api-user/credits", headers=headers)
    print(resp.json())
    # {"credits": 10000}
    ```
  </Tab>

  <Tab title="Node.js">
    ```javascript theme={null}
    const resp = await fetch("https://dk.mountsea.ai/api-user/credits", {
      headers: { "X-API-Key": "your-api-key" }
    });
    const data = await resp.json();
    console.log(data);
    // { credits: 10000 }
    ```
  </Tab>
</Tabs>

### 搜索积分变动历史

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST https://dk.mountsea.ai/api-user/points/search \
      -H "X-API-Key: your-api-key" \
      -H "Content-Type: application/json" \
      -d '{
        "dateRange": {
          "start": 1767801600000,
          "end": 1773071999999
        },
        "page": 1,
        "limit": 10
      }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import requests

    headers = {
        "X-API-Key": "your-api-key",
        "Content-Type": "application/json"
    }
    body = {
        "dateRange": {
            "start": 1767801600000,
            "end": 1773071999999
        },
        "page": 1,
        "limit": 10
    }
    resp = requests.post(
        "https://dk.mountsea.ai/api-user/points/search",
        headers=headers,
        json=body
    )
    print(resp.json())
    ```
  </Tab>

  <Tab title="Node.js">
    ```javascript theme={null}
    const resp = await fetch("https://dk.mountsea.ai/api-user/points/search", {
      method: "POST",
      headers: {
        "X-API-Key": "your-api-key",
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        dateRange: { start: 1767801600000, end: 1773071999999 },
        page: 1,
        limit: 10
      })
    });
    const data = await resp.json();
    console.log(data);
    ```
  </Tab>
</Tabs>

***

### 浏览 API 文档

* [查询积分余额](credits) — 查看您当前的积分
* [列出服务](services) — 获取服务 ID 用于筛选
* [搜索 API 使用日志](usage-search) — 查看 API 调用历史
* [搜索积分变动历史](points-search) — 查看积分扣减详情
