Skip to content

Live Photo

POST https://api.newportai.com/api/async/live_photo

Live Photo API could make the photo sing or talk. We offer variety of templates to choose from Live Photo Templates API.

  • Use Live Photo API to get taskId with POST method.
  • Use Polling API to get Live Photo result with POST method.

Request Header Parameters

  • Content-TypestringRequired
    Enum
    application/json
  • AuthorizationstringRequired
    Bearer authentication format, for example: Bearer

Request Body Parameters

  • templateIdstringRequired
    Live photo video template id.
  • photoUrlstringRequired
    original photo url.

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

First, get templates for live photo composition.

Request:

zsh
curl -X POST 'https://api.newportai.com/api/async/live_photo' \
-H "Authorization: Bearer {{key}}" \
-H 'Content-Type: application/json' \
-d '{
  "templateId": "64e80020698d660007f52891",
  "photoUrl": "https://newportai-api-market.s3.amazonaws.com/demo_image/demo_image.jpg"
}'

Response:

json
{
  "code": 0,
  "message": "success", 
  "data": {
    "taskId": "b08337dc08d7428daa64b3d5e61b8350"
  }
}

Next Step:

Use Polling API to get the result.

Demo
before