> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gengen.farm/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve a Genjutsu task

Use the complete `higgsfieldgenjutsu:` ID returned by creation and the API key that owns the task. Poll while `queued` or `running`. On `succeeded`, read `outputs.videos`; on `failed` or `cancelled`, stop polling. Results are stored by GENGEN and returned as signed HTTPS URLs. Retrieve again to renew a URL. Repeated retrieval does not create work or charge again.

## Usage

On success, `usage.inputVideoDurationSeconds` gives the full source length. `processedDurationSeconds` is the portion processed, up to 30 seconds. `billableSeconds` rounds that portion up to a whole second. `mode` and the `resolution` tier string select the price row. Multiply `billableSeconds` by the per-second rate for `priceRowId` in the [price catalog](https://docs.gengen.farm/api-reference/model-prices).


## OpenAPI

````yaml openapi/genjutsu-video.yaml GET /contents/generations/tasks/{id}
openapi: 3.1.0
info:
  title: Genjutsu video API
  version: 1.0.0
servers:
  - url: https://gengen.farm/v1
security:
  - bearerAuth: []
paths:
  /contents/generations/tasks/{id}:
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    get:
      summary: Retrieve a Genjutsu task
      operationId: retrieveGenjutsuTask
      responses:
        '200':
          description: Current task state, including outputs and usage on success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTask'
              example:
                id: higgsfieldgenjutsu:12345678-1234-4234-8234-123456789abc
                model: higgsfield-genjutsu
                status: succeeded
                outputs:
                  videos:
                    - https://example.com/restyled.mp4
                  images: []
                usage:
                  priceRowId: genjutsu-restyle-720p
                  resolution: 720p
                  mode: restyle
                  inputVideoDurationSeconds: 4.2
                  processedDurationSeconds: 4.2
                  billableSeconds: 5
        '404':
          description: Task not found or not owned by this key.
components:
  schemas:
    VideoTask:
      type: object
      required:
        - id
        - model
        - status
        - outputs
      properties:
        id:
          type: string
          example: higgsfieldgenjutsu:12345678-1234-4234-8234-123456789abc
        model:
          type: string
          const: higgsfield-genjutsu
        status:
          type: string
          enum:
            - queued
            - running
            - succeeded
            - failed
            - cancelled
        outputs:
          type: object
          required:
            - videos
            - images
          properties:
            videos:
              type: array
              items:
                type: string
                format: uri
            images:
              type: array
              maxItems: 0
              items:
                type: string
        usage:
          type: object
          description: >-
            Successful task detail. Billable seconds are the source video
            duration clipped to 30 seconds and rounded up. Mode and resolution
            select the price row.
          required:
            - priceRowId
            - resolution
            - billableSeconds
            - inputVideoDurationSeconds
            - processedDurationSeconds
            - mode
          properties:
            priceRowId:
              type: string
              description: Stable customer price row in GET /api/public/pricing.
            resolution:
              type: string
              description: Resolution tier used for pricing, such as 720p.
            billableSeconds:
              type: number
              description: Seconds to multiply by the selected per-second rate.
            inputVideoDurationSeconds:
              type: number
              description: Input video seconds used for billing.
            processedDurationSeconds:
              type: number
              description: Source video seconds processed before whole-second rounding.
            mode:
              type: string
              description: Source processing mode used to select the rate.
        failureReason:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.