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

# Credits Item Display Order

Explains the display order contract for Credits items and transaction details in API responses.

Credits pricing, transaction details, and Agent execution records use the same display order. If your integration displays details, follow the order returned by the API rather than sorting again by name, code, or the `displayOrder` field alone.

## Ordering Rules <a href="#ordering-contract" id="ordering-contract"></a>

The system sorts by category first, then by display order within each category. The category order is:

1. Language models
2. Knowledge base
3. Speech
4. Tools
5. Content safety
6. AgentOps
7. Crawlers
8. Virtual humans
9. Meetings
10. Platform fees

Items outside the established category order appear after the categories above. Transactions in the same position are further ordered by time and identifier to maintain a stable order.

{% hint style="info" %}
A billing item's `displayOrder` represents only its position within the same category. Different categories may use identical or overlapping values, so this field alone cannot reconstruct the full order.
{% endhint %}

## Affected Responses <a href="#affected-responses" id="affected-responses"></a>

This order applies to Credits pricing items ([List Billing Items](https://docs.maiagent.ai/api/api-reference/credit#credit-items-list) in the API documentation), expanded transaction records (`items` in each record returned by [Retrieve Consumption Records](https://docs.maiagent.ai/api/api-reference/credit#credit-transactions-history-retrieve)), and Credits details in Agent execution records. CSV pricing exports use the same order.

If your integration needs custom categories or visual grouping, add group headings while preserving the API order. Reordering items may cause the admin console and external reports to display different results.

## Upgrade Checklist <a href="#upgrade-checklist" id="upgrade-checklist"></a>

1. Remove frontend sorting by name or code.
2. Check whether `displayOrder` is being treated as a global rank across categories.
3. Compare the pricing page, transaction details, and exported files to confirm that the relative order of the same items is consistent.


---

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