All Products
Search
Document Center

Alibaba Cloud Model Studio:HappyOyster-Directing-End Travel API Reference

Last Updated:Sep 20, 2026

End a Directing Travel. After a normal end the status changes to completed and it enters artifact processing; on a no-stream timeout end it changes to failed and no replay artifacts are generated.

Scope

End a Directing Travel. After a normal end the status changes to completed and it enters artifact processing; on a no-stream timeout end it changes to failed and no replay artifacts are generated. Before calling, confirm the following:

  • Authentication: The primary API Key is not required; either the primary or a temporary API Key can call it. For how to obtain them, see Obtain authentication credentials.
  • Prerequisites: The Travel must not yet have entered a terminal state and must be in a state the server can end. Confirm via Query Travel Status.
  • Caller: Either your server or your client can call it.

HTTP request

Singapore

POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v2/apps/happyoyster-1.0-directing/openapi/v1/travels/end

Replace {WorkspaceId} with your actual Workspace ID.

US (Virginia)

POST https://{WorkspaceId}.us-east-1.maas.aliyuncs.com/api/v2/apps/happyoyster-1.0-directing/openapi/v1/travels/end

Replace {WorkspaceId} with your actual Workspace ID.

Request parameters

Normal end

curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v2/apps/happyoyster-1.0-directing/openapi/v1/travels/end' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "encryptedTravelId": "{encryptedTravelId}",
    "userAgent": "your-client/1.2.0"
}'

No-stream timeout end

curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v2/apps/happyoyster-1.0-directing/openapi/v1/travels/end' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "encryptedTravelId": "{encryptedTravelId}",
    "failCode": "TRAVEL_NO_STREAM_AUTO_END",
    "userAgent": "your-client/1.2.0"
}'

Content-Typestring(Required)

Request content type. This parameter must be set to application/json.

Authorization string (Required)

API Key authentication. The primary API Key is not required; either the primary or a temporary API Key can call it.

  • Primary API Key: starts with sk-, e.g. sk-xxx.
  • Temporary API Key: starts with st-, e.g. st-xxx.
Request Body

encryptedTravelId string (Required)

The Directing encrypted Travel ID to end. Returned by Enter Travel.

failCode string (Optional)

The failure end reason. When omitted, it is treated as a normal end. Currently only supported:

  • TRAVEL_NO_STREAM_AUTO_END: for the scenario where no stream is received after entering the room for longer than noStreamAutoEndTimeoutSec; this end type does not generate replay artifacts

Passing an unsupported value returns 400000.

userAgent string (Optional)

SDK or client version identifier. A non-empty string; takes precedence over the HTTP User-Agent.

Response parameters

Normal end

{
    "code": 0,
    "message": null,
    "data": {
        "encryptedTravelId": "trvl_a1b2****",
        "status": "completed",
        "endedAt": "2026-06-04T00:03:00Z",
        "durationSec": 180
    }
}

No-stream timeout end

{
    "code": 0,
    "message": null,
    "data": {
        "encryptedTravelId": "trvl_a1b2****",
        "status": "failed",
        "errorCode": "TRAVEL_NO_STREAM_AUTO_END",
        "errorMessage": "Something went wrong.",
        "endedAt": "2026-06-04T00:03:00Z",
        "durationSec": null
    }
}

code integer

Return code. 0 means success; non-zero is an error code.

message string

Error message. null on success.

data object

Response data. null on failure.

Properties

encryptedTravelId string

The encrypted Travel ID that was ended.

status string

End status: completed (normal end) / failed (failure end when a supported failCode is provided).

errorCode string

Failure reason code; null on a normal end.

errorMessage string

Failure description; null on a normal end.

endedAt string

End time, in ISO 8601 format.

durationSec integer

Effective video duration in seconds; null on a no-stream failure end or when the duration cannot yet be parsed.

Prerequisite states and call notes

  • The client should poll Query Travel Status after entering the room. If rtcStatus has not entered the streaming state within noStreamAutoEndTimeoutSec, end it with TRAVEL_NO_STREAM_AUTO_END.
  • After passing TRAVEL_NO_STREAM_AUTO_END, the Travel becomes failed and no replay artifacts can be queried.
  • On a normal end, durationSec preferentially uses the final video file duration; when the final video is not yet available, it uses the durationMs of the latest currently available generation result. When neither is available, it is null.
  • After a normal end reaches completed, artifact composition may still be in progress; decide whether to keep polling based on the returned status of Query Travel Artifacts.

Error codes

If the model call fails and returns an error, see HappyOyster Error Codes to resolve it.

Next steps

After the Travel enters completed: