Query: Task Result
Short description: Query the execution status and result files for image processing tasks.
Overview
- Method:
GET - Path:
/task/{task_id} - Content-Type:
application/json
Authentication
- Header:
Authorization: Bearer <token>
Request Example
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| task_id | string | Yes | Task ID, for example 28e9810b-ca6a-4c0d-8af2-13aa1a48949c |
curl Example
bash
curl -X GET "https://api.gpt.ge/task/28e9810b-ca6a-4c0d-8af2-13aa1a48949c" \
-H "Authorization: Bearer sk-xxxx"JavaScript (fetch) Example
javascript
fetch('https://api.gpt.ge/task/28e9810b-ca6a-4c0d-8af2-13aa1a48949c', {
method: 'GET',
headers: {
'Authorization': 'Bearer sk-xxxx'
}
}).then(r => r.json()).then(console.log);Python (requests) Example
python
import requests
response = requests.get(
'https://api.gpt.ge/task/28e9810b-ca6a-4c0d-8af2-13aa1a48949c',
headers={'Authorization': 'Bearer sk-xxxx'}
)
print(response.json())Response Example (200)
json
{
"status": 200,
"data": {
"mask": "",
"image": "https://wxtechsz.oss-cn-shenzhen.aliyuncs.com/tasks/output/segmentation/28e9810b-ca6a-4c0d-8af2-13aa1a48949c-image.png",
"state": 1,
"task_id": "28e9810b-ca6a-4c0d-8af2-13aa1a48949c",
"progress": 100,
"created_at": 1742668552,
"completed_at": 1742668553,
"processed_at": 1742668552
}
}Note: Use this endpoint to query asynchronous tasks or tasks submitted with
sync=0. Whenstate=1, the task is complete and polling can stop.