Account session

GET /core/v1/tasks/{id}

Account session · GET /core/v1/tasks/{id}

Authentication

Account session. Session/administrative writes are not executed in the public Playground.

Endpoint

curl --request GET 'https://api.oneaster.ai/core/v1/tasks/00000000-0000-4000-8000-000000000001' \
  --header 'Authorization: Bearer '"$ONEASTER_SESSION_TOKEN"

Parameters

- id (path, Required): {"type":"string","format":"uuid"}

Responses

200

个人图片/视频任务详情

{
  "application/json": {
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "success": {
          "const": true
        },
        "data": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": "string",
              "format": "uuid"
            },
            "user_id": {
              "type": "string",
              "pattern": "^[0-9]+$"
            },
            "key_id": {
              "type": "string",
              "pattern": "^[0-9]+$"
            },
            "model": {
              "type": "string"
            },
            "kind": {
              "enum": [
                "image",
                "video"
              ]
            },
            "state": {
              "enum": [
                "queued",
                "submitting",
                "submitted",
                "running",
                "success",
                "failed",
                "rejected",
                "unknown"
              ]
            },
            "billing_state": {
              "enum": [
                "reserved",
                "settled",
                "released"
              ]
            },
            "price_version": {
              "type": "integer",
              "minimum": 0
            },
            "unit_price_micro": {
              "type": "string",
              "pattern": "^[0-9]+$",
              "description": "整数账务单位;1 积分 = 10000 单位,1 USD = 100 积分。前端用 BigInt。"
            },
            "reservation_micro": {
              "type": "string",
              "pattern": "^[0-9]+$",
              "description": "整数账务单位;1 积分 = 10000 单位,1 USD = 100 积分。前端用 BigInt。"
            },
            "charge_micro": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^[0-9]+$",
                  "description": "整数账务单位;1 积分 = 10000 单位,1 USD = 100 积分。前端用 BigInt。"
                },
                {
                  "type": "null"
                }
              ]
            },
            "error_code": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "input": {
              "oneOf": [
                {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "kind": {
                      "const": "image"
                    },
                    "model": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    },
                    "input": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "prompt": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1000
                        },
                        "aspect_ratio": {
                          "enum": [
                            "1:1",
                            "4:3",
                            "3:4",
                            "16:9",
                            "9:16"
                          ]
                        }
                      },
                      "required": [
                        "prompt",
                        "aspect_ratio"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "model",
                    "input"
                  ]
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "kind": {
                      "const": "video"
                    },
                    "model": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    },
                    "input": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "prompt": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 20480
                        },
                        "aspect_ratio": {
                          "enum": [
                            "16:9",
                            "4:3",
                            "1:1",
                            "3:4",
                            "9:16",
                            "9:21",
                            "21:9"
                          ]
                        },
                        "resolution": {
                          "enum": [
                            "480p",
                            "720p",
                            "1080p"
                          ]
                        },
                        "duration": {
                          "type": "integer",
                          "enum": [
                            5,
                            10
                          ]
                        },
                        "camera_fixed": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "prompt",
                        "aspect_ratio",
                        "resolution",
                        "duration"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "model",
                    "input"
                  ],
                  "description": "Input is validated against the selected public model upstream. Seedance Lite: prompt<=10000, all listed resolutions at 5/10s, 9:21 supported, camera_fixed supported. Seedance 2.5: prompt<=20480, all listed resolutions at 5/10s, 21:9 supported instead of 9:21; camera_fixed must be omitted, audio/draft/search/last-frame disabled, MP4 output and safety checker enabled. Runway: prompt<=1800, 720p at 5/10s or 1080p at 5s, camera_fixed must be omitted. Read task-model capabilities for valid combinations; no arbitrary passthrough or reference inputs for Seedance 2.5."
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "kind": {
                      "const": "video"
                    },
                    "model": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    },
                    "input": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "prompt": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1800
                        },
                        "image_task_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "resolution": {
                          "enum": [
                            "720p",
                            "1080p"
                          ]
                        },
                        "duration": {
                          "type": "integer",
                          "enum": [
                            5,
                            10
                          ]
                        }
                      },
                      "required": [
                        "prompt",
                        "image_task_id",
                        "resolution",
                        "duration"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "model",
                    "input"
                  ],
                  "description": "Runway only: same-user, same-Key settled Core PNG, <=10 MiB. Omit aspect_ratio and camera_fixed; ratio follows source image. 1080p only supports 5 seconds. No arbitrary image_url or Node asset paths."
                },
                {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "kind": {
                      "const": "video"
                    },
                    "model": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    },
                    "input": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "prompt": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1800
                        },
                        "resolution": {
                          "enum": [
                            "720p",
                            "1080p"
                          ]
                        },
                        "duration": {
                          "type": "integer",
                          "enum": [
                            5,
                            10
                          ]
                        },
                        "image_asset_id": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "prompt",
                        "image_asset_id",
                        "resolution",
                        "duration"
                      ]
                    }
                  },
                  "required": [
                    "kind",
                    "model",
                    "input"
                  ],
                  "description": "Trusted Node media bridge only: PNG bytes must accompany the asset UUID in multipart. Not accepted on public JSON task submission."
                }
              ]
            },
            "created_at": {
              "type": "string",
              "format": "date-time"
            },
            "updated_at": {
              "type": "string",
              "format": "date-time"
            },
            "artifact_available": {
              "type": "boolean"
            },
            "artifact": {
              "anyOf": [
                {
                  "oneOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "media_type": {
                          "const": "image/png"
                        },
                        "sha256": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "size_bytes": {
                          "type": "string",
                          "pattern": "^[0-9]+$"
                        },
                        "width": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "height": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "media_type",
                        "sha256",
                        "size_bytes",
                        "width",
                        "height"
                      ]
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "media_type": {
                          "const": "video/mp4"
                        },
                        "url": {
                          "type": "string",
                          "format": "uri",
                          "description": "KIE temporary HTTPS CDN URL; direct browser video preview. Anyone holding this URL can access the provider CDN."
                        },
                        "temporary": {
                          "const": true
                        },
                        "archived": {
                          "const": false
                        },
                        "preview_supported": {
                          "const": true
                        },
                        "delivery": {
                          "const": "provider_url"
                        }
                      },
                      "required": [
                        "media_type",
                        "url",
                        "temporary",
                        "archived",
                        "preview_supported",
                        "delivery"
                      ]
                    }
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "upstream_model": {
              "enum": [
                "z-image",
                "image-01",
                "bytedance/v1-lite-text-to-video",
                "runway",
                "bytedance/seedance-2-5"
              ]
            },
            "quantity": {
              "type": "integer",
              "enum": [
                1,
                5,
                10
              ],
              "description": "Image count or video seconds, depending on unit."
            },
            "unit": {
              "enum": [
                "image",
                "second"
              ]
            },
            "estimated_supplier_credits": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Immutable expected KIE credits, or null for MiniMax with unreported supplier cost. Never gateway credits, CNY or USD."
            },
            "actual_supplier_credits": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "supplier_cost_unit": {
              "anyOf": [
                {
                  "const": "kie_credit"
                },
                {
                  "type": "null"
                }
              ]
            },
            "reference_image": {
              "anyOf": [
                {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "source_task_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source_asset_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source_kind": {
                      "enum": [
                        "core_task",
                        "node_media"
                      ]
                    },
                    "sha256": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "size_bytes": {
                      "type": "string",
                      "pattern": "^[0-9]+$"
                    },
                    "uploaded": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "source_task_id",
                    "source_asset_id",
                    "source_kind",
                    "sha256",
                    "size_bytes",
                    "uploaded"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "polling": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "status": {
                  "enum": [
                    "active",
                    "paused",
                    "finished"
                  ]
                },
                "next_poll_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "initial_deadline_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "deadline_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "attempts": {
                  "type": "integer",
                  "minimum": 0
                },
                "recovery_count": {
                  "type": "integer",
                  "minimum": 0
                },
                "admin_resume_available": {
                  "type": "boolean"
                }
              },
              "required": [
                "status",
                "next_poll_at",
                "initial_deadline_at",
                "deadline_at",
                "attempts",
                "recovery_count",
                "admin_resume_available"
              ]
            },
            "failure": {
              "anyOf": [
                {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "provider_code": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[0-9]{1,6}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "category": {
                      "enum": [
                        "provider_error",
                        "provider_rate_limited",
                        "provider_failure"
                      ]
                    }
                  },
                  "required": [
                    "provider_code",
                    "category"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "id",
            "user_id",
            "key_id",
            "model",
            "kind",
            "state",
            "billing_state",
            "price_version",
            "unit_price_micro",
            "reservation_micro",
            "charge_micro",
            "error_code",
            "input",
            "created_at",
            "updated_at",
            "artifact_available",
            "artifact",
            "upstream_model",
            "quantity",
            "unit",
            "estimated_supplier_credits",
            "actual_supplier_credits",
            "supplier_cost_unit",
            "reference_image",
            "polling",
            "failure"
          ]
        }
      },
      "required": [
        "success",
        "data"
      ]
    }
  }
}

default

错误代码见 core-api.md;供应商/数据库错误已隐藏。

{
  "application/json": {
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "success": {
          "const": false
        },
        "error": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "type": {
              "const": "oneaster_error"
            }
          },
          "required": [
            "code",
            "message",
            "type"
          ]
        },
        "data": {
          "type": "null"
        }
      },
      "required": [
        "success",
        "error",
        "data"
      ]
    }
  }
}