tencent cloud

Tencent Cloud TI Platform

Related Agreement
Kebijakan Privasi
Perjanjian Pemrosesan dan Keamanan Data
DokumentasiTencent Cloud TI Platform

Online Service Calling

Mode fokus
Ukuran font
Terakhir diperbarui: 2025-05-09 15:12:04

API Online Testing

Online services offer the capacity for online testing of APIs. Deployed online services can be used for API calling testing.
1. Log in to the TI-ONE console. Select Model Service > Online Service in the left navigation bar to enter the online service list page.
2. On the service list page, click Call to enter the service calling page and view the service API information.
3. Click online test in the API list to enter the calling test page.
4. Enter the API URL you want to test in the API call address bar. Some built-in images provide a default URL. To test other APIs, just directly modify it.
5. Enter the request information in JSON format in the request body module and click send request. Then, you can view the forecast result in the request response module.

Calling over Public Networks

After deploying the online services on TI-ONE, the system will automatically register the API gateway to generate a public network address for service request calling. You can click Call on the service list page to enter the service calling page and view the public network access address. Using this call information, you can initiate forecast requests to the online services. The curl command example is as follows, where Authorization is only required when authentication is enabled:
curl -X POST https://ms-9******j-100******5.gw.ap-guangzhou.ti.tencentcs.com/ms-9******j/v1/models/m:predict -H 'Authorization: P*********pg' -H 'Content-Type: application/json' -d ''
Part of the existing services (with the domain name apigw.tencentcs.com) are still using the historic link. The underlying product of this link will soon stop providing support. At that time, this calling method will be unavailable. You are advised to use the new address or create a new service to migrate services as soon as possible. For details, see [Important] API Gateway Product Sales Discontinuation Announcement. The following is an example of the curl command for this link:
curl http://service-94****g0-130****662.gz.apigw.tencentcs.com:80/tione/v1/models/m:predict -d'{"images":["https://qcloudimg.tencent-cloud.cn/raw/aab789b6e047fa804bbf803de16f49a0.jpeg"]}'
Enable service authentication. When calling an API, you need to use the signature key (ApiAppKey and ApiAppSecret) to calculate the signature of the requested content. For the signature calculation process, see Application-Enabled Authentication Method.

Calling over Private Networks

High-Speed Service Calling

Public network links are subject to various factors. If you have higher requirements for the performance and stability of requests, it is recommended to use Private Network High-Speed Service Calling to access your service. High-speed service calling establishes a high-speed channel between the user VPC and the service through Private Links. The specific operations are as follows:

1. Log in to the TI-ONE console. Select Model Service > Online Service in the left navigation bar to enter the online service list page.
2. On the service list page, click Service Name to enter the service version list page. Click Service Calling to view the calling-related information about the configuration service.
3. For the initial configuration of the High-Speed Service Calling module, click Enable Adding New High-Speed Service Calling IP Range.



4. In the configuration pop-up window, select the VPC and subnet you need to connect to the private network.



5. After the VPC and subnet are configured, the High-Speed Service Calling module shows the VPC calling address and the information on the callable VPCs and subnets. After configuration, you can delete and then re-add the VPC calling address. If the online services have 2 versions, there are 2 private network addresses.

6. For service calling, if you need to make private network API calls in the terminal, you can execute the following command:
//Private network address. Please refer to the service calling, high-speed service calling or VPC calling address.
//The URL is the one in the service calling, API information, and API call address.
curl -X POST -H 'Content-Type: application/json' private network address/URL -d '{ "prompt": "puppy dog", "steps": 5}'
Notes:
Once the configuration is enabled, all services in this region will take effect. This feature uses a private link. After configuration, an endpoint will be created under your account's VPC and subnet, which are billed independently. You can refer to Billing Overview.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan