Skip to main content
GET
/
api
/
v1
/
client
/
job
/
TaskInfo
Query the status and results of all model generation tasks.
curl --request GET \
  --url https://api.crun.ai/api/v1/client/job/TaskInfo \
  --header 'x-api-key: <api-key>'
{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "d6956973-2f17-43d4-8514-af6cc3a2f55d",
    "provider": "Google",
    "model_version": "nano-banana",
    "status": "running",
    "param": {
      "model": "google/nano-banana",
      "callback_url": null,
      "input": {
        "prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A teenager, painted with ...",
        "output_format": "png",
        "aspect_ratio": "16:9"
      }
    },
    "create_at": 1768900378,
    "result": null,
    "duration_s": null,
    "complete_at": null,
    "source": "api"
  }
}

API Endpoint

GET https://api.crun.ai/api/v1/client/job/TaskInfo
This endpoint is used to query the execution status and retrieve the results of tasks created via the /api/v1/client/job/CreateTask API. It provides a unified query interface that is compatible with all models under the Models category, enabling consistent task tracking and result retrieval regardless of the underlying model.

Query Parameters

task_id
string
required
The unique task identifier returned when you created the task.Example: task_12345678

Request Example

curl -X GET "https://api.crun.ai/api/v1/client/job/TaskInfo?task_id=task_12345678" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json"

{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "d6956973-2f17-43d4-8514-af6cc3a2f55d",
    "provider": "Google",
    "model_version": "nano-banana",
    "status": "running",
    "param": {
      "model": "google/nano-banana",
      "callback_url": null,
      "input": {
        "prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A teenager, painted with ...",
        "output_format": "png",
        "aspect_ratio": "16:9"
      }
    },
    "create_at": 1768900378,
    "result": null,
    "duration_s": null,
    "complete_at": null,
    "source": "api"
  }
}

Response Format

code
integer
Response status code. 200 indicates the request was successfully processed (the task was found and returned, regardless of execution result).
message
string
Response message. Typically "success".
data
object
The task data object containing all task information.

Task Status Enum

StatusDescriptionAction
pendingTask is queued and waiting to be processedContinue polling
runningTask is currently being processedContinue polling
successTask successfully completedAccess result.media_url to get the result
failedTask failedAccess result object to view error code and message.

Get Task Result Best Practices

For production applications, we strongly recommend using the callback_url 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
Recommended method
When status is success:
  1. Retrieve the task result from the result field in the response
  2. Extract generated media URLs from result.media_urls
  3. Download media files to your own storage
  4. Persist result metadata to your storage or database
Important: Generated media URLs are typically permanently deleted after 14 days

Common Error Codes

CodeDescriptionSolution
401Unauthorized - Invalid or missing API keyCheck your API key
404Task not foundVerify the task_id is correct
429Exceeding the request rate limitReduce request frequency
500Internal server errorRetry after a few minutes
501Generation failedView the result object to get the error code and message.

Rate Limits

  • Maximum query rate: 15 requests per second, per account limit
  • Recommended interval: 15-30 seconds between polls

Models Overview

Explore all available models

Get Account Credits

Check your remaining credits

Authorizations

x-api-key
string
header
required

All APIs require authentication via API Key.

Get API Key:

  1. Visit API Key Management Page to get your API Key

Usage: Add to request header:

x-api-key: YOUR_API_KEY

Note:

  • Keep your API Key secure and do not share it with others
  • If you suspect your API Key has been compromised, reset it immediately in the management page

Query Parameters

task_id
string
required

Task ID used to retrieve task result.

Required string length: 36
Example:

"task_1234567"

Response

Task information retrieved successfully or task not found.

code
integer
required

Response status code

  • 200: Success - Request has been processed successfully
  • 401: Unauthorized - Authentication credentials are missing or invalid
  • 402: Insufficient Credits - Account does not have enough credits to perform the operation
  • 404: Not Found - The requested resource or endpoint does not exist
  • 422: Validation Error - The request parameters failed validation checks
  • 429: Rate Limited - Request limit has been exceeded for this resource
  • 455: Service Unavailable - System is currently undergoing maintenance
  • 500: Server Error - An unexpected error occurred while processing the request
  • 501: Generation Failed - Content generation task failed
  • 505: Feature Disabled - The requested feature is currently disabled
message
string
required

Response message

data
object

Task record and result information.