Apply for EIP
Updated at:2025-10-16
- Apply for an EIP, which can be bound to any BLB or BCC instance.
- Real-name certification is required for creating EIP. Those who have not passed real-time certification can access real-time certification under security certification in the Baidu AI Cloud Official Website Console for such certification.
Request structure
Plain Text
1POST /v{version}/eip?clientToken={clientToken} HTTP/1.1
2Host: eip.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "name": name,
7 "ipVersion": ipVersion,
8 "bandwidthInMbps": bandwidthInMbps,
9 "billing":{
10 "paymentTiming": paymentTiming,
11 "billingMethod": billingMethod,
12 "reservation":{
13 "reservationLength": reservationLength,
14 "reservationTimeUnit": reservationTimeUnit
15 }
16 },
17 "tags":[
18 {
19 "tagKey": tagKey,
20 "tagValue": tagValue
21 }
22 ],
23 "resourceGroupId":resourceGroupId,
24 "deleteProtect":deleteProtect
25}
Request headers
No special headers beyond common headers.
Request parameters
| Parameter name | Types | Whether required | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | The current API version number is 1. |
| clientToken | String | Yes | Query | Idempotence token; refer to [Idempotence](EIP/API Reference/General Description.md#Idempotence) for details |
| ipVersion | String | No | RequestBody | EIP IP types include IPv4 and IPv6, with the default type being IPv4. |
| routeType | String | No | RequestBody | EIP line types include standard BGP (BGP) and enhanced BGP (BGP_S). If no type is specified, it defaults to standard BGP. |
| bandwidthInMbps | int | Yes | RequestBody | Public network bandwidth, in Mbps. For prepaid EIPs as well as postpaid EIPs billed by bandwidth usage, standard BGP is limited to integers within the range of 1~500, and enhanced BGP to the range of 100~5,000 (representing the upper limit of the bandwidth); for postpaid EIPs billed by traffic, standard BGP is limited to integers within the range of 1~200 (representing peak bandwidth traffic allowance) |
| billing | [Billing](EIP/API Reference/Appendix 1.md#Billing) | Yes | RequestBody | Order details. |
| name | String | No | RequestBody | Length: 1–65 characters, starting with a letter. It may include letters, numbers, and the symbols -\_/., and if left unspecified, the service will automatically generate a name. |
| tags | List<[TagModel](EIP/API Reference/Appendix 1.md#TagModel)> | No | RequestBody | List of tag key-value pairs to be created. |
| resourceGroupId | String | No | RequestBody | ID of the resource group bound simultaneously when creating the EIP |
| autoRenewTimeUnit | String | No | RequestBody | Supports enabling auto-renewal when creating EIP, with values available as "month" or "year" (default is "month"). |
| autoRenewTime | int | No | RequestBody | Supports creating EIP with auto-renewal enabled. The value range depends on autoRenewTimeUnit: 1–9 for months and 1–3 for years. |
| deleteProtect | Boolean | No | RequestBody | Option to enable release protection. By default, it is set to false, allowing deletion. |
Response status code
Respond with 200 after successful operation, and respond with error codes after failed operation, as shown in [Error Codes](EIP/API Reference/Error code.md)
Response headers
No special headers beyond common headers.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| eip | string | Assigned EIP address |
Request example: Postpaid IPv4 EIP with traffic-based billing
Plain Text
1POST /v1/eip?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
2HOST eip.bj.baidubce.com
3Authorization bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02
4
5{
6 "name":"eip-for-test",
7 "routeType":"BGP_S"
8 "bandwidthInMbps": 1,
9 "billing":{
10 "paymentTiming":"Postpaid",
11 "billingMethod":"ByTraffic"
12 },
13 "tags":[
14 {
15 "tagKey": "tagK",
16 "tagValue": "tagV"
17 }
18 ],
19 "resourceGroupId":"RESG-J7PdULjguvB",
20 "deleteProtect":true
21}
Request example: Postpaid IPv6 EIP with bandwidth-based billing
Plain Text
1POST /v1/eip?clientToken=7ed1cb90-54e6-4478-a8cd-95f1554103e6 HTTP/1.1
2HOST eip.bj.baidubce.com
3Authorization bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02
4
5{
6 "name":"eip_v6_test",
7 "ipVersion":"ipv6",
8 "routeType":"BGP",
9 "bandwidthInMbps": 100,
10 "billing":{
11 "paymentTiming":"Postpaid",
12 "billingMethod":"ByBandwidth"
13 }
14}
Request example: IPv4 EIP repay
Plain Text
1POST /v1/eip?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
2HOST eip.bj.baidubce.com
3Authorization bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02
4
5{
6 "name":"eip-for-test",
7 "bandwidthInMbps": 1,
8 "billing":{
9 "paymentTiming":"Prepaid",
10 "reservation":{
11 "reservationLength":1,
12 "reservationTimeUnit":"Month"
13 }
14 }
15}
IPv4 EIP response example
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
3Date: Wed, 10 Apr 2016 08:26:52 GMT
4Transfer-Encoding: chunked
5Content-Type: application/json;charset=UTF-8
6Server: BWS
7
8{
9 "eip":"180.181.3.133"
10}
IPv6 EIP response example
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: f5df80be-3d7f-4385-9a30-fc26c7336927
3Date: Wed, 10 Apr 2024 09:26:42 GMT
4Transfer-Encoding: chunked
5Content-Type: application/json;charset=UTF-8
6Server: BWS
7
8{
9 "eip":"240c:4082:ffff:ff01:0:4:0:12a"
10}
