This page provides an overview of using the APIs installed with Vertex AI on Google Distributed Cloud (GDC) air-gapped appliance and its reference documentation.
Service endpoint and discovery document
A service endpoint is required to interact programmatically with the Vertex AI APIs.
To get the endpoints for the pre-trained APIs, view service status and endpoints.
API access
You can access the pre-trained APIs using gRPC or one of the provided client libraries. The client libraries are built on gRPC.
Alternatively, you access some pre-trained APIs using REST.
Client libraries
Vertex AI provides Python client libraries for pre-trained APIs. The following table shows a comparison of advantages and disadvantages of using client libraries:
Advantages | Disadvantages |
---|---|
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. For more information, see the REST API references for these services:
The following table shows a comparison of advantages and disadvantages of using REST:
Advantages | Disadvantages |
---|---|
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. |
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.
gRPC
Pre-trained APIs and the Gemini API support gRPC. For more information about the generic descriptions of the types, methods, and fields generated for a gRPC library, see the following gRPC reference:
The following table shows a comparison of advantages and disadvantages of using gRPC:
Advantages | Disadvantage |
---|---|
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. |
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 in the following ways:
- REST is arranged by resource hierarchies and their methods.
- Client libraries and gRPC are arranged by services and their methods.
- KRM field names use camelCase, but the API service accepts either camelCase or snake_case.
- REST and gRPC field names use snake_case.
- Client library field names use either title case, camelCase, or snake_case, depending on which name is idiomatic for the language.