Serverless instances

更新时间:
复制 MD 格式

API Gateway Serverless instances suit small to medium-sized production environments. Usage fees consist of API call fees and public outbound traffic fees.

API call volume fees

Serverless instance API calls use tiered pricing based on actual call volume.

Tiered pricing

Unit: CNY/10,000 calls

First 1 million calls per calendar month

Free

0 to 10 million (inclusive)

0.06

10 million to 100 million (inclusive)

0.04

Over 100 million

0.03

Note
  • Billing method: pay-as-you-go.

  • Billing cycle: daily.

  • Bill generation: typically within one hour after each billing cycle ends. Maximum delay: three hours.

  • Payment: fees are automatically deducted from your account balance.

  • Billing currency: CNY.

  • Billable calls: all API requests received by API Gateway.

  • The first one million API calls per calendar month are free. Excess calls use tiered pricing.

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.

image

①: 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

Note
  • 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 example

For example, a Serverless instance with 12 million API calls and 100 GB of public outbound traffic in one month costs CNY 144:

  • For 11 million billable API calls, the cost is CNY 64 (1000 × 0.06 + 100 × 0.04).

  • Traffic fee: 100 × 0.8 = CNY 80.