# API 呼叫紀錄

## 功能說明 <a href="#features" id="features"></a>

API 呼叫紀錄提供您透過 MaiAgent API 進行的所有請求的完整記錄，包含 HTTP 方法、端點路徑、狀態碼、回應時間、請求與回應內容等資訊。適合開發人員在串接 API 時進行除錯、效能監控與用量追蹤。

<figure><img src="/files/cdVcGrUVwqlorhr2z2Vh" alt=""><figcaption><p>API 呼叫紀錄頁面</p></figcaption></figure>

***

## 查看紀錄 <a href="#view-log" id="view-log"></a>

在左側選單點選 <mark style="color:blue;">開發者</mark> → <mark style="color:blue;">API 呼叫紀錄</mark>，即可查看所有 API 請求的記錄列表。

### 記錄欄位說明 <a href="#log-fields" id="log-fields"></a>

| 欄位                | 說明                                            |
| ----------------- | --------------------------------------------- |
| **ID**            | 請求的唯一識別碼                                      |
| **Method**        | HTTP 方法（GET、POST、PUT、DELETE、PATCH），以不同顏色標示    |
| **Endpoint**      | API 端點路徑                                      |
| **Status Code**   | HTTP 回應狀態碼，依類型顏色標示：2xx（綠色）、4xx（橘色）、5xx（紅色）    |
| **Duration**      | 請求耗時，依速度顏色標示：<100ms（綠色）、<500ms（橘色）、>500ms（紅色） |
| **Request Body**  | 請求內容預覽                                        |
| **Response Body** | 回應內容預覽                                        |
| **IP Address**    | 發送請求的來源 IP                                    |
| **Time**          | 請求時間                                          |

***

## 篩選與搜尋 <a href="#filter-and-search" id="filter-and-search"></a>

使用頂部的篩選列快速找到需要的紀錄：

* **日期範圍**：選擇起始與結束日期，查看特定時段的紀錄
* **HTTP Method**：依方法篩選（GET、POST、PUT、DELETE、PATCH）
* **狀態類別**：依回應狀態篩選（2xx 成功、4xx 客戶端錯誤、5xx 伺服器錯誤）
* **關鍵字搜尋**：輸入端點路徑或其他關鍵字搜尋

{% hint style="info" %}
排查 API 串接問題時，建議先篩選 4xx 或 5xx 狀態碼，快速定位失敗的請求。
{% endhint %}

***

## 查看請求詳情 <a href="#request-detail" id="request-detail"></a>

在記錄列表中，點擊任一筆紀錄右側的檢視圖示，即可展開完整的請求與回應詳情，包含完整的 Request Body 和 Response Body，方便開發人員除錯。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.maiagent.ai/developer/api-logs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
