> 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/tech/api-integration/endpoint-behaviors/credit-display-order.md).

# Credits 項目顯示順序

說明 Credits 項目與交易明細在 API 回應中的顯示順序契約。

Credits 定價、交易明細與 Agent 執行紀錄使用同一套顯示順序。串接端若要呈現明細，建議沿用 API 回傳順序，不要再以名稱、代碼或單一 `displayOrder` 欄位重新排序。

## 排序規則 <a href="#ordering-contract" id="ordering-contract"></a>

系統先依類別排序，再依類別內的顯示順序排列。類別順序如下：

1. 語言模型
2. 知識庫
3. 語音
4. 工具
5. 內容安全
6. AgentOps
7. 爬蟲
8. 虛擬人
9. 會議
10. 平台費用

未列入既有類別順序的項目會排在上述類別之後。同一位置的交易會再以時間與識別碼維持穩定順序。

{% hint style="info" %}
計價項目的 `displayOrder` 只代表同一類別內的位置。不同類別可能使用相同或交錯的數值，因此不能只靠這個欄位重建完整順序。
{% endhint %}

## 受影響的回應 <a href="#affected-responses" id="affected-responses"></a>

此順序套用於 Credits 定價項目（API 文件[列出計價項目](https://docs.maiagent.ai/api/api-reference/credit#credit-items-list)）、交易紀錄展開內容（[查詢消耗紀錄](https://docs.maiagent.ai/api/api-reference/credit#credit-transactions-history-retrieve)每筆的 `items`），以及 Agent 執行紀錄中的 Credits 明細。CSV 定價匯出也使用相同順序。

整合端若需要自訂分類或視覺分組，可以在保留 API 順序的前提下增加群組標題；若自行重排，管理後台與外部報表可能呈現不同結果。

## 升級檢查 <a href="#upgrade-checklist" id="upgrade-checklist"></a>

1. 移除依名稱或代碼進行的前端排序。
2. 檢查是否把 `displayOrder` 當成跨類別的全域順位。
3. 對照定價頁、交易明細與匯出檔，確認相同項目的相對順序一致。


---

# 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/tech/api-integration/endpoint-behaviors/credit-display-order.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.
