RunVideoScriptGenerate

Updated at:

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

aimiaobi:RunVideoScriptGenerate

create

*All Resource

*

NoneNone

Request syntax

POST /miaobi/runVideoScriptGenerate HTTP/1.1

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.

写一篇关于黄山旅游的脚本

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.

脚本篇数超限

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.

大家好,我是[xxx]。今天带大家走进黄山,感受奇松、怪石、云海、温泉的绝美风光。首站迎客松,800年历史,枝干如臂,热情迎接每一位游客。接着登光明顶,360度全景尽收眼底。再探秘西海大峡谷,体验原始自然的震撼。最后,在温泉中放松身心,享受旅途的美好。希望这次旅行能给你留下难忘的记忆。我是[你的名字],感谢观看,我们下次再见!","91522b25a4f440189320c9ede8ae6c85":"大家好,我是[您的名字],今天带大家探索黄山的奇妙之旅。首先,我们将见到黄山的象征——迎客松,感受它800年的历史与欢迎。随后攀登光明顶,迎接壮丽的日出;漫步西海大峡谷,体验险峻之美;最后,在温泉中放松身心。希望这次旅行能让你爱上黄山。谢谢观看!","1c23af4a899e4b908bdcffa7d8d0ddc9":"大家好,欢迎来到黄山!这里以奇松、怪石、云海、温泉四绝闻名。从云谷寺开始,感受古朴氛围;挑战百步云梯,体验攀登乐趣;漫步西海大峡谷,领略壮丽景色;最后在玉屏楼迎接日出,享受心灵的宁静。希望这次旅行给你留下美好回忆!

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

{
  "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 code

Error code

Error message

Description

403NoPermissionYou are not authorized to perform this action.Please check the workspaceId assignment

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.