When using the Alibaba Cloud Python SDK to call APIs, the service endpoint for each API is required.

Configuration method

You must first specify the region ID used for accessing Alibaba Cloud services in AcsClient. Then, the system returns the service endpoint according to the region ID and the product name.
Note The order of the parameters cannot be changed. The last parameter must be your-region-id.
client = AcsClient(
    "<Your-region-ID>" # Pay attention to the order of parameters. Region ID ranks the third.


If an SDK.InvalidRegionId or Can not find endpoint to access to access error occurs when initializing the client, you can troubleshoot the error as follows:

  • Cause 1: The cloud service that you use is not available in the specified region or the service does not have an endpoint.

    Resolution: Open a ticket to register an endpoint.

  • Cause 2: Incorrect parameter values.

    Resolution: Check the parameter values and make sure the sequence of the parameters is correct.