> For the complete documentation index, see [llms.txt](https://docs.emobiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emobiq.com/emobiq-ai/readme/how-pricing-works-in-emobiq-ai/debug-pricing.md).

# Debug Pricing

## Understanding How the Debug Agent Works

The [**Debug Agent** ](/emobiq-ai/readme/debug-agent.md)is an AI-powered tool designed to help you identify and fix issues in your app quickly and efficiently. It allows you to:

* Inspect HTML, JavaScript, and API logic
* Identify bugs or misconfigurations
* Apply temporary or permanent fixes directly within the code using natural language
* Test changes in real time

When you interact with the Debug Agent, it processes your request and does it's best to complete your request.

{% hint style="info" %}
*Do note that AI still makes mistakes and it might take a few prompts to fix the issue. For more information on prompting you can refer to the* [*Debug Agent page*](/emobiq-ai/readme/debug-agent.md)
{% endhint %}

***

## Choosing Your Debug Model

<figure><img src="/files/dw5ZJmArHg0NHAqGzIGQ" alt=""><figcaption></figcaption></figure>

The Debug Agent includes a **Performance** model selector that lets you choose how much AI power to apply during a debug session. You can switch between models at any time from within the Debug Agent.

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><p>Standard</p><ul><li>A smaller-scale model suited for everyday debugging tasks</li><li>Faster responses and lower credit cost per session</li><li>Ideal for straightforward fixes, minor UI adjustments, and quick iterations</li><li>Does not support image input</li></ul></td><td></td></tr><tr><td><p>Performance</p><ul><li>Advanced model built for production workloads and complex debugging</li><li>Handles multi-file issues, intricate logic, and API integration problems</li><li>Supports image input for visual debugging</li><li>Higher token cost per session</li></ul></td><td></td></tr></tbody></table>

{% hint style="info" %}
*Not sure which to use? Start with **Standard** for quick fixes and switch to **Performance** when tackling complex or multi-layered issues.*
{% endhint %}

***

### How Is Usage Measured?

Each interaction with the Debug Agent consumes **tokens**, which represent the amount of data processed with each prompt.

#### Example Session:

12 Tokens: 40866 (prompt: 39415, completion: 1451) **Cost: 0.41** **Credits**

This means that during this debug session:

* The user provided a **prompt** of \~39,415 tokens (describing the issue and providing context)
* The agent generated a **response** of \~1,451 tokens (proposing or applying a fix)
* Total cost is calculated based on these tokens processed

{% hint style="info" %}
***Note:** Token usage depends on how much content is sent and generated during the session — including source code, error messages, and explanations.*
{% endhint %}

***

### Why Is There A Charge?

You are charged credits based on **token usage** during each debug session. Here's why:

* **AI processing requires resources**: Each debug task involves analysing code, understanding context, and generating accurate responses
* **Token-based billing ensures fairness**: You only pay for what you use — not for idle time or fixed hours
* **Efficient sessions = lower costs**: The more specific and clear your prompt, the fewer tokens needed to resolve the issue

You're not charged for:

* Previewing changes in UI-only mode
* Viewing documentation or sample guides
* Running tests that don’t involve AI reasoning

***

### Real-World Debugging Example

#### Issue:

After reviewing `service_orders.html` and `service_order_details.html`, the Debug Agent identified that the service order details page was failing due to an authentication error when making an API call.

#### Fix Applied:

The Debug Agent made the following corrections in `service_order_details.html`:

* Fixed incorrect usage of `btoa()` in the `getAuthToken()` function
* Updated the request body format from JSON object to URL-encoded form data
* Standardised the `Authorization` header capitalisation

These changes resolved the authentication failure and allowed the page to load correctly.

#### Result:

* Service order details now display properly
* User redirected correctly instead of being sent back to the main menu
* API calls now authenticate successfully
