With Amazon API Gateway, you only pay when your APIs are in use. There are no minimum fees or upfront commitments. For HTTP/REST APIs, you pay only for the API calls you receive and the amount of data transferred out. For WebSocket APIs, you only pay when your APIs are in use based on number of messages sent and received and connection minutes.

HTTP/REST APIs

Pay only for the API calls you receive and the amount of data transferred out. API Gateway also provides optional data caching charged at an hourly rate that varies based on the cache size you select.

API Calls

Number of Requests (per month) Price (per million) (Beijing/Ningxia)
First 333 million ¥28.94
Next 667 million ¥24.04
Next 19 billion ¥20.43
Over 20 billion ¥13.01

Data Transfer Costs

If you use out-to-Internet data transfers, you will be charged at the EC2 data transfer rate.

Caching

For better performance and faster API execution, you can optionally provision a dedicated cache for each stage of your APIs. After you specify the size of the cache you require, you will be charged the following hourly rates for each stage’s cache, without any long-term commitments.

Cache Memory Size (GB) Price (Beijing/Ningxia)
0.5 ¥ 0.19
1.6 ¥ 0.37
6.1 ¥ 1.67
13.5 ¥ 1.97
28.4 ¥ 3.81
58.2 ¥ 7.49
118 ¥ 14.98
237 ¥ 29.96

Detailed Metrics and Logging

When method-level metrics are enabled and logging is set up, the information is sent directly to CloudWatch in your account and charged at the CloudWatch rates.

WebSocket APIs

Pay only for messages sent and received and the total number of connection minutes. You may send and receive messages up to 128 kilobyte (KB) in size. Messages are metered in 32 KB increments. So, a 33 KB message is metered as two messages.

Message Transfers

Number of Requests (per month) Price (per million) (Beijing/Ningxia)
First 1 billion ¥8.58
Over 1 billion ¥7.22

Connection Minutes

¥2.15 per million connection minutes