ModelClientListModelsAsync Method

Lists the Models available through the Gemini API.

Definition

Namespace: GenerativeAI.Clients
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
public Task<ListModelsResponse> ListModelsAsync(
	int? pageSize = null,
	string? pageToken = null,
	CancellationToken cancellationToken = default
)

Parameters

pageSize  NullableInt32  (Optional)
The maximum number of Models to return per page.
pageToken  String  (Optional)
A page token, received from a previous ListModelsAsync(NullableInt32, String, CancellationToken) call, to retrieve the next page of results.
cancellationToken  CancellationToken  (Optional)
The cancellation token to observe while waiting for the task to complete.

Return Value

TaskListModelsResponse
A ListModelsResponse containing a list of Models and associated metadata.

See Also