Skip to main content
GET
/
r
/
tasks
/
{taskId}
/
result
Get task result
curl --request GET \
  --url https://core.cyberun.cloud/api/v1/r/tasks/{taskId}/result \
  --header 'Authorization: Bearer <token>'
{
  "id": "019abc12-9012-7890-abcd-ef1234567896",
  "task_output": {
    "storage_key": "tasks/019c65a0-1234-7000-8000-abcdef123456/output_00001_.png",
    "image_count": 1
  },
  "download_url": "https://s3.example.com/tasks/019c65a0-.../output.png?X-Amz-Expires=3600&...",
  "download_urls": {
    "9.images.0": "https://s3.example.com/outputs/.../image.png?X-Amz-Expires=3600&..."
  },
  "expires_at": "2025-02-10T15:01:30Z",
  "task_error": "",
  "completed_at": "2025-02-10T14:01:30Z"
}

Documentation Index

Fetch the complete documentation index at: https://docs.cyberun.cloud/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

User session JWT (Bearer ). Must be paired with the X-Team-ID request header on team-scoped endpoints so the server knows which team's resources to operate on.

Headers

X-Team-ID
string<uuid>

UUID of the team to scope the request to. Used by dual-auth endpoints (runtime + scoped management):

  • JWT callers MUST send it — a user may belong to multiple teams and the runtime cannot otherwise know which one to operate on. Missing header → 400.
  • Credential callers (sk-, dk-) can omit it because the team is derived from the credential row itself. Any value sent is ignored.
Example:

"019abc12-4567-7890-abcd-ef1234567891"

Path Parameters

taskId
string<uuid>
required

UUID of the task.

Example:

"019abc12-9012-7890-abcd-ef1234567896"

Response

Task result

Task execution result including output data and download URLs.

  • Completed tasks (local): task_output contains metadata with storage_key, download_url provides a presigned S3 URL.
  • Completed tasks (cloud): task_output contains per-output metadata with s3_key, download_urls provides presigned URLs keyed by output identifier.
  • Failed tasks: task_error contains the error message, task_output is null.
  • Cancelled/pending tasks: Both task_output and download_url are null.
id
string<uuid>
required

Unique task identifier.

Example:

"019abc12-9012-7890-abcd-ef1234567896"

task_status
enum<string>
required

Current state of the task:

  • pending: Task created, waiting to be picked up by the scheduler.
  • waiting: The scheduler received the task, waiting for an available agent with matching labels.
  • queued: Task assigned to an agent, waiting for ACK.
  • running: Agent is executing the ComfyUI workflow.
  • completed: Execution finished successfully, output is available.
  • failed: Execution failed, check the error field for details.
  • cancelled: Task was cancelled before completion.
Available options:
pending,
waiting,
queued,
running,
completed,
failed,
cancelled
task_output
object

Result metadata set by the agent upon completion. null if the task has not completed. Typical fields:

  • storage_key: S3 object path of the output file.
  • image_count: Number of images generated.
Example:
{
"storage_key": "tasks/019c65a0-1234-7000-8000-abcdef123456/output_00001_.png",
"image_count": 1
}
download_url
string<uri>

Presigned S3 download URL for the primary output file. Only present when task_output contains a storage_key. Expires after 1 hour — call this endpoint again to get a fresh URL.

Example:

"https://s3.example.com/tasks/019c65a0-.../output.png?X-Amz-Expires=3600&..."

download_urls
object

Presigned S3 download URLs for all output files. Present for cloud tasks that produce multiple outputs (keyed by output identifier, e.g. "9.images.0"). Each URL expires after 1 hour — call this endpoint again to get fresh URLs.

Example:
{
"9.images.0": "https://s3.example.com/outputs/.../image.png?X-Amz-Expires=3600&..."
}
expires_at
string<date-time>

Expiration time of the download_url (typically 1 hour from request). null if no download URL is available.

Example:

"2025-02-10T15:01:30Z"

task_error
string

Error message if the task failed. Empty string for non-failed tasks.

Example:

""

completed_at
string<date-time> | null

When the task reached a terminal state. null if still running.

Example:

"2025-02-10T14:01:30Z"