Create a real-time directing World. Supports standard mode (natural-language prompt) and script mode (structured ScriptList); the API immediately returns an encrypted World ID, the World builds asynchronously in the background, and the client polls the build progress until it completes.
Scope
Create a Directing World. Before calling, confirm the following:
-
Authentication: Only the primary API Key is supported; temporary API Keys cannot be used (error code
403003).- Get the primary API Key: Get and configure an API Key.
-
Call mode: Asynchronous mode is recommended.
- Asynchronous mode (default):
async=true, the API immediately returnsencryptedWorldId; poll Query World Build Status for progress. - Synchronous mode:
async=false, the server polls internally (every 3s, up to 120s) and returns when the build completes; on timeout it falls back to asynchronous and the client keeps polling.
- Asynchronous mode (default):
-
Endpoint restrictions: This endpoint can only create a Directing World. You do not need to pass
mode(the server writes2; passing a value other than2returns400000).creationModelsupportssimple(standard mode, default) andscriptlist(script mode); the enter-room version is fixed tostoryV2, andaspectRatioandmaxExperienceTimeSecare fixed tonull.
HTTP request
- Singapore
- US (Virginia)
POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v2/apps/happyoyster-1.0-directing/openapi/v1/worldsReplace {WorkspaceId} with your actual Workspace ID.Standard mode (creationModel=simple)
Request parameters |
|
Content-Typestring(Required)Request content type. This parameter must be set to application/json. | |
Authorization string (Required)API Key authentication. Only the primary API Key is supported; it starts with sk-, e.g. sk-xxx. It is typically configured as the environment variable $DASHSCOPE_API_KEY. A temporary API Key (starting with st-) returns 403003. | |
Request Body | |
async boolean (Optional)Whether to create asynchronously. Defaults to true:
| |
creationModel string (Optional)Creation sub-mode; pass simple for standard mode (default). You provide a natural-language prompt, and the server generates the full 45-beat script, the first frame (which you may provide), and character reference images. After the World is created, you can call the following control endpoints during the Travel phase:
| |
eventStyle string (Optional)Applies to creationModel=simple only: selects the script-generation template. Defaults to normal. Allowed values:
| |
refWorldId string (Optional)Derive a new creation from an existing Directing World. Must be a Directing encrypted World ID under the current primary account; a World from another model or another primary account returns 403001. | |
prompt string (Required)World theme description; Chinese and English are supported. Non-empty, up to 2000 characters. | |
resolution string (Required)Video resolution. Allowed values:
| |
layout string (Optional)Camera movement style (how the camera moves and how hard it cuts). Allowed values:
| |
narrative string (Optional)Narrative style (how dense the drama is and how strong the emotion is). Allowed values:
| |
firstFrameImage object (Optional)When provided, it is reused directly as the World's first frame, skipping AI first-frame generation. url and base64 are mutually exclusive (choose one). Image constraints:
Properties url string (Conditionally required)First-frame image URL. Constraints:
string (Conditionally required)First-frame image base64. Constraints:
string (Optional)Reference-image type. Defaults to default. | |
inputImages array (Optional)Used for script generation and character reference images, up to 6 images, independent of firstFrameImage. For each array item, url and base64 are mutually exclusive (choose one). Image constraints:
Properties url string (Conditionally required)Image URL. Constraints:
string (Conditionally required)Image base64. Constraints:
string (Optional)Reference-image type. Defaults to default. |
Script mode (creationModel=scriptlist)
Request parameters |
|
Content-Typestring(Required)Request content type. This parameter must be set to application/json. | |
Authorization string (Required)API Key authentication. Only the primary API Key is supported; it starts with sk-, e.g. sk-xxx. It is typically configured as the environment variable $DASHSCOPE_API_KEY. A temporary API Key (starting with st-) returns 403003. | |
Request Body | |
async boolean (Optional)Whether to create asynchronously. Defaults to true:
| |
creationModel string (Optional)Creation sub-mode; pass scriptlist for script mode. You provide the structured script, and the server no longer generates a script — it only assembles and persists it. After the World is created, you can call the following control endpoints during the Travel phase:
instruct (send text process instructions) is not supported. See Additional notes for a description of each endpoint.eventStyle is not consumed by scriptlist creation; do not pass it. | |
refWorldId string (Optional)Derive a new creation from an existing Directing World. Must be a Directing encrypted World ID under the current primary account; a World from another model or another primary account returns 403001. | |
resolution string (Required)Video resolution. Allowed values:
| |
firstFrameImage object (Required)An image reference reused directly as the World's first frame. url and base64 are mutually exclusive (choose one). Image constraints:
Properties url string (Conditionally required)First-frame image URL. Constraints:
string (Conditionally required)First-frame image base64. Constraints:
string (Optional)Reference-image type. Defaults to default. | |
scriptList object (Required)Structured script. Must include synopsis and a non-empty acts.
Properties synopsis string (Required)Story synopsis. Non-empty, up to 2000 characters.videoTitle string (Optional)World name. Defaults to New World, up to 128 characters.scene string (Optional)Scene setting. Defaults to Static Shot, up to 64 characters.style string (Optional)Visual style. Defaults to Stable, up to 64 characters.speed string (Optional)Narrative pacing. Defaults to Steady, up to 64 characters.language string (Optional)Script language. Defaults to en (English); pass zh for Chinese. Up to 64 characters.setting string (Optional)Worldview or background setting. Up to 2000 characters.soundtrack string (Optional)Soundtrack description. Up to 500 characters.prologue string (Optional)Opening prologue. Up to 1000 characters.videoTags array<string> (Optional)Video tags. Up to 20 tags, each up to 32 characters.subjects array<object> (Optional)Predefined subjects, up to 6. Each array item contains the following properties:
subjects[] properties label string (Optional)References a subject in acts[].content. Formatted as [character_x], assigned in array order by default.name string (Optional)Human-readable name, not rendered as on-screen text. Up to 64 characters.type string (Optional)Subject type. Defaults to character. Determines the subject's appearance and how the other properties are filled in. Allowed values:
object (Optional)Subject reference image; url and base64 are mutually exclusive (choose one), and the image must be strictly less than 6 MB.
refImage properties url string (Conditionally required)Subject reference image URL.base64 string (Conditionally required)Subject reference image base64.referenceType string (Optional)Reference-image type. Defaults to default.string (Optional)Gender description. Up to 64 characters.position string (Optional)On-screen position. Up to 64 characters.ethnicity string (Optional)Ethnicity or race description. Up to 64 characters.age string (Optional)Age description. Up to 64 characters.appearance string (Optional)Appearance details. Up to 500 characters.voice string (Optional)Voice, speaking rate, and volume description. Up to 200 characters.array<object> (Required)Beat-by-beat script, 1–45 entries, with all content totaling no more than 100000 characters. Each array item contains the following properties:
acts[] properties turn int (Optional)Turn number. 1–45, no duplicates, incrementing from 1 in array order by default.content string (Required)Script for this beat. Non-empty, up to 2000 characters per beat; can reference subjects with [character_x].cameraType string (Optional)Camera type (how the camera shoots). Defaults to Static. Allowed values:
string (Optional)Shot size. Defaults to Medium. Determines how much detail this beat can carry; change shot size via cuts, and do not describe both the full body and fingertips in the same beat. Allowed values:
cut-in to Close-up, then cut-out back to a wide shot; use long-take for most beats to hold the same shot size and avoid jumping shot sizes back and forth.cut string (Optional)Cut method (how this beat cuts in). Defaults to long-take. Allowed values:
|
Response parameters |
|
code integerReturn code. 0 means success; non-zero is an error code. | |
message stringError message. null on success. | |
data objectResponse data. null on failure.
Properties encryptedWorldId stringEncrypted World ID, returned in both synchronous and asynchronous modes. This value is used for subsequent build-status queries, World detail queries, and exchanging an experience credential.status stringCurrent creation status:
stringWorld first-frame URL; null before it is generated. |
Additional notes
- Character counting: The "up to N characters" limits in this document are counted by character (Unicode characters), regardless of Chinese or English — Chinese characters, English letters, digits, spaces, and punctuation each count as 1 character.
-
ScriptList submission requirements: When creating a World,
actsis limited to 45 entries but is not required to be exactly 45; the full 45 entries are only required when calling update-script during Travel. -
Travel control endpoints: The endpoint names listed under
creationModelare server-side endpoints that can be called during the Travel phase after the World is created, not enum values for this endpoint's input. Their meanings are as follows:instruct: send text process instructions to a running Travel; standard mode only.pause: pause the Travel.resume: resume playback.rewind: rewind to a specified time point; requires pausing first.end: end the Travel.update-script: fully replace the script; script mode only.
Error codes
If the model call fails and returns an error, see HappyOyster Error Codes to resolve it.
Next steps
After creating successfully, you can:
- Query World Build Status: poll every 3–5 seconds until the World enters
ready. - After the World enters
ready, call Get Travel Credential to exchange for a single-useticket. - Query World Detail: query the full creation metadata and ScriptList.