Table of Contents

Class ModelsEndpoint

Namespace
OpenAI.Models
Assembly
OpenAI-DotNet.dll

List and describe the various models available in the API. You can refer to the Models documentation to understand which models are available for certain endpoints: https://platform.openai.com/docs/models/model-endpoint-compatibility.
https://platform.openai.com/docs/api-reference/models

public sealed class ModelsEndpoint : OpenAIBaseEndpoint
Inheritance
ModelsEndpoint
Inherited Members

Constructors

ModelsEndpoint(OpenAIClient)

public ModelsEndpoint(OpenAIClient client)

Parameters

client OpenAIClient

Properties

Root

The root endpoint address.

protected override string Root { get; }

Property Value

string

Methods

DeleteFineTuneModelAsync(string, CancellationToken)

Delete a fine-tuned model. You must have the Owner role in your organization.

public Task<bool> DeleteFineTuneModelAsync(string modelId, CancellationToken cancellationToken = default)

Parameters

modelId string

The Model to delete.

cancellationToken CancellationToken

Optional, CancellationToken.

Returns

Task<bool>

True, if fine-tuned model was successfully deleted.

GetModelDetailsAsync(string, CancellationToken)

Get the details about a particular Model from the API

public Task<Model> GetModelDetailsAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string

The id/name of the model to get more details about

cancellationToken CancellationToken

Optional, CancellationToken.

Returns

Task<Model>

Asynchronously returns the Model with all available properties

GetModelsAsync(CancellationToken)

List all models via the API

public Task<IReadOnlyList<Model>> GetModelsAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Optional, CancellationToken.

Returns

Task<IReadOnlyList<Model>>

Asynchronously returns the list of all Models