# ModelProviderCredential

> 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.modelprovidercredential/
> Summary: ModelProviderCredential: A resolved, in-memory credential used to call a provider (a model, live voice or speech provider) on behalf of a specific tenant.

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

A resolved, in-memory credential used to call a provider (a model, live voice or
speech provider) on behalf of a specific tenant.

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

This type carries the actual secret *value*. It is produced only
at call time, by resolving a [TenantProviderBinding](/api/tracon.tenantproviderbinding/)'s
configuration key through the application's configuration system; it is
never constructed from a database row and never persisted anywhere.

## Constructors

### <a id="Tracon_ModelProviderCredential__ctor"></a> ModelProviderCredential\(\)

```csharp
public ModelProviderCredential()
```

## Properties

### <a id="Tracon_ModelProviderCredential_ApiKey"></a> ApiKey

Gets the resolved API key. Never persisted; lives only in memory.

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

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

Gets the optional provider endpoint override.

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

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

### <a id="Tracon_ModelProviderCredential_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_ModelProviderCredential_Equals_Tracon_ModelProviderCredential_"></a> Equals\(ModelProviderCredential?\)

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

`other` [ModelProviderCredential](/api/tracon.modelprovidercredential/)?

#### Returns

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

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

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

Returns a description that carries no secret value.

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

 [string](https://learn.microsoft.com/dotnet/api/system.string)

The type name and the endpoint; never the key.

#### Remarks

A record's compiler-generated `ToString` prints every property, so a
single `LogDebug("{Credential}", credential)` would put a live
provider key in the log. The override removes that possibility instead of
relying on nobody ever writing that line.

## Operators

### <a id="Tracon_ModelProviderCredential_op_Equality_Tracon_ModelProviderCredential_Tracon_ModelProviderCredential_"></a> operator ==\(ModelProviderCredential?, ModelProviderCredential?\)

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

`left` [ModelProviderCredential](/api/tracon.modelprovidercredential/)?

`right` [ModelProviderCredential](/api/tracon.modelprovidercredential/)?

#### Returns

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

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

`left` [ModelProviderCredential](/api/tracon.modelprovidercredential/)?

`right` [ModelProviderCredential](/api/tracon.modelprovidercredential/)?

#### Returns

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