# NonTokenUsageRecord

> 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.nontokenusagerecord/
> Summary: NonTokenUsageRecord: One non-token item a workflow function node reported: the persistent record behind GET /api/runs/{runId}/usage.

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

One non-token item a workflow function node reported: the persistent record behind
`GET /api/runs/{runId}/usage`.

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

A node reports with `IWorkflowContext.ReportUsageAsync` and every report is an
item. A retried node keeps the items of its failed attempts: the work was done and
the provider billed it.

## Constructors

### <a id="Tracon_NonTokenUsageRecord__ctor"></a> NonTokenUsageRecord\(\)

```csharp
public NonTokenUsageRecord()
```

## Properties

### <a id="Tracon_NonTokenUsageRecord_CreatedAt"></a> CreatedAt

Gets the moment the item was reported (UTC).

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

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

Gets the record id. A time-ordered UUID (v7).

```csharp
public required Guid Id { get; init; }
```

#### Property Value

 [Guid](https://learn.microsoft.com/dotnet/api/system.guid)

### <a id="Tracon_NonTokenUsageRecord_NodeName"></a> NodeName

Gets the name of the function node that reported the item, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null)
when the reporting code did not run inside a function node Tracon registered
(a custom executor in a graph built in code, for example).

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

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

Gets the run the item belongs to.

```csharp
public required Guid RunId { get; init; }
```

#### Property Value

 [Guid](https://learn.microsoft.com/dotnet/api/system.guid)

### <a id="Tracon_NonTokenUsageRecord_TenantId"></a> TenantId

Gets the EXPECTED tenant of the run. Defense in depth; when [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null)
no tenant check is made.

```csharp
[JsonIgnore]
public string? TenantId { get; init; }
```

#### Property Value

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

Write-side only, like [ToolInvocationRecord.TenantId](/api/tracon.toolinvocationrecord/#Tracon_ToolInvocationRecord_TenantId): it is the
`WHERE` guard of the insert, never a column, and is left out of the HTTP
contract.

### <a id="Tracon_NonTokenUsageRecord_Usage"></a> Usage

Gets the measurement and its amount.

```csharp
public required ToolCallUsage Usage { get; init; }
```

#### Property Value

 [ToolCallUsage](/api/tracon.toolcallusage/)

## Methods

### <a id="Tracon_NonTokenUsageRecord_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_NonTokenUsageRecord_Equals_Tracon_NonTokenUsageRecord_"></a> Equals\(NonTokenUsageRecord?\)

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

`other` [NonTokenUsageRecord](/api/tracon.nontokenusagerecord/)?

#### Returns

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

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

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

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

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

### <a id="Tracon_NonTokenUsageRecord_op_Equality_Tracon_NonTokenUsageRecord_Tracon_NonTokenUsageRecord_"></a> operator ==\(NonTokenUsageRecord?, NonTokenUsageRecord?\)

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

`left` [NonTokenUsageRecord](/api/tracon.nontokenusagerecord/)?

`right` [NonTokenUsageRecord](/api/tracon.nontokenusagerecord/)?

#### Returns

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

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

`left` [NonTokenUsageRecord](/api/tracon.nontokenusagerecord/)?

`right` [NonTokenUsageRecord](/api/tracon.nontokenusagerecord/)?

#### Returns

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