API Gateway dedicated instances offer high performance and a high Service-Level Agreement (SLA), which makes them suitable for production environments. Fees for dedicated instances include instance usage fees and outbound public network traffic fees. You are not charged based on the number of API calls.
Instance usage fees
API Gateway provides eight instance types. The following table lists the performance metrics for each instance type.
Instance type | Maximum inbound requests per second (RPS) | Maximum inbound connections | Maximum inbound new connections per second (CPS) | Maximum outbound connection pool size | Maximum inbound public bandwidth (bps) | Maximum outbound public bandwidth (bps) | SLA |
api.s1.small | 2,500 | 50,000 | 5,000 | 1,200 | 5120 MB | 100 M | 99.95% |
api.s1.medium | 5,000 | 100,000 | 5,000 | 2,400 | 5120 MB | 100 M | 99.95% |
api.s2.large | 10,000 | 200,000 | 5,000 | 4,800 | 5120 MB | 200 Mbps | 99.99% |
api.s2.large.x2 | 20,000 | 400,000 | 10,000 | 9,600 | 5120 MB | 200 M | 99.99% |
api.s2.large.x3 | 30,000 | 600,000 | 10,000 | 14,400 | 5120 MB | 400 M | 99.99% |
api.s2.large.x4 | 40,000 | 800,000 | 20,000 | 19,200 | 5120 M | 400 M | 99.99% |
api.s2.large.x5 | 50,000 | 1,000,000 | 20,000 | 24,000 | 5120 MB | 600 MB | 99.99% |
api.s2.large.x6 | 60,000 | 1,000,000 | 20,000 | 28,800 | 5120 MB | 600 M | 99.99% |
Each instance type offers two billing methods: pay-as-you-go (hourly) and subscription (monthly or yearly). The following table lists the instance usage fees for each region.
The prices in the following table are list prices. To view promotional prices, visit the API Gateway purchase page.
Region | Instance type | Pay-as-you-go (CNY/hour) - List price | Subscription (CNY/month) - List price | Subscription (CNY/year) - List price |
China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Shenzhen), China (Chengdu) | api.s1.small | 5.940 | 3,680.00 | 44,160.00 |
api.s1.medium | 16.100 | 9,980.00 | 119,760.00 | |
api.s2.large | 46.130 | 28,600.00 | 343,200.00 | |
api.s2.large.x2-api.s2.large.x6 | See product purchase page | See product purchase page | See product purchase page | |
China (Hong Kong), Singapore, Malaysia (Kuala Lumpur), Indonesia (Jakarta), Japan (Tokyo), Germany (Frankfurt), UK (London), US (Silicon Valley), US (Virginia) | api.s1.small | 6.324 | 3,808.00 | 45,696.00 |
api.s1.medium | 17.680 | 10,608.00 | 127,296.00 | |
api.s2.large | 50.524 | 30,328.00 | 363,936.00 | |
api.s2.large.x2-api.s2.large.x6 | See product purchase page | See product purchase page | See product purchase page | |
UAE (Dubai) | api.s1.small | 11.084 | 6,664.00 | 79,968.00 |
api.s1.medium | 28.220 | 16,918.40 | 203,020.80 | |
api.s2.large | 64.464 | 38,678.40 | 464,140.80 | |
api.s2.large.x2-api.s2.large.x6 | See product purchase page | See product purchase page | See product purchase page |
Billing for pay-as-you-go instances starts after an instance is created and running. You can release pay-as-you-go dedicated instances at any time to stop billing.
The minimum billing cycle for the pay-as-you-go method is one hour. Usage for less than one hour is billed as one hour.
If a dedicated instance fails to be created, the system automatically refunds the fees for the corresponding subscription order. You are not billed for pay-as-you-go orders.
Outbound public network traffic fees
When you use API Gateway instances (dedicated and serverless), you are billed for the actual outbound traffic that is consumed over the public network. The following figure shows an analysis of outbound public network traffic during an API call.

①: The client sends an API call request. The traffic direction is from the client to API Gateway.
②: After processing the request, the API Gateway instance sends a call request to the backend service. The traffic direction is from the API Gateway instance to the backend service.
③: The backend service sends a response packet. The traffic direction is from the backend service to the API Gateway instance.
④: API Gateway forwards the HTTP response packet to the client. The traffic direction is from the API Gateway instance to the client.
Therefore, outbound public network traffic may be generated in steps ② and ④. The specific behavior varies based on the scenario.
In step ② (API Gateway sends a request to the backend service), the billing for outbound traffic depends on the backend service type and network configuration:
Backend service type | Network connectivity between API Gateway and the backend service | Is traffic from step 2 billed as outbound public traffic? |
HTTP(S) service | The backend service is in a non-Alibaba Cloud environment and is accessed over the Internet. | Yes |
The backend service is on Alibaba Cloud, and the configured backend service address is the public IP address of the resource. | Yes | |
VPC | API Gateway accesses resources (such as ECS instances) in a VPC within the same region (under the same or a different account). | No |
API Gateway accesses resources in a VPC in another region through Cloud Enterprise Network (CEN). | No | |
API Gateway accesses resources (such as physical servers) in your data center through CEN. | No | |
Function Compute | API Gateway accesses Function Compute in the same region over the internal network. | No |
API Gateway accesses Function Compute in a different region over the public network. | Yes | |
Mock | Impersonation mode. No real backend service is accessed. | No |
Big data products (such as DataWorks and Dataphin) | DataWorks or Dataphin creates a data service in the same region. | No |
Database products (such as DMS) | DMS creates a data service in the same region. | No |
The following table describes the behavior for Step ④, the response from API Gateway to the client request, in different scenarios.
Client network environment | Method of accessing API Gateway | Is traffic from step ④ billed as outbound public traffic? |
The client is in a non-Alibaba Cloud environment. | Access API Gateway over the public network (using the public domain name bound to the API group). For more information, see Access an API over an HTTPS domain name. | Yes |
The client is in an Alibaba Cloud environment. | Access API Gateway over the public network (using the public domain name bound to the API group). | Yes |
Within the same region | Access API Gateway using a second-level VPC domain name (or an internal domain name that is bound to this CNAME). | No |
The network is set up using CEN. The client is in a VPC in another region or in your data center. | Access API Gateway using the second-level VPC domain name of the API group (or an internal domain name that is bound to this CNAME). | No |
The following table lists the traffic prices.
Region | Outbound public network traffic price (CNY/GB) |
China (Hangzhou), China (Shanghai), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Shenzhen), China (Heyuan), China (Chengdu) | 0.8 |
China (Qingdao) | 0.72 |
China (Hong Kong) | 1.00 |
Singapore | 0.75 |
Malaysia (Kuala Lumpur) | 0.77 |
Indonesia (Jakarta) | 0.75 |
Japan (Tokyo) | 0.82 |
Germany (Frankfurt), UK (London) | 0.5 |
US (Silicon Valley), US (Virginia) | 0.5 |
UAE (Dubai) | 3.0 |
Billing method: Pay-as-you-go.
Billing cycle: Daily.
Billing time: Bills are typically generated within one hour after the current billing cycle ends, and no later than three hours after.
Payment method: After a bill is generated, the fees are automatically deducted from your account balance.
Billing examples
Example 1: You create a pay-as-you-go api.s1.small dedicated instance in the China (Hangzhou) region. The backend service type is VPC. A client on the Internet calls the API that is published on the gateway. You release the instance after 9.5 hours. During this time, 10 GB of outbound public network traffic is generated. The total fee is CNY 67.4. The dedicated instance fee is 10 hours × CNY 5.94/hour = CNY 59.4. The traffic fee is 10 GB × CNY 0.8/GB = CNY 8.
Example 2: You create a subscription api.s1.small dedicated instance in the China (Beijing) region for one month. The backend service is a VPC. The client that calls the API is a resource in a VPC that is in the same region. The total fee is CNY 3,680. The dedicated instance fee is CNY 3,680. No outbound public network traffic is generated, so the traffic fee is 0.
Recommendations for using dedicated instances
How do I choose a subscription instance type?
API Gateway evaluates instance types based on the maximum requests per second (RPS). Under the same conditions, the number of queries per second (QPS) is greater than the number of RPS. Therefore, you can use QPS to estimate the required instance type.
How do I choose an instance type for events or scenarios with traffic spikes?
API Gateway provides two solutions:
Method 1: Use a subscription instance and upgrade or downgrade it as needed. For more information about how to upgrade or downgrade an instance, see Upgrade or downgrade an instance.
Method 2: Use a combination of subscription instances, pay-as-you-go instances, and group migration. For example, your average daily QPS is 2,000. During an event, the QPS is expected to increase to 4,000 for 24 hours. You can perform the following steps:
Purchase a yearly subscription for an api.s1.small instance for daily use.
Before the traffic increases, purchase a pay-as-you-go api.s1.medium instance. Three hours before the event starts, switch the API group to the new pay-as-you-go instance in the API Gateway console. After the switch is complete, verify that the API group is accessible. After the event ends, switch the API group back to the daily subscription instance (api.s1.small) in the API Gateway console. After you verify that the API group is accessible, release the pay-as-you-go instance. This way, you are charged only a small fee for the pay-as-you-go instance.