# VoiceSessionCost

> 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.voicesessioncost/
> Summary: VoiceSessionCost: What one voice conversation cost.

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

What one voice conversation cost.

```csharp
public sealed record VoiceSessionCost : IEquatable<VoiceSessionCost>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.voicesessioncost/">VoiceSessionCost</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;VoiceSessionCost&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>

## Remarks

The total has two addends because the two voice paths bill differently: a
provider-hosted live session bills by duration, while the conversation layer
Tracon runs itself bills the synthesized characters.

The sum lives in [VoiceSessionCost.Total](/api/tracon.voicesessioncost/#Tracon_VoiceSessionCost_Total) and nowhere else. A bare
`decimal?` forces every caller to decide which addend it meant, and a sum
spelled out by hand in several places silently loses a term the day a third one
arrives.

This is the cost of the *voice* connection only. Each delegated task
also produces an ordinary `runs` row with its own token cost, which is
deliberately not repeated here. A display that shows only this number
**under-reports**; the honest figure is this cost plus the session's
run costs.

## Constructors

### <a id="Tracon_VoiceSessionCost__ctor"></a> VoiceSessionCost\(\)

```csharp
public VoiceSessionCost()
```

## Properties

### <a id="Tracon_VoiceSessionCost_CharacterCost"></a> CharacterCost

What the synthesized characters cost.

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

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

The currency the amounts are in.

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

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

What the session's duration cost.

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

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

### <a id="Tracon_VoiceSessionCost_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_VoiceSessionCost_Equals_Tracon_VoiceSessionCost_"></a> Equals\(VoiceSessionCost?\)

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

`other` [VoiceSessionCost](/api/tracon.voicesessioncost/)?

#### Returns

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

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

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

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

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

Adds every priced addend.

```csharp
public decimal? Total()
```

#### Returns

 [decimal](https://learn.microsoft.com/dotnet/api/system.decimal)?

The total, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when nothing was priced — never
`0`, which would claim the conversation was free.

## Operators

### <a id="Tracon_VoiceSessionCost_op_Equality_Tracon_VoiceSessionCost_Tracon_VoiceSessionCost_"></a> operator ==\(VoiceSessionCost?, VoiceSessionCost?\)

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

`left` [VoiceSessionCost](/api/tracon.voicesessioncost/)?

`right` [VoiceSessionCost](/api/tracon.voicesessioncost/)?

#### Returns

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

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

`left` [VoiceSessionCost](/api/tracon.voicesessioncost/)?

`right` [VoiceSessionCost](/api/tracon.voicesessioncost/)?

#### Returns

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