> For the complete documentation index, see [llms.txt](https://docs.wisej.com/ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md).

# SmartEndpoint.Metrics

Namespace: **Wisej.AI**

Assembly: **Wisej.AI** (3.5.0.0)

Represents a collection of metrics related to token usage and call counts.

{% tabs %}
{% tab title="C#" %}

```csharp
public class Metrics
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class Metrics
```

{% endtab %}
{% endtabs %}

This class is used to track and manipulate metrics such as input tokens, output tokens, and the number of calls.

## Constructors

### ![](/files/ptrKjmmRoQB76pvrIqh0) Metrics()

Initializes a new instance of the [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md) class.

## Properties

### ![](/files/ptrKjmmRoQB76pvrIqh0) CallCount

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Gets the number of calls.

### ![](/files/ptrKjmmRoQB76pvrIqh0) InputTokens

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Gets the number of input tokens.

### ![](/files/ptrKjmmRoQB76pvrIqh0) OutputTokens

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Gets the number of output tokens.

## Methods

### ![](/files/ptrKjmmRoQB76pvrIqh0) Add(inputTokens, outputTokens, callCount)

Adds the specified number of input tokens, output tokens, and call count to the current metrics.

| Parameter                                      | Type                                                        | Description                               |
| ---------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------- |
| **inputTokens**                                | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The number of input tokens to add.        |
| **outputTokens**                               | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The number of output tokens to add.       |
| **callCount** ![](/files/52BqKf9SltWQ97FbQSBF) | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The number of calls to add. Default is 1. |

**Returns:** [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md). The updated [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md) instance.

### ![](/files/ptrKjmmRoQB76pvrIqh0) Add(usage)

Adds the metrics from another [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md) instance to the current metrics.

| Parameter | Type                                                                          | Description                                                                                                              |
| --------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| **usage** | [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md) | The [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md) instance whose values are to be added. |

**Returns:** [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md). The updated [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md) instance.

This method updates the current metrics by adding the values from another [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md) instance.

### ![](/files/ptrKjmmRoQB76pvrIqh0) Reset()

Resets the input tokens, output tokens, and call count to 0.

**Returns:** [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md). The updated [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md) instance.

### ![](/files/ptrKjmmRoQB76pvrIqh0) Subtract(usage)

Subtracts the metrics from another [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md) instance from the current metrics.

| Parameter | Type                                                                          | Description                                                                                                                   |
| --------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| **usage** | [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md) | The [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md) instance whose values are to be subtracted. |

**Returns:** [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md). The updated [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md) instance.

This method updates the current metrics by subtracting the values from another [Metrics](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.md) instance.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.wisej.com/ai/components/api/smartendpoint/wisej.ai.smartendpoint.metrics.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.
