# Novita AI Task Result API | Retrieve Asynchronous Task Results

> Access the Novita AI Task Result API to retrieve images, audio, or video results from v3 asynchronous tasks using the task_id. This API supports detailed tracking and management of multimedia data generated or processed during your AI tasks. Explore comprehensive API documentation and examples.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown is available with `Accept: text/markdown` and `.md` URL variants.

Source: /docs/api-reference/model-apis-task-result

# Task Result

GET

/

v3

/

async

/

task-result

Try it

Task Result

cURL

```
curl --request GET \
--url https://api.novita.ai/v3/async/task-result \
--header 'Authorization: &#x3C;authorization>' \
--header 'Content-Type: &#x3C;content-type>'
```

```
import requestsurl = "https://api.novita.ai/v3/async/task-result"headers = { "Content-Type": "&#x3C;content-type>", "Authorization": "&#x3C;authorization>"}response = requests.get(url, headers=headers)print(response.text)
```

```
const options = { method: 'GET', headers: {'Content-Type': '&#x3C;content-type>', Authorization: '&#x3C;authorization>'}};fetch('https://api.novita.ai/v3/async/task-result', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
```

```
&#x3C;?php$curl = curl_init();curl_setopt_array($curl, [ CURLOPT_URL => "https://api.novita.ai/v3/async/task-result", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: &#x3C;authorization>", "Content-Type: &#x3C;content-type>" ],]);$response = curl_exec($curl);$err = curl_error($curl);curl_close($curl);if ($err) { echo "cURL Error #:" . $err;} else { echo $response;}
```

```
package mainimport (	"fmt"	"net/http"	"io")func main() {	url := "https://api.novita.ai/v3/async/task-result"	req, _ := http.NewRequest("GET", url, nil)	req.Header.Add("Content-Type", "&#x3C;content-type>")	req.Header.Add("Authorization", "&#x3C;authorization>")	res, _ := http.DefaultClient.Do(req)	defer res.Body.Close()	body, _ := io.ReadAll(res.Body)	fmt.Println(string(body))}
```

```
HttpResponse&#x3C;String> response = Unirest.get("https://api.novita.ai/v3/async/task-result") .header("Content-Type", "&#x3C;content-type>") .header("Authorization", "&#x3C;authorization>") .asString();
```

```
require 'uri'require 'net/http'url = URI("https://api.novita.ai/v3/async/task-result")http = Net::HTTP.new(url.host, url.port)http.use_ssl = truerequest = Net::HTTP::Get.new(url)request["Content-Type"] = '&#x3C;content-type>'request["Authorization"] = '&#x3C;authorization>'response = http.request(request)puts response.read_body
```

200

```
{
"extra": {
"seed": "&#x3C;string>",
"enable_nsfw_detection": true,
"debug_info": {
"request_info": "&#x3C;string>",
"submit_time_ms": "&#x3C;string>",
"execute_time_ms": "&#x3C;string>",
"complete_time_ms": "&#x3C;string>"
}
},
"task": {
"task_id": "&#x3C;string>",
"status": "&#x3C;string>",
"reason": "&#x3C;string>",
"task_type": "&#x3C;string>",
"eta": 123,
"progress_percent": 123
},
"images": [
{
"image_url": "&#x3C;string>",
"image_url_ttl": 123,
"image_type": "&#x3C;string>"
}
],
"videos": [
{
"video_url": "&#x3C;string>",
"video_url_ttl": "&#x3C;string>",
"video_type": "&#x3C;string>"
}
],
"audios": [
{
"audio_url": "&#x3C;string>",
"audio_url_ttl": "&#x3C;string>",
"audio_type": "&#x3C;string>",
"audio_metadata": {
"text": "&#x3C;string>",
"start_time": {},
"end_time": {}
}
}
]
}
```

This API is used to retrieve images, audio, or video results from v3 asynchronous tasks using the `task_id`.

##

[​](#request-headers)

Request Headers

[​](#param-content-type)

Content-Type

string

required

Enum: `application/json`

[​](#param-authorization)

Authorization

string

required

Bearer authentication format, for example: Bearer {{API Key}}.

##

[​](#query-parameters)

Query Parameters

[​](#param-task-id)

task_id

string

required

Returned in the 200 response of v3 asynchronous APIs.

##

[​](#response)

Response

[​](#param-extra)

extra

object

Show properties

[​](#param-seed)

seed

string

A seed is a number from which Stable Diffusion generates noise, making generation deterministic. Using the same seed and set of parameters will produce identical images each time, minimum -1.

[​](#param-enable-nsfw-detection)

enable_nsfw_detection

boolean

When set to true, NSFW detection will be enabled, incurring an additional cost of $0.0015 for each generated image.

[​](#param-debug-info)

debug_info

object

Show properties

[​](#param-request-info)

request_info

string

Records request parameters for debugging purposes.

[​](#param-submit-time-ms)

submit_time_ms

string

The timestamp (in milliseconds) of when the task was submitted.

[​](#param-execute-time-ms)

execute_time_ms

string

The timestamp (in milliseconds) of when the task started execution.

[​](#param-complete-time-ms)

complete_time_ms

string

The timestamp (in milliseconds) of when the task was completed.

[​](#param-task)

task

object

Task information.

Show properties

[​](#param-task-id-1)

task_id

string

Task ID.

[​](#param-status)

status

string

Indicates the current status of a task. This parameter allows you to filter results based on the following status categories: `TASK_STATUS_QUEUED`: The task is queued and awaiting processing. `TASK_STATUS_SUCCEED`: The task has been processed successfully. `TASK_STATUS_FAILED`: The task failed during processing. `TASK_STATUS_PROCESSING`: The task is currently being processed.

Enum: `TASK_STATUS_QUEUED`, `TASK_STATUS_SUCCEED`, `TASK_STATUS_FAILED`, `TASK_STATUS_PROCESSING`

[​](#param-reason)

reason

string

Provides the reason for a task’s failure. This parameter specifies the explanation or error message associated with tasks that did not succeed. Utilizing this filter can aid in diagnosing issues and implementing corrective actions for failed processes.

[​](#param-task-type)

task_type

string

Specifies the type of task.

[​](#param-eta)

eta

number

Specifies the estimated time of completion for tasks, measured in seconds. This parameter is particularly relevant for video-type tasks, providing a forecast of how long it will take to complete the task based on current processing parameters and system load. This information can be vital for planning and resource management in environments with time-sensitive video processing requirements.

[​](#param-progress-percent)

progress_percent

number

Progress of task completion in percentage. This feature is currently available only for:
1. Video Generator APIs;
2. Text-to-Image API and Image-to-Image API.

[​](#param-images)

images

object[]

Contains information about images associated with image-type tasks. This parameter provides detailed data on each image processed or generated during the task, such as file paths, metadata, or any image-specific attributes. It is returned only for tasks that involve image operations, facilitating enhanced tracking and management of image data.

Show properties

[​](#param-image-url)

image_url

string

Image URL.

[​](#param-image-url-ttl)

image_url_ttl

integer

Image expiration time in seconds.

[​](#param-image-type)

image_type

string

Image type.

Enum: `jpeg`, `png`, `webp`

[​](#param-videos)

videos

object[]

Contains information about videos associated with video-type tasks. This parameter provides detailed data on each video processed or generated during the task, such as file paths, metadata, or any video-specific attributes. It is returned only for tasks that involve video operations, facilitating enhanced tracking and management of video data.

Show properties

[​](#param-video-url)

video_url

string

Video URL.

[​](#param-video-url-ttl)

video_url_ttl

string

Video expiration time in seconds.

[​](#param-video-type)

video_type

string

Video type.

Enum: `mp4`, `gif`

[​](#param-audios)

audios

object[]

Contains information about audios associated with audio type tasks. This parameter provides detailed data on each audio processed or generated during the task, such as file paths, metadata, or any image-specific attributes. It is returned only for tasks that involve audio operations, facilitating enhanced tracking and management of audio data.

Show properties

[​](#param-audio-url)

audio_url

string

Audio url.

[​](#param-audio-url-ttl)

audio_url_ttl

string

Audio url expire time in seconds.

[​](#param-audio-type)

audio_type

string

Audio type.

Enum: `wav`

[​](#param-audio-metadata)

audio_metadata

object

Contains detailed metadata about audio files processed or generated during audio-related tasks.

Show properties

[​](#param-text)

text

string

[​](#param-start-time)

start_time

float32

the start_time of the text in seconds.

[​](#param-end-time)

end_time

float32

the end_time of the text in seconds.

##

[​](#example)

Example

request

```
curl --location --globoff 'https://api.novita.ai/v3/async/task-result?task_id={{Novita-TaskID}}' \
--header 'Authorization: Bearer {{API Key}}'
```

response

```
{
"extra": {
"seed": "158881667",
"enable_nsfw_detection": false,
"debug_info": {
"request_info": "",
"submit_time_ms": "",
"execute_time_ms": "",
"complete_time_ms": ""
}
},
"task": {
"task_id": "830d9c90-d53f-4c5a-8009-xxx",
"status": "TASK_STATUS_SUCCEED",
"reason": "",
"task_type": "TXT_TO_IMG",
"eta": 0,
"progress_percent": 0
},
"images": [
{
"image_url": "https://faas-output-image.s3.ap-southeast-1.amazonaws.com/prod/xxx",
"image_url_ttl": 3600,
"image_type": "jpeg",
"nsfw_detection_result": {}
}
],
"videos": [],
"audios": []
}
```

Last modified on December 24, 2024
