> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/org/developer/api-logs.md).

# API 呼叫紀錄

查看所有透過 API 呼叫 MaiAgent 服務的完整記錄，包含請求內容、回應結果與效能數據

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

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

***

## 查看紀錄 <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>

| 欄位                                       | 說明                                                               |
| ---------------------------------------- | ---------------------------------------------------------------- |
| <mark style="color:blue;">ID</mark>      | 請求的唯一識別碼，可點選複製                                                   |
| <mark style="color:blue;">方法</mark>      | HTTP 方法（GET、POST、PUT、DELETE、PATCH），以不同顏色標示                       |
| <mark style="color:blue;">端點</mark>      | API 端點路徑                                                         |
| <mark style="color:blue;">狀態碼</mark>     | HTTP 回應狀態碼，依類型顏色標示：2xx（綠色）、4xx（橘色）、5xx（紅色）                       |
| <mark style="color:blue;">延遲</mark>      | 請求耗時，依速度顏色標示：100ms 以下（綠色）、100～500ms（橘色）、500ms 以上（紅色）；超過 1 秒時以秒顯示 |
| <mark style="color:blue;">請求 Body</mark> | 請求內容預覽                                                           |
| <mark style="color:blue;">回應 Body</mark> | 回應內容預覽                                                           |
| <mark style="color:blue;">IP</mark>      | 發送請求的來源 IP                                                       |
| <mark style="color:blue;">時間</mark>      | 請求時間                                                             |

***

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

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

* <mark style="color:blue;">日期範圍</mark>：選擇起始與結束日期，查看特定時段的紀錄
* <mark style="color:blue;">方法</mark>：依 HTTP 方法篩選（GET、POST、PUT、DELETE、PATCH），預設為 <mark style="color:blue;">全部方法</mark>
* <mark style="color:blue;">狀態分類</mark>：依回應狀態篩選（<mark style="color:blue;">2xx 成功</mark>、<mark style="color:blue;">4xx 客戶端錯誤</mark>、<mark style="color:blue;">5xx 伺服器錯誤</mark>），預設為 <mark style="color:blue;">全部狀態碼</mark>
* <mark style="color:blue;">搜尋</mark>：輸入端點、金鑰名稱或 IP 搜尋

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

***

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

在記錄列表中，點擊任一筆紀錄右側的檢視圖示，開啟 <mark style="color:blue;">查看詳情</mark> 視窗，方便開發人員除錯：

* <mark style="color:blue;">基本資訊</mark>：請求 ID、時間、方法、狀態碼、延遲、IP 位址、端點與 User-Agent
* <mark style="color:blue;">請求 Headers</mark>、<mark style="color:blue;">請求 Body</mark>：完整的請求內容
* <mark style="color:blue;">回應 Headers</mark>、<mark style="color:blue;">回應 Body</mark>：完整的回應內容
* <mark style="color:blue;">錯誤</mark>：請求發生錯誤時才會出現，顯示錯誤訊息


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
