# QuotaConsumption

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.quotaconsumption/
> Summary: QuotaConsumption: The consumption of a completed run to add to the quota counters.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

The consumption of a completed run to add to the quota counters.

```csharp
public sealed record QuotaConsumption : IEquatable<QuotaConsumption>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.quotaconsumption/">QuotaConsumption</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;QuotaConsumption&gt;</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Constructors

### <a id="Tracon_QuotaConsumption__ctor"></a> QuotaConsumption\(\)

```csharp
public QuotaConsumption()
```

## Properties

### <a id="Tracon_QuotaConsumption_AgentName"></a> AgentName

The name of the agent that ran.

```csharp
public required string AgentName { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

### <a id="Tracon_QuotaConsumption_Cost"></a> Cost

The amount to add. [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) if pricing is undefined —
**not** zero: Tracon does not invent a price.

```csharp
public decimal? Cost { get; init; }
```

#### Property Value

 [decimal](https://learn.microsoft.com/dotnet/api/system.decimal)?

### <a id="Tracon_QuotaConsumption_OccurredAt"></a> OccurredAt

The moment the consumption occurred (UTC). The period is computed from this.

```csharp
public required DateTimeOffset OccurredAt { get; init; }
```

#### Property Value

 [DateTimeOffset](https://learn.microsoft.com/dotnet/api/system.datetimeoffset)

### <a id="Tracon_QuotaConsumption_RunId"></a> RunId

The identifier of the run that spent this consumption: the root run, a child
run of its call tree, or the run whose tool reported the amount.
[null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when consumption is recorded
outside a run (there is no such caller today, but the field stays
optional rather than assume one always exists).

```csharp
public string? RunId { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

### <a id="Tracon_QuotaConsumption_Runs"></a> Runs

The number of runs to add. 1 for a root run; 0 for an entry that adds only the tokens
and cost of a run that belongs to a call tree already counted as one run (a child
agent run, a tool amount that arrived after its run closed).

```csharp
public long Runs { get; init; }
```

#### Property Value

 [long](https://learn.microsoft.com/dotnet/api/system.int64)

#### Remarks

A store adds it as it is: an entry with 0 still creates a counter that does not exist yet.

### <a id="Tracon_QuotaConsumption_TenantId"></a> TenantId

The tenant identifier.

```csharp
public required string TenantId { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

### <a id="Tracon_QuotaConsumption_Tokens"></a> Tokens

The total tokens to add.

```csharp
public long Tokens { get; init; }
```

#### Property Value

 [long](https://learn.microsoft.com/dotnet/api/system.int64)

### <a id="Tracon_QuotaConsumption_UserId"></a> UserId

The user the run belongs to. [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when the run
carries no attribution — a run's correlation is **not
guessed** from another active user.

```csharp
public string? UserId { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

## Methods

### <a id="Tracon_QuotaConsumption_Equals_System_Object_"></a> Equals\(object?\)

```csharp
public override bool Equals(object? obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_QuotaConsumption_Equals_Tracon_QuotaConsumption_"></a> Equals\(QuotaConsumption?\)

```csharp
public bool Equals(QuotaConsumption? other)
```

#### Parameters

`other` [QuotaConsumption](/api/tracon.quotaconsumption/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_QuotaConsumption_GetHashCode"></a> GetHashCode\(\)

```csharp
public override int GetHashCode()
```

#### Returns

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_QuotaConsumption_ToString"></a> ToString\(\)

```csharp
public override string ToString()
```

#### Returns

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Operators

### <a id="Tracon_QuotaConsumption_op_Equality_Tracon_QuotaConsumption_Tracon_QuotaConsumption_"></a> operator ==\(QuotaConsumption?, QuotaConsumption?\)

```csharp
public static bool operator ==(QuotaConsumption? left, QuotaConsumption? right)
```

#### Parameters

`left` [QuotaConsumption](/api/tracon.quotaconsumption/)?

`right` [QuotaConsumption](/api/tracon.quotaconsumption/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_QuotaConsumption_op_Inequality_Tracon_QuotaConsumption_Tracon_QuotaConsumption_"></a> operator \!=\(QuotaConsumption?, QuotaConsumption?\)

```csharp
public static bool operator !=(QuotaConsumption? left, QuotaConsumption? right)
```

#### Parameters

`left` [QuotaConsumption](/api/tracon.quotaconsumption/)?

`right` [QuotaConsumption](/api/tracon.quotaconsumption/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
