Skip to main content
Permissions

Accessing Alibaba Cloud Bailian Model or Application APIs via Private Network

To directly call Alibaba Cloud Bailian model or application APIs from within a VPC—ensuring all traffic remains entirely within Alibaba Cloud’s internal network—you can create a private endpoint. This keeps communication fully internal to Alibaba Cloud.

How It Works

After you create an interface endpoint in your Virtual Private Cloud (VPC), Alibaba Cloud PrivateLink establishes a private connection (endpoint connection) between your VPC and Alibaba Cloud Bailian. This connection is unidirectional: resources inside your VPC can initiate outbound requests to Alibaba Cloud Bailian, but Bailian cannot access resources inside your VPC through this connection. When compute resources in your VPC access the endpoint, traffic is routed to the Bailian service backend via PrivateLink—without traversing the public internet. Supported regions for Alibaba Cloud Bailian services:
  • Public cloud: China North 2 (Beijing), Singapore.
Private network access is not currently supported in the US (Virginia) region.

Accessing Alibaba Cloud Bailian APIs via Endpoint

Step 1: Create an Interface Endpoint

1

Log in to the Endpoint Console

Log in to the Endpoint Console. If this is your first time using endpoints, follow the on-screen instructions to activate the PrivateLink service.
2

Select Region

From the top navigation bar, select a region. Private network access to Alibaba Cloud Bailian is currently available only in China North 2 (Beijing) and Singapore. Ensure the selected region matches the region where the Bailian service is deployed.
3

Create Endpoint

On the Interface Endpoints tab, click Create Endpoint, and configure the following parameters. All other parameters can remain at their default values:
  • Region: Select either China North 2 (Beijing) or Singapore, matching the region where Bailian is deployed.
  • Endpoint Service: Select the Bailian-specific endpoint service.
  • VPC: Choose the VPC from which you need to access Bailian.
  • Security Group: Select a security group that permits outbound traffic.
  • Zone & vSwitch: Select an availability zone and corresponding vSwitch within your VPC.
4

Wait for Completion

Once created, the endpoint status changes to Available, indicating successful creation. Record the endpoint domain name—you’ll use it later to replace the public domain name.

Step 2: Use the Endpoint Domain Name to Access Bailian APIs

Simply replace the public domain name with your endpoint domain name to access Bailian APIs over the private network. Example: Replace dashscope.aliyuncs.com in https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions with your endpoint domain name.
curl https://<your-endpoint-domain>/compatible-mode/v1/chat/completions \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-plus",
    "messages": [
      {"role": "user", "content": "Hello"}
    ]
  }'
To access Bailian privately from a VPC located in a different region, use Cloud Enterprise Network (CEN) to enable inter-region VPC connectivity, then access Bailian via the endpoint domain name.