Google.Cloud.AIPlatform.V1

Google.Cloud.AIPlatform.V1 is a.NET client library for theVertex AI API.

Note:This documentation is for version3.60.0 of the library.Some samples may not work with other versions.

Installation

Install theGoogle.Cloud.AIPlatform.V1 package from NuGet. Add it toyour project in the normal way (for example by right-clicking on theproject in Visual Studio and choosing "Manage NuGet Packages...").

Authentication

When running on Google Cloud, no action needs to be taken to authenticate.

Otherwise, the simplest way of authenticating your API calls is toset up Application Default Credentials.The credentials will automatically be used to authenticate. SeeSet up Application Default Credentials for more details.

Getting started

All operations are performed through the following client classes:

Clients in this API must be constructed with a regional endpoint.This can be done easily using the builder for a specific client(DatasetServiceClientBuilder forDatasetServiceClient forexample). The following example shows how to list the datasets for agiven project in theus-central1 region.

string region = "us-central1";DatasetServiceClient client = new DatasetServiceClientBuilder{    Endpoint = $"{region}-aiplatform.googleapis.com"}.Build();LocationName location = new LocationName(projectId, region);PagedEnumerable<ListDatasetsResponse, Dataset> datasets = client.ListDatasets(location);foreach (Dataset dataset in datasets){    Console.WriteLine(dataset.Name);}

Constructing schema values

Various aspects of the API use schemas which are represented usingGoogle.Protobuf.WellKnownTypes.Value, which is a genericrepresentation of a JSON value in Protocol Buffers.

Protocol Buffer messages are available for these schemas, and theycan be converted to and fromValue objects using theValueConverter class, as shown below.

AutoMlImageClassificationInputs inputs = new AutoMlImageClassificationInputs{    ModelType = AutoMlImageClassificationInputs.Types.ModelType.Cloud,    BaseModelId = "model-id",    // Other properties};TrainingPipeline pipeline = new TrainingPipeline{    TrainingTaskInputs = ValueConverter.ToValue(inputs)};// Use pipeline in API calls such as PipelineServiceClient.CreateTrainingPipeline.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-01-07 UTC.