Vertex AI API overview

This topic provides an overview of using the four APIs installed with Vertex AI on Google Distributed Cloud (GDC) air-gapped and its reference documentation. The four APIs are for Optical Character Recognition (OCR), Speech-to-Text, Translation, and Vertex AI Workbench.

Service endpoint and discovery document

A service endpoint is required to interact programmatically with the OCR, Speech-to-Text, Translation, and Vertex AI Workbench APIs.

Get the Vertex AI Workbench endpoint and discovery document

The API endpoint for the Vertex AI Workbench KRM API is: https://ORG_ADMIN_CLUSTER_KUBERNETES_API_ENDPOINT/apis/aiplatform.gdc.goog/v1beta1 where ORG_ADMIN_CLUSTER_KUBERNETES_API_ENDPOINT is the API endpoint of your organization administrator Kubernetes cluster.

To access the Vertex AI Workbench discovery document, do one of the following:

  • Enter the endpoint URL in a browser.

  • Run the kubectl proxy command in a tool such as curl to open a proxy to the Kubernetes API server on your local machine. Once that command is running, enter the following URL in your browser: http://127.0.0.1:8001/apis/aiplatform.gdc.goog/v1beta1.

Get the pre-trained APIs endpoints

To get the endpoints for the pre-trained APIs, see View service statuses and endpoints.

REST, gRPC, KRM, and client libraries

You can access the OCR and Translation APIs via gRPC or one of the provided client libraries. The client libraries are built on gRPC.

You can access the OCR, Speech-to-Text, and Translation APIs via REST APIs.

You can manage Vertex AI Workbench via its Kubernetes Resource Model (KRM) API.

Client libraries

Google provides Python client libraries for the three Vertex AI pre-trained APIs.

Pros Cons
Maintained by Google.
Built-in authentication.
Built-in retries.
Efficient protocol buffer HTTP request body.
Not available for all programming languages.

REST

The OCR and Translation APIs support REST. See the REST API references:

The Speech-to-Text and Vertex AI Workbench APIs don't support REST.

Pros Cons
Simple JSON interface.
Well supported by many Google and third-party tools and libraries.
You must build your own client.
You must implement authentication.
You must implement retries.
Less efficient JSON HTTP request body.
REST streaming is not supported by these APIs.

gRPC

The OCR, Speech-to-Text, and Translation APIs support gRPC. See the gRPC references, which provide generic descriptions of the types, methods, and fields generated for a gRPC library:

The Vertex AI Workbench API doesn't support gRPC.

Pros Cons
Supports many programming languages.
Efficient protocol buffer HTTP request body.
You must generate your own client from Google-supplied protocol buffers.
You must implement authentication.
You must implement retries.

KRM

The Vertex AI Workbench API supports KRM. For more information, see the Vertex AI Workbench KRM API Reference.

Type, method, and field names

Depending on whether you are using client libraries, REST, gRPC, or KRM, the type, method, and field names for the API vary somewhat:

  • REST is arranged by resource hierarchies and their methods.
  • Client libraries and gRPC are arranged by services and their methods.
  • KRM field names use camel case, though the API service will accept either camel case or snake case.
  • REST and gRPC field names use snake case.
  • Client library field names use either title case, camel case or snake case, depending on which name is idiomatic for the language.

REST and protocol buffers

When calling the REST API, the default value behavior for protocol buffers might result in missing fields in a JSON response. These fields are set to the default value, so they are not included in the response.