All Products
Search
Document Center

Resource Orchestration Service:CreateAITask

Last Updated:Aug 28, 2026

Creates an AI task to generate or repair infrastructure templates.

Operation description

Creates an AI task of the specified type, covering capabilities from natural language understanding to resource stack deployment. Returns a unique TaskId to track task status and results.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ros:CreateAITask

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

TaskType

string

No

AI task type. Valid values:

  • GenerateTemplate: generates a template by using AI.

  • FixTemplate: repairs an existing template by using AI.

Valid values:

  • GenerateTemplate :

    GenerateTemplate

  • FixTemplate :

    FixTemplate

GenerateTemplate

Prompt

string

No

Input for the AI task.

  • For GenerateTemplate tasks, describes the template functionality to generate.

  • For FixTemplate tasks, describes how to repair the template.

Create an ECS instance and deploy an NGINX service

Template

string

No

Original template to fix or modify. Used when TaskType is FixTemplate.

{"ROSTemplateFormatVersion": "2015-09-01"}

TemplateType

string

No

Template type to generate or repair. Default: ROS.

Valid values:

  • ROS :

    ROS

  • Terraform :

    Terraform

ROS

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

Request ID.

B288A0BE-D927-4888-B0F7-B35EF84B6E6F

TaskId

string

AI task ID.

t-asas*****

Code

string

Error code.

Forbidden

Message

string

Error message.

You are not authorized to complete this action.

Success

string

Whether the request succeeded. Valid values:

  • true: succeeded.

  • false: failed.

true

HttpStatusCode

integer

HTTP status code.

200

Examples

Success response

JSON format

{
  "RequestId": "B288A0BE-D927-4888-B0F7-B35EF84B6E6F",
  "TaskId": "t-asas*****",
  "Code": "Forbidden",
  "Message": "You are not authorized to complete this action.",
  "Success": "true",
  "HttpStatusCode": 200
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.