Skip to content

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-TypestringRequired
    Enum
    application/json
  • AuthorizationstringRequired
    Bearer authentication format, for example: Bearer

Request Body

  • promptstringRequired
    Positive prompt text, less than 1,500 characters long.
  • stylestringRequired
    Enum
    generalanime

Response

  • codeinteger
    0 success, or error code.
  • messagestring
    "success", or error msg.
  • dataobject
    taskIdstring
    Use 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.