> For the complete documentation index, see [llms.txt](https://docs.wisej.com/ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/ai/components/api/smartendpoint/wisej.ai.endpoints.openaiendpointwhisper.md).

# OpenAIEndpointWhisper

Namespace: **Wisej.AI.Endpoints**

Assembly: **Wisej.AI** (3.5.0.0)

* [SmartEndpoint](/ai/components/api/smartendpoint.md)
  * [SmartHttpEndpoint](/ai/components/api/smartendpoint/wisej.ai.endpoints.smarthttpendpoint.md)
    * [OpenAIEndpointWhisper](/ai/components/api/smartendpoint/wisej.ai.endpoints.openaiendpointwhisper.md)

Represents an endpoint for connecting to OpenAI's Whisper model for speech-to-text transcriptions.

{% tabs %}
{% tab title="C#" %}

```csharp
public class OpenAIEndpointWhisper : SmartHttpEndpoint
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class OpenAIEndpointWhisper
    Inherits SmartHttpEndpoint
```

{% endtab %}
{% endtabs %}

This class is designed to interact with OpenAI's Whisper model, providing functionality to send audio data and receive transcriptions. It extends the [SmartHttpEndpoint](/ai/components/api/smartendpoint/wisej.ai.endpoints.smarthttpendpoint.md) to leverage HTTP communication.

## Constructors

### ![](/files/ptrKjmmRoQB76pvrIqh0) OpenAIEndpointWhisper()

Initializes a new instance of the [OpenAIEndpointWhisper](/ai/components/api/smartendpoint/wisej.ai.endpoints.openaiendpointwhisper.md) class with default settings.

Sets the authentication method to "Bearer", the model to "whisper-1", and the response format to "text". The URL is set to OpenAI's audio transcription endpoint.

## Properties

### ![](/files/ptrKjmmRoQB76pvrIqh0) Model

[String](https://docs.microsoft.com/dotnet/api/system.string): Gets or sets the model used for transcription. (Default: `"whisper-1"`)

### ![](/files/ptrKjmmRoQB76pvrIqh0) URL

[String](https://docs.microsoft.com/dotnet/api/system.string): Gets or sets the URL for the OpenAI audio transcription endpoint. (Default: `"https://api.openai.com/v1/audio/transcriptions"`)

## Methods

### ![](/files/KL0Ik37djZRr8a07Wopd) AddMessages(payload, session, messages)

Adds user messages to the payload for the request.

| Parameter    | Type                                                                                        | Description                                  |
| ------------ | ------------------------------------------------------------------------------------------- | -------------------------------------------- |
| **payload**  | [Object](https://docs.microsoft.com/dotnet/api/system.object)                               | The payload to which messages will be added. |
| **session**  | [SmartSession](/ai/components/api/smartsession.md)                                          | The current session containing user data.    |
| **messages** | [IList\<Message>](https://docs.microsoft.com/dotnet/api/system.collections.generic.ilist-1) | The list of messages to be processed.        |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception)\
  Thrown if any of the parameters are null.

### ![](/files/KL0Ik37djZRr8a07Wopd) CreateContent(data)

Creates the HTTP content for the request using the provided data.

| Parameter | Type                                                          | Description                                     |
| --------- | ------------------------------------------------------------- | ----------------------------------------------- |
| **data**  | [Object](https://docs.microsoft.com/dotnet/api/system.object) | The data to be included in the request content. |

**Returns:** [HttpContent](https://docs.microsoft.com/dotnet/api/system.net.http.httpcontent). A [HttpContent](https://docs.microsoft.com/dotnet/api/system.net.http.httpcontent) object containing the request data.

### ![](/files/KL0Ik37djZRr8a07Wopd) ReadAssistantMessage(response, message)

Reads the assistant's message from the response and updates the message object.

| Parameter    | Type                                                                            | Description                                                  |
| ------------ | ------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| **response** | [Response](/ai/components/api/smartendpoint/wisej.ai.smartendpoint.response.md) | The response received from the server.                       |
| **message**  | [Message](/ai/components/api/smartsession/wisej.ai.smartsession.message.md)     | The message object to be updated with the assistant's reply. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception)\
  Thrown if any of the parameters are null.

### ![](/files/KL0Ik37djZRr8a07Wopd) ReadUsage(message, reply)

Reads the usage information from the reply. Not supported in this implementation.

| Parameter   | Type                                                                        | Description                                              |
| ----------- | --------------------------------------------------------------------------- | -------------------------------------------------------- |
| **message** | [Message](/ai/components/api/smartsession/wisej.ai.smartsession.message.md) | The message object to be updated with usage information. |
| **reply**   | [Object](https://docs.microsoft.com/dotnet/api/system.object)               | The reply containing usage data.                         |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/ai/components/api/smartendpoint/wisej.ai.endpoints.openaiendpointwhisper.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
