# OpenAISpeechOptions

> 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.openaispeechoptions/
> Summary: OpenAISpeechOptions: Settings of OpenAISpeechBuilderExtensions.UseOpenAISpeech.

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

Settings of [OpenAISpeechBuilderExtensions.UseOpenAISpeech](/api/tracon.openaispeechbuilderextensions/#Tracon_OpenAISpeechBuilderExtensions_UseOpenAISpeech_Tracon_ITraconBuilder_System_Action_Tracon_OpenAISpeechOptions__).

```csharp
public sealed class OpenAISpeechOptions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.openaispeechoptions/">OpenAISpeechOptions</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

At least one of [OpenAISpeechOptions.SynthesisModel](/api/tracon.openaispeechoptions/#Tracon_OpenAISpeechOptions_SynthesisModel) and [OpenAISpeechOptions.TranscriptionModel](/api/tracon.openaispeechoptions/#Tracon_OpenAISpeechOptions_TranscriptionModel) must be set.

## Constructors

### <a id="Tracon_OpenAISpeechOptions__ctor"></a> OpenAISpeechOptions\(\)

```csharp
public OpenAISpeechOptions()
```

## Properties

### <a id="Tracon_OpenAISpeechOptions_MaxCharactersPerRequest"></a> MaxCharactersPerRequest

Gets or sets the most characters one synthesis call accepts. Default `4096`, the limit
the OpenAI documentation states for the speech endpoint.

```csharp
public int MaxCharactersPerRequest { get; set; }
```

#### Property Value

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

Gets or sets the text-to-speech model, for example `gpt-4o-mini-tts`. A synthesizer is
registered when this is set.

```csharp
public string? SynthesisModel { get; set; }
```

#### Property Value

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

The registration is bound to this model. A request that names another model is refused:
the OpenAI audio client ignores a per-request model. To use a second model, register a
second name with another call.

### <a id="Tracon_OpenAISpeechOptions_SynthesizerName"></a> SynthesizerName

Gets or sets the registration name of the synthesizer. A caller selects it with
`"provider": "openai"` on `POST /api/voice/speak`. Default `openai`.

```csharp
public string SynthesizerName { get; set; }
```

#### Property Value

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

Gets or sets the registration name of the transcriber. Transcriber names are separate from
synthesizer names. Default `openai`.

```csharp
public string TranscriberName { get; set; }
```

#### Property Value

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

Gets or sets the speech-to-text model, for example `gpt-4o-mini-transcribe`. A transcriber is
registered when this is set.

```csharp
public string? TranscriptionModel { get; set; }
```

#### Property Value

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

The same rule as [OpenAISpeechOptions.SynthesisModel](/api/tracon.openaispeechoptions/#Tracon_OpenAISpeechOptions_SynthesisModel): the registration is bound to this model.

### <a id="Tracon_OpenAISpeechOptions_UseAsDefault"></a> UseAsDefault

Gets or sets whether the registered synthesizer and transcriber are also the unnamed default
ones. Default [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool).

```csharp
public bool UseAsDefault { get; set; }
```

#### Property Value

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

The unnamed default serves the `speak` and `transcribe` tools and the live
conversation. It is registered with `TryAdd`: a default that is already there stays,
so call `UseOpenAISpeech` before `UseVoice` to make OpenAI the default.

The `speak` and `transcribe` tools send `Tracon:Voice:SynthesisModelId` and
`TranscriptionModelId` to the default engine, and a registration is bound to one model.
Leave both empty, or set them to the OpenAI models named here, or the tool call fails with a
message that names both models.

### <a id="Tracon_OpenAISpeechOptions_Voices"></a> Voices

Gets the voices `GET /api/voice/voices` lists for the synthesizer. Empty by default.

```csharp
public IList<VoiceDescriptor> Voices { get; }
```

#### Property Value

 [IList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist\-1)<[VoiceDescriptor](/api/tracon.voicedescriptor/)\>

#### Remarks

A static declaration: the speech endpoint has no voice list. The service refuses a request
without a voice, so a call that names none is spoken in `alloy`.
