Table of Contents

Class OpenAI

Represents the OpenAI service with methods to interact with the API.

public class OpenAI : ApiClient<OpenAI, OpenAISettings>, IApiClient
Inheritance
object
RESTClient
CRUDClient<OpenAI>
OpenAI
Implements
Inherited Members
CRUDClient<OpenAI>.Name
CRUDClient<OpenAI>.Version
CRUDClient<OpenAI>.BetaVersion
CRUDClient<OpenAI>.BaseUrl
CRUDClient<OpenAI>.CreateClientSettings()
CRUDClient<OpenAI>.POSTCreateAsync<TRequestBody, TResponse>(string, CRUDServiceBase<OpenAI>, TRequestBody, RESTRequestOptions, params IUriParam[])
CRUDClient<OpenAI>.POSTCreateAsync<TRequestBody, TResponse>(string, CRUDServiceBase<OpenAI>, TRequestBody, params IUriParam[])
CRUDClient<OpenAI>.POSTCreateAsync<TRequestBody>(string, CRUDServiceBase<OpenAI>, TRequestBody, RESTRequestOptions, params IUriParam[])
CRUDClient<OpenAI>.POSTCreateAsync<TRequestBody>(string, CRUDServiceBase<OpenAI>, TRequestBody, params IUriParam[])
CRUDClient<OpenAI>.POSTCreateAsync<TResponse>(string, CRUDServiceBase<OpenAI>, RESTRequestOptions, params IUriParam[])
CRUDClient<OpenAI>.GETRetrieveAsync<TResponse>(string, CRUDServiceBase<OpenAI>, RESTRequestOptions, params IUriParam[])
CRUDClient<OpenAI>.POSTUpdateAsync<TRequestBody, TResponse>(string, CRUDServiceBase<OpenAI>, TRequestBody, RESTRequestOptions, params IUriParam[])
CRUDClient<OpenAI>.POSTUpdateAsync<TRequestBody, TResponse>(string, CRUDServiceBase<OpenAI>, TRequestBody, params IUriParam[])
CRUDClient<OpenAI>.POSTUpdateAsync<TResponse>(string, CRUDServiceBase<OpenAI>, RESTRequestOptions, params IUriParam[])
CRUDClient<OpenAI>.PATCHUpdateAsync<TResponse>(string, CRUDServiceBase<OpenAI>, RESTRequestOptions, params IUriParam[])
CRUDClient<OpenAI>.DELETEDeleteAsync<TResponse>(string, CRUDServiceBase<OpenAI>, RESTRequestOptions, params IUriParam[])
CRUDClient<OpenAI>.DELETEDeleteAsync<TRequestBody>(string, CRUDServiceBase<OpenAI>, TRequestBody, RESTRequestOptions, params IUriParam[])
CRUDClient<OpenAI>.GETListAsync<TQuery, TResponse>(string, CRUDServiceBase<OpenAI>, TQuery, RESTRequestOptions, params IUriParam[])

Constructors

OpenAI()

public OpenAI()

Fields

AssistantsApiHeader

public static RESTHeader AssistantsApiHeader

Field Value

RESTHeader

RealtimeApiHeader

public static RESTHeader RealtimeApiHeader

Field Value

RESTHeader

Properties

Audio

Learn how to turn audio into text or text into audio.

public AudioService Audio { get; }

Property Value

AudioService

Batch

Create large batches of API requests for asynchronous processing. The Batch API returns completions within 24 hours for a 50% discount.

public BatchService Batch { get; }

Property Value

BatchService

Beta

Beta features that are not yet available in the main API.

public BetaService Beta { get; }

Property Value

BetaService

Chat

Given a list of messages comprising a conversation, the model will return a response.

public ChatService Chat { get; }

Property Value

ChatService

Embeddings

Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.

public EmbeddingService Embeddings { get; }

Property Value

EmbeddingService

Files

Files are used to upload documents that can be used with features like Assistants, Fine-tuning, and Batch API.

public FileService Files { get; }

Property Value

FileService

FineTuning

Manage fine-tuning jobs to tailor a model to your specific training data.

public FineTuningService FineTuning { get; }

Property Value

FineTuningService

Images

Given a prompt and/or an input image, the model will generate a new image.

public ImageService Images { get; }

Property Value

ImageService

Models

List and describe the various models available in the API. You can refer to the Models documentation to understand what models are available and the differences between them.

public ModelService Models { get; }

Property Value

ModelService

Moderations

Given some input text, outputs if the model classifies it as potentially harmful across several categories.

public ModerationService Moderations { get; }

Property Value

ModerationService

Methods

CreateCRUDClientSettings()

protected override CRUDClientSettings CreateCRUDClientSettings()

Returns

CRUDClientSettings

CreateJsonSerializerSettingsData()

protected override ApiClient<OpenAI, OpenAISettings>.JsonSerializerSettingsData CreateJsonSerializerSettingsData()

Returns

ApiClient<OpenAI, OpenAISettings>.JsonSerializerSettingsData

GetApiKey(string)

public override string GetApiKey(string serviceName = null)

Parameters

serviceName string

Returns

string

IsDeletedPredicate(RESTResponse)

Override this method to handle the status of a Glitch9.IO.Networking.RESTApi.CRUDOperation.Delete operation.

protected override bool IsDeletedPredicate(RESTResponse res)

Parameters

res RESTResponse

Returns

bool