Regions and domain names

Updated at:

Select an Intelligent Speech Interaction endpoint based on the service, region, and network environment, and configure the credentials required by that endpoint.

Select an endpoint

A domain name identifies a service endpoint. A complete request URL also includes a protocol and an API path. Use the complete URL for the service; changing only the domain name does not account for differences in API paths and authentication.

Intelligent Speech Interaction provides endpoints in China (Shanghai), China (Beijing), and China (Shenzhen). Check service availability before choosing a region. For latency-sensitive workloads, choose an available endpoint close to the client.

  • Public network access: Use public endpoints from on-premises servers, servers on other clouds, or ECS instances with outbound internet connectivity. Calling NLS does not require a dedicated public inbound address. The runtime environment must still provide outbound connectivity and allow the required protocols and ports.

  • Private network access: Access a private endpoint from an ECS instance in a virtual private cloud (VPC) in the same region. Private access does not incur ECS public data transfer fees, but speech service charges still apply.

Services and regions

The following table lists regions by service. For the programming languages and features supported by each SDK, see its documentation. The gateway domain name does not determine SDK support.

Service

Regions

Short sentence recognition, real-time speech recognition, and short-text speech synthesis

China (Shanghai), China (Beijing), and China (Shenzhen).

Recording file recognition and Speech File Transcriber Lite

China (Shanghai), China (Beijing), and China (Shenzhen). Each service uses its own POP endpoint.

Recording file recognition (flash version)

China (Shanghai); use the HTTPS endpoints listed below.

Self-learning platform

China (Shanghai), China (Beijing), and China (Shenzhen).

Sound event detection, speaker recognition, gender recognition, and language recognition

China (Shanghai).

Long-text-to-speech synthesis

China (Shanghai).

Offline speech synthesis

Supports endpoint configurations for China (Shanghai), China (Beijing), and China (Shenzhen). Speech synthesis runs on the device.

Endpoints for recording file recognition (flash version) and streaming text-to-speech synthesis are listed below. Streaming text-to-speech synthesis and long-text-to-speech synthesis are different services. Do not use their names or integration methods interchangeably.

Service endpoints

Short sentence recognition, real-time speech recognition, and short-text speech synthesis

WebSocket APIs use the /ws/v1 path. Message namespaces and parameters differ by service. Even when services share a URL, their message protocols are not interchangeable.

Network

Region

WebSocket URL

Public

China (Shanghai)

wss://nls-gateway-cn-shanghai.aliyuncs.com/ws/v1

China (Beijing)

wss://nls-gateway-cn-beijing.aliyuncs.com/ws/v1

China (Shenzhen)

wss://nls-gateway-cn-shenzhen.aliyuncs.com/ws/v1

VPC

China (Shanghai)

ws://nls-gateway-cn-shanghai-internal.aliyuncs.com:80/ws/v1

China (Beijing)

ws://nls-gateway-cn-beijing-internal.aliyuncs.com:80/ws/v1

China (Shenzhen)

ws://nls-gateway-cn-shenzhen-internal.aliyuncs.com:80/ws/v1

Short sentence recognition and short-text speech synthesis also support RESTful APIs. The following tables list the complete URLs. Real-time speech recognition does not use these two RESTful paths.

Service

Region

RESTful URL

Short sentence recognition

China (Shanghai)

https://nls-gateway-cn-shanghai.aliyuncs.com/stream/v1/asr

China (Beijing)

https://nls-gateway-cn-beijing.aliyuncs.com/stream/v1/asr

China (Shenzhen)

https://nls-gateway-cn-shenzhen.aliyuncs.com/stream/v1/asr

Short-text speech synthesis

China (Shanghai)

https://nls-gateway-cn-shanghai.aliyuncs.com/stream/v1/tts

China (Beijing)

https://nls-gateway-cn-beijing.aliyuncs.com/stream/v1/tts

China (Shenzhen)

https://nls-gateway-cn-shenzhen.aliyuncs.com/stream/v1/tts

To call these RESTful APIs over a VPC in China (Shanghai), China (Beijing), or China (Shenzhen), use http and replace the domain name with the private domain for the region: nls-gateway-cn-shanghai-internal.aliyuncs.com, nls-gateway-cn-beijing-internal.aliyuncs.com, or nls-gateway-cn-shenzhen-internal.aliyuncs.com. Keep the API path unchanged.

Recording file recognition and Speech File Transcriber Lite

Recording file recognition and Speech File Transcriber Lite use POP APIs to submit audio file URLs. Configure the SDK with the domain name for the service and set RegionId to the region ID in the same row.

Region ID

Recording file recognition domain

Speech File Transcriber Lite domain

cn-shanghai

filetrans.cn-shanghai.aliyuncs.com

speechfiletranscriberlite.cn-shanghai.aliyuncs.com

cn-beijing

filetrans.cn-beijing.aliyuncs.com

speechfiletranscriberlite.cn-beijing.aliyuncs.com

cn-shenzhen

filetrans.cn-shenzhen.aliyuncs.com

speechfiletranscriberlite.cn-shenzhen.aliyuncs.com

Recording file recognition (flash version)

The flash version accepts binary audio data in an HTTPS POST request and uses an Appkey and a token for authentication. It does not use the POP domains or the RegionId configuration described above. Use the following endpoints.

Network

Region

URL

Public

China (Shanghai)

https://nls-gateway-cn-shanghai.aliyuncs.com/stream/v1/FlashRecognizer

VPC

China (Shanghai)

http://nls-gateway-cn-shanghai-internal.aliyuncs.com/stream/v1/FlashRecognizer

Streaming text-to-speech synthesis

Streaming text-to-speech synthesis uses the FlowingSpeechSynthesizer message namespace and the following Beijing endpoints. Do not use the message protocols for standard short-text or long-text speech synthesis with this service.

Network

WebSocket URL

Public

wss://nls-gateway-cn-beijing.aliyuncs.com/ws/v1

VPC

ws://nls-gateway-cn-beijing-internal.aliyuncs.com:80/ws/v1

Authentication and region configuration

The token service and speech gateway use different endpoints. Obtain a token before calling a speech API that uses token-based authentication. For instructions, see Obtain a token with an SDK.

The Shanghai, Beijing, and Shenzhen gateways use tokens obtained from nls-meta.cn-shanghai.aliyuncs.com. Switching between these gateways does not require a new Appkey.

The ExpireTime value returned by the token API specifies when the token expires. Correct region and domain settings do not activate services. Check that the required service is activated before making a call.