Generates video clip scripts using AI.
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.
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
Actionelement 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
Resourceelement of the policy. - For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the
Resourceelement of the policy.
- For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the
- 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 |
|---|---|---|---|---|
aimiaobi:RunVideoScriptGenerate | create | *All Resource
| None | None |
Request syntax
Request parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| WorkspaceId | string | Yes | The unique ID of the Alibaba Cloud Model Studio workspace. For more information, see Get a Workspace ID. | llm-xx |
| Prompt | string | Yes | The prompt for the video script. | Write a script about Huangshan tourism |
| UseSearch | boolean | No | Specifies whether to use an internet search. If you set this to true, the system performs intent recognition and then searches the internet for relevant reference materials. | true |
| ScriptLength | string | No | The length of the script. Valid values: 20~75: 10 to 15 seconds of normal speaking time. 75~150: 15 to 30 seconds of normal speaking time. 150~300: Approximately 30 to 60 seconds of normal speaking time. >=300: 60 seconds or more of normal speaking time. | >=300 |
| Language | string | No | The language of the generated script. Recommended values: zh-CN: Chinese en-US: English The default is Chinese. | en-US |
| ScriptNumber | integer | No | The number of scripts to generate. The default is 1. You can generate a maximum of three scripts at a time. If you specify multiple scripts, the results are returned in parallel streams. The client distinguishes between the streams using different session IDs. | 2 |
Response elements
Element | Type | Description | Example |
|---|---|---|---|
object | Schema of Response | ||
| Header | object | The response header. | |
| ErrorCode | string | The error code. | ScriptNumberExceed |
| ErrorMessage | string | The error message returned when the call fails. | Script number exceeded |
| Event | string | The event name. | result-generated |
| SessionId | string | The session ID. | 3f7045e099474ba28ceca1b4eb6d6e21 |
| StatusCode | integer | The status code. | 400 |
| TaskId | string | The task ID. | b057f2fa-2277-477b-babf-cbc062307828 |
| TraceId | string | The trace ID. | 2150451a17191950923411783e2927 |
| Payload | object | The response body. | |
| Output | object | The output content object. | |
| Text | string | The text generation result. | Hello everyone, I'm [xxx]. Today I'll take you to Mount Huangshan to experience the stunning scenery of peculiar pines, bizarre rocks, sea of clouds, and hot springs. First stop, the Greeting Pine, with 800 years of history, its branches stretching like arms to warmly welcome every visitor. Next, climb to Bright Summit for a 360-degree panoramic view. Then explore the West Sea Grand Canyon and experience the awe of pristine nature. Finally, relax in the hot springs and enjoy the beauty of the journey. I hope this trip leaves you with unforgettable memories. I'm [your name], thanks for watching, see you next time!","91522b25a4f440189320c9ede8ae6c85":"Hello everyone, I'm [your name]. Today let's explore the wonderful journey of Mount Huangshan. First, we'll see the symbol of Huangshan—the Greeting Pine—and feel its 800 years of history and welcome. Then climb to Bright Summit to greet the magnificent sunrise; stroll through the West Sea Grand Canyon to experience its rugged beauty; finally, relax in the hot springs. I hope this trip makes you fall in love with Huangshan. Thanks for watching!","1c23af4a899e4b908bdcffa7d8d0ddc9":"Hello everyone, welcome to Mount Huangshan! It's famous for the Four Wonders: peculiar pines, bizarre rocks, sea of clouds, and hot springs. Start from Cloud Valley Temple to feel the ancient atmosphere; challenge the Hundred-Step Cloud Ladder to experience the fun of climbing; stroll through the West Sea Grand Canyon to take in the magnificent scenery; finally, greet the sunrise at Jade Screen Pavilion and enjoy the peace of mind. I hope this trip leaves you with wonderful memories! |
| Usage | object | The token usage. | |
| InputTokens | integer | The number of tokens used for the input. | 100 |
| OutputTokens | integer | The number of tokens for the output. | 100 |
| TotalTokens | integer | The total number of tokens. | 200 |
| RequestId | string | The unique ID of the request. This field is returned when the `Content-Type` is `json`. | F2F366D6-E9FE-1006-BB70-2C650896AAB5 |
| HttpStatusCode | string | The HTTP status code. This field is returned when the `Content-Type` is `json`. | 403 |
| Code | string | The status code. A value of 200 indicates a normal response. This field is returned when the `Content-Type` is `json`. | NoPermission |
| Message | string | The error description. This field is returned when the `Content-Type` is `json`. | You are not authorized to perform this action. |
| Success | boolean | Indicates whether the request was successful. `true` indicates success. `false` indicates failure. This field is returned when the `Content-Type` is `json`. | false |
Examples
Success response
JSON format
Error codes
HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 403 | NoPermission | You are not authorized to perform this action. | Please check the workspaceId assignment |