Text To Video
POST https://api.newportai.com/api/async/text2video
Text_to_video automatically generates videos based on text prompt. Users type a description, and the Text_to_video API creates a four seconds corresponding video.
Request Headers
- Content-TypestringRequiredEnumapplication/json
- AuthorizationstringRequiredBearer authentication format, for example: Bearer
Request Body
- promptstringRequiredPositive prompt text, less than 1,500 characters long.
- stylestringRequiredEnumgeneralanime
Response
- codeinteger0 success, or error code.
- messagestring"success", or error msg.
- dataobjecttaskIdstringUse the taskId to request the Polling API to retrieve the generated outputs.
Example
Drive text to videos.
Request:
zsh
curl -X POST 'https://api.newportai.com/api/async/text2video' \
-H "Authorization: Bearer {{key}}" \
-H 'Content-Type: application/json' \
-d '{
"prompt": "A person laughing loudly in the grass",
"style": "general"
}'
Response:
json
{
"code": 0,
"message": "success",
"data": {
"taskId": "d1ff79a198d5426080d2b1e838eac8e5"
}
}
Next Step:
Use Polling API to get the result.