Skip to main content

RunVideoScriptGenerate

Generates video clip scripts using AI.

Try it now

You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After the run succeeds, OpenAPI Explorer can automatically generate SDK code examples. Debug

RAM authorization

The following table describes the authorization information for this API. You can use it in the Action element of a RAM policy statement to grant RAM users or RAM roles the permission to call this API. Details are as follows:
  • Action: refers to the specific permission point.
  • Access level: refers to the access level of each operation. Valid values: Write, Read, or List.
  • Resource type: refers to the resource types that support authorization in the operation. Details are as follows:
    • For required resource types, an asterisk (*) is prefixed.
    • For operations that do not support resource-level authorization, 全部资源 is used.
  • Condition key: refers to the condition keys defined by the cloud service itself.
  • Dependent action: refers to the other permissions required to successfully perform the operation. The caller must have the permissions of all dependent actions for the operation to succeed.
ActionAccess levelResource typeCondition keyDependent action
aimiaobi:RunVideoScriptGeneratecreate
*All resources
*
    None
None

Request syntax

POST /miaobi/runVideoScriptGenerate HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
WorkspaceIdstringYes

Unique identifier of the Alibaba Cloud Model Studio workspace: Get a Workspace ID

llm-xx
PromptstringYes

The prompt for the video script.

Write a script about Huangshan tourism
UseSearchbooleanNo

Specifies whether to use internet search. If you set this to true, the system performs intent recognition and then searches the internet for relevant reference materials.

true
ScriptLengthstringNo

The length of the script. Valid values:

20~75: 10~15s of normal speaking time.

75~150: 15~30s of normal speaking time.

150~300: approximately 30~60s of normal speaking time.

>=300: 60s or more of normal speaking time.

>=300
LanguagestringNo

The language of the generated script: recommended values:

zh-CN: Chinese

en-US: English

Chinese is used by default.

en-US
ScriptNumberintegerNo

The number of scripts to generate. The default is 1, and up to three scripts can be generated at a time. If multiple scripts are specified, the results of multiple script generation tasks are returned in parallel streams. (The client distinguishes them by session ID.)

2

Response elements

ElementTypeDescriptionExample
object

Schema of Response

Headerobject

The response header.

ErrorCodestring

The error code.

ScriptNumberExceed
ErrorMessagestring

The error message returned when the call fails.

The number of scripts exceeds the limit.
Eventstring

The event name.

result-generated
SessionIdstring

The session ID.

3f7045e099474ba28ceca1b4eb6d6e21
StatusCodeinteger

The status code.

400
TaskIdstring

The task ID.

b057f2fa-2277-477b-babf-cbc062307828
TraceIdstring

The trace ID.

2150451a17191950923411783e2927
Payloadobject

The response body.

Outputobject

The output content object.

Textstring

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!
Usageobject

The token usage.

InputTokenslong

The number of tokens used for the input.

100
OutputTokenslong

The number of tokens used for the output.

100
TotalTokenslong

The total number of tokens.

200
RequestIdstring

The unique ID of the request. This field is returned when the Content-Type is json.

F2F366D6-E9FE-1006-BB70-2C650896AAB5
HttpStatusCodestring

The HTTP status code. This field is returned when the Content-Type is json.

403
Codestring

The status code. A value of 200 indicates a normal response. This field is returned when the Content-Type is json.

NoPermission
Messagestring

The error description. This field is returned when the Content-Type is json.

You are not authorized to perform this action.
Successboolean

Indicates whether the call is successful. true indicates success and false indicates failure. This field is returned when the Content-Type is json.

false

Examples

Success response JSON format
{
  "Header": {
    "ErrorCode": "ScriptNumberExceed",
    "ErrorMessage": "脚本篇数超限",
    "Event": "result-generated\n",
    "SessionId": "3f7045e099474ba28ceca1b4eb6d6e21",
    "StatusCode": 400,
    "TaskId": "b057f2fa-2277-477b-babf-cbc062307828",
    "TraceId": "2150451a17191950923411783e2927"
  },
  "Payload": {
    "Output": {
      "Text": "大家好,我是[xxx]。今天带大家走进黄山,感受奇松、怪石、云海、温泉的绝美风光。首站迎客松,800年历史,枝干如臂,热情迎接每一位游客。接着登光明顶,360度全景尽收眼底。再探秘西海大峡谷,体验原始自然的震撼。最后,在温泉中放松身心,享受旅途的美好。希望这次旅行能给你留下难忘的记忆。我是[你的名字],感谢观看,我们下次再见!\",\"91522b25a4f440189320c9ede8ae6c85\":\"大家好,我是[您的名字],今天带大家探索黄山的奇妙之旅。首先,我们将见到黄山的象征——迎客松,感受它800年的历史与欢迎。随后攀登光明顶,迎接壮丽的日出;漫步西海大峡谷,体验险峻之美;最后,在温泉中放松身心。希望这次旅行能让你爱上黄山。谢谢观看!\",\"1c23af4a899e4b908bdcffa7d8d0ddc9\":\"大家好,欢迎来到黄山!这里以奇松、怪石、云海、温泉四绝闻名。从云谷寺开始,感受古朴氛围;挑战百步云梯,体验攀登乐趣;漫步西海大峡谷,领略壮丽景色;最后在玉屏楼迎接日出,享受心灵的宁静。希望这次旅行给你留下美好回忆!"
    },
    "Usage": {
      "InputTokens": 100,
      "OutputTokens": 100,
      "TotalTokens": 200
    }
  },
  "RequestId": "F2F366D6-E9FE-1006-BB70-2C650896AAB5",
  "HttpStatusCode": 403,
  "Code": "NoPermission",
  "Message": "You are not authorized to perform this action.",
  "Success": false
}

Error codes

HTTP status codeError codeError messageDescription
403NoPermissionYou are not authorized to perform this action.Please check the workspaceId assignment
Visit the Error Center to view more error codes.