Task Status API
The Task Status API allows you to check the status of your processing tasks and retrieve the results.
Get Task Status
Endpoint
GET https://api.a1d.ai/api/task/{taskId}
Example Request
curl --location --request GET 'https://api.a1d.ai/api/task/task_abc123' \
--header 'Authorization: KEY your_api_key_here'
Response Example
{
"taskId": "task_abc123",
"status": "FINISHED",
"imageUrl": "https://storage.a1d.ai/processed/image.jpg",
"thumbUrl": "https://storage.a1d.ai/processed/thumb.jpg"
}
Real-time Status Updates (SSE)
Endpoint
GET https://api.a1d.ai/api/task/{taskId}/sse
Example Request
curl --location --request GET 'https://api.a1d.ai/api/task/task_abc123/sse' \
--header 'Authorization: KEY your_api_key_here'
Response Example
event: message
data: {
"taskId": "task_abc123",
"status": "PROCESSING",
"progress": 50
}
event: message
data: {
"taskId": "task_abc123",
"status": "FINISHED",
"imageUrl": "https://storage.a1d.ai/processed/image.jpg",
"thumbUrl": "https://storage.a1d.ai/processed/thumb.jpg"
}
Task Status Values
- PENDING - Task is queued
- PROCESSING - Task is being processed
- FINISHED - Task completed successfully
- FAILED - Task failed to process
Notes
- Task results are available for 24 hours after completion
- SSE connection will automatically close when task is completed or failed
- For long-running tasks, SSE is recommended over polling