Get Task Detail
Query the status and results of any task created in the Market models
Overview
Use this endpoint to query the status and results of any task created through Market model APIs. This is a unified query interface that works with all models under the Market category.This endpoint works with all Market models including Seedream, Grok Imagine, Kling, Claude, and any future models added to the Market.
API Endpoint
Query Parameters
The unique task identifier returned when you created the task.Example:
task_12345678Request Example
Response Format
Response Fields
Response status code.
200 indicates success.Response message. Typically
"success" for successful queries.The task data object containing all task information.
Task States
| State | Description | Action |
|---|---|---|
waiting | Task is queued and waiting to be processed | Continue polling |
queuing | Task is in the processing queue | Continue polling |
generating | Task is currently being processed | Continue polling |
success | Task completed successfully | Parse resultJson to get results |
fail | Task failed | Check failCode and failMsg for details |
Polling Best Practices
Recommended Polling Intervals
Recommended Polling Intervals
- Initial polls (first 30 seconds): Every 2-3 seconds
- After 30 seconds: Every 5-10 seconds
- After 2 minutes: Every 15-30 seconds
- Maximum polling duration: Stop after 10-15 minutes and investigate
Using Callbacks Instead of Polling
Using Callbacks Instead of Polling
For production applications, we strongly recommend using the
callBackUrl parameter when creating tasks:- No polling needed: Your server receives notifications automatically
- Lower API costs: Eliminates continuous polling requests
- Better performance: Immediate notifications when tasks complete
- Reduced latency: No delay between completion and notification
Handling Completed Tasks
Handling Completed Tasks
When
state is success:- Parse the
resultJsonstring to JSON - Extract the
resultUrlsarray - Download generated content immediately
- Store content in your own storage
Error Handling
Common Error Codes
| Code | Description | Solution |
|---|---|---|
401 | Unauthorized - Invalid or missing API key | Check your API key |
404 | Task not found | Verify the taskId is correct |
422 | Validation error in original request | Check the failMsg for details |
500 | Internal server error | Retry after a few minutes |
501 | Generation failed | Check failMsg for specific error details |
Example: Complete Polling Flow
Node.js
Rate limits and quotas are enforced by Apikley and may differ from upstream providers.

