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

# Introduction to Usage & Credits

Welcome to the **Usage & Credits** service documentation!

This service provides open APIs for querying your account's **credits balance**, **API usage logs**, and **credits change history**. You can programmatically monitor your consumption and integrate billing data into your own systems.

## Authentication

All endpoints require authentication via **API Key**. You can pass it in one of two ways:

| Method              | Example                   |
| ------------------- | ------------------------- |
| **Request Header**  | `X-API-Key: your-api-key` |
| **Query Parameter** | `?key=your-api-key`       |

<Warning>
  Keep your API Key secure. Do not expose it in client-side code or public repositories.
</Warning>

## Features

* **Credits Balance** — Query your current credits balance in real time.
* **Service List** — Retrieve all available services and their IDs for filtering.
* **API Usage Logs** — Search detailed API call records including status codes, consumed credits, trace IDs, and metadata.
* **Credits Change History** — View credits deduction details with before/after balances and deducted amounts.

## Available Endpoints

| Endpoint                  | Method | Description                   |
| ------------------------- | ------ | ----------------------------- |
| `/api-user/credits`       | GET    | Query current credits balance |
| `/api-user/services`      | GET    | List available services       |
| `/api-user/usage/search`  | POST   | Search API usage logs         |
| `/api-user/points/search` | POST   | Search credits change history |

## Quick Start

### Query Credits Balance

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

    **Response:**

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

### Search Credits Change History

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

***

### Explore the API Documentation

* [Query Credits Balance](credits) — Check your current credits
* [List Services](services) — Get service IDs for filtering
* [Search API Usage Logs](usage-search) — View API call history
* [Search Credits Change History](points-search) — View credits deduction details
