API v2 DocumentationTask
Get a task
Reads a task created by any v2 endpoint. Poll it every few seconds until status is completed, failed or cancelled.
Where the result is:
- Images (
taskKindt2i,i2i,inpaint):outputs.mediaIdsandoutputs.mediaUrls. - Videos (
taskKindi2v-inhouse,reference-video):outputs.videoMediaId. Resolve it withGET /v2/media/batch?ids=<videoMediaId>and downloadfileUrl.outputs.mediaIdsthen holds only the poster image.
Generated media is not kept forever. Download results soon after they finish.
Authorization
bearerAuth AuthorizationBearer <token>
In all requests that require authentication
In: header
Path Parameters
id*string
The task ID.
Query Parameters
with_parameters?string
Send true to include the stored task parameters in parameters.
Value in
"true"Response Body
application/json
application/json
application/json
curl https://api.pixai.art/v2/task/1943547603237249965 \ -H "Authorization: Bearer $PIXAI_API_KEY"{
"id": "string",
"status": "waiting",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"startedAt": "2019-08-24T14:15:22Z",
"endAt": "2019-08-24T14:15:22Z",
"taskKind": "string",
"paidQuota": 0,
"taskStatusMsgI18n": {
"key": "string",
"defaultMessage": "string"
},
"outputs": {
"videoMediaId": "string",
"seed": "string",
"mediaIds": [
"string"
],
"mediaUrls": [
"string"
]
}
}{
"code": "string",
"status": 0,
"message": "string",
"data": {},
"defined": true
}{
"code": "string",
"status": 0,
"message": "string",
"data": {},
"defined": true
}Create a reference video task POST
Generates a video guided by reference images, and depending on the model, reference videos and audio.
Get media URLs by ID GET
Resolves up to 100 media IDs to their URLs, for example the `outputs.mediaIds` or `outputs.videoMediaId` of a finished task. No authentication is needed for public media.