List task artifacts
GET/v1/tasks/{task_id}/artifacts
List the images of an asynchronous image task. Returns an empty array until the task is SUCCESS.
Headers
AuthorizationstringRequiredBearer <API_KEY>of the user who owns the task.
Path parameters
task_idstringRequiredThe
task_idreturned byPOST /v1/images/tasks.
Returns
HTTP 200.
task_idstringOptionalTask ID.
artifactsobject[]OptionalImages in generation order.
Show child fields (6)
keystringOptionalArtifact key:
image-1,image-2, …typestringOptionalAlways
image.mime_typestringOptionalSuch as
image/png.content_urlstringOptionalView URL; do not send your API key.
download_urlstringOptionalDownload URL with a file name; do not send your API key.
expires_atintegerOptionalExpiry of the URLs above in Unix seconds, valid for 15 minutes. Call this endpoint again for fresh URLs.
Errors
| HTTP | code | Cause and action |
|---|---|---|
| 404 | artifact_not_found / invalid_request_error | The task does not exist or belongs to another user. |
| 401 | — | The API key is invalid, expired or disabled. |
| 503 | artifact_store_error | Image storage is temporarily unavailable; retry later. |
curl https://ling-light.com/v1/tasks/task_xxxxxxxxxxxxxxxx/artifacts \
-H "Authorization: Bearer $LINGLIGHT_API_KEY"const response = await fetch('https://ling-light.com/v1/tasks/task_xxxxxxxxxxxxxxxx/artifacts', {
headers: {
Authorization: `Bearer ${process.env.LINGLIGHT_API_KEY}`,
},
})
console.log(response.status, await response.json())import os
import requests
response = requests.get(
"https://ling-light.com/v1/tasks/task_xxxxxxxxxxxxxxxx/artifacts",
headers={
"Authorization": f"Bearer {os.environ['LINGLIGHT_API_KEY']}",
},
timeout=60,
)
print(response.status_code, response.json()){
"task_id": "task_xxxxxxxxxxxxxxxx",
"artifacts": [
{
"key": "image-1",
"type": "image",
"mime_type": "image/png",
"content_url": "https://media.example.com/signed/image-1.png",
"download_url": "https://media.example.com/signed/image-1.png?download=1",
"expires_at": 1795661760
}
]
}Related
API reference overview
Authentication, media URLs, idempotency and errors.
Integration guide
The full flow from API key to downloaded result.