On January 1, 2020 this library will no longer support Python 2 on the latest released version. Previously released library versions will continue to be available. For more information please visit Python 2 support on Google Cloud.

Client Options

Client options class.

Client options provide a consistent interface for user options to be defined across clients.

You can pass a client options object to a client.

from google.api_core.client_options import ClientOptions
from google.cloud.vision_v1 import ImageAnnotatorClient

options = ClientOptions(api_endpoint="foo.googleapis.com")

client = ImageAnnotatorClient(client_options=options)

You can also pass a dictionary.

from google.cloud.vision_v1 import ImageAnnotatorClient

client = ImageAnnotatorClient(client_options={"api_endpoint": "foo.googleapis.com"})
class google.api_core.client_options.ClientOptions(api_endpoint=None)[source]

Bases: object

Client Options used to set options on clients.


api_endpoint (str) – The desired API endpoint, e.g., compute.googleapis.com


Construct a client options object from a dictionary.


options (dict) – A dictionary with client options.