All Products
Search
Document Center

CreateInstance

Last Updated: Mar 29, 2021

Description

Creates an Artificial Intelligence Recommendation (AIRec) instance. You are charged for creating an AIRec instance. Therefore, we recommend that you understand the billing methods of AIRec in advance. For more information, see Pricing. If you purchase a prepaid instance, your available coupons are used by default when you pay the order.

Before you create an instance, you must complete real-name verification. For more information about how to complete real-name verification, see the documentation of real-name verification.

Method

POST

URI

/openapi/instances

Request parameters

Parameter

Type

Required

Description

type

String

Yes

The type of the instance. Valid values: Standard and Junior.

chargeType

String

Yes

The billing method of the instance. Set the value to PrePaid. When you set the value to PrePaid, make sure that your Alibaba Cloud account supports balance payment or credit payment. Otherwise, the system returns the InvalidPayMethod error message. If you set the value to PrePaid, you must also specify the paymentInfo parameter.

quota

Map

Yes

The quotas to apply for.

userCount

Integer

Yes

The quota for the number of documents in the user table to apply for. For more information about the limits on the quota, see the related documentation.

itemCount

Integer

Yes

The quota for the number of documents in the item table to apply for. For more information about the limits on the quota, see the related documentation.

qps

Integer

Yes

The QPS quota for recommendation requests to apply for. For more information about the limits on the quota, see the related documentation.

paymentInfo

Map

No

The payment information.

duration

Integer

No

The billing duration. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, and 12.

pricingCycle

String

No

The unit of the billing duration. Valid values: Month and Year.

autoRenew

Boolean

No

Specifies whether to enable auto-renewal. Valid values: true and false.

Response parameters

Parameter

Type

Description

RequestId

String

The ID of the request.

Result

Map

The result that is returned.

InstanceId

String

The ID of the instance.

Examples

Sample requests

POST /openapi/instances
{
  "chargeType": "PrePaid",
  "type": "Standard",
  "quota": {
    "userCount": 1000000,
    "qps": 20,
    "itemCount": 1000000
  },
  "paymentInfo": {
    "duration": 1,
    "pricingCycle": "Month",
    "autoRenew": true
  }
}

Sample success responses

JSON format

{
    "RequestId":"8F81A922-6C81-46D6-B78C-CC35E16B1691",
    "Result":{
        "InstanceId": "airec-cn-xxxxx"
    }
}

Sample error responses

JSON format

{
    "Code":"InternalServerError",
    "Message":"An internal server error occurred."
    "RequestId":"829F38F6-E2D6-4109-90A6-888160BD16C2"
}