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

# Get Task Result

> Poll Gemini video and image async task status

Shared polling endpoint for **both** Gemini Video (Veo) and Gemini Image (Nano Banana) async tasks.

<Info>
  Create a task with [Generate Video](/api-reference/gemini/video) or [Generate Image](/api-reference/gemini/image), then poll this endpoint with the returned `taskId` until status is `completed`, `failed`, or `timeout`.
</Info>

## Used By

| Capability          | Create endpoint                                                                   |
| ------------------- | --------------------------------------------------------------------------------- |
| Video (Veo)         | `POST /gemini/video/generate`, upsample, extend, reshoot, object insert/remove, … |
| Image (Nano Banana) | `POST /gemini/image/generate`                                                     |

## Task Status Values

| Status       | Description                              |
| ------------ | ---------------------------------------- |
| `pending`    | Task is queued                           |
| `ready`      | Task is ready to be processed            |
| `assigned`   | Task has been assigned to a worker       |
| `processing` | Task is being processed                  |
| `completed`  | Task completed — check `result` for data |
| `failed`     | Task failed — check error fields         |
| `cancelled`  | Task was cancelled                       |
| `timeout`    | Task timed out                           |

<Tip>
  Poll every 3–5 seconds. Image tasks are usually faster than video; video generation may take longer depending on model and length.
</Tip>


## OpenAPI

````yaml GET /gemini/task/result
openapi: 3.0.0
info:
  title: Gemini AI
  description: API documentation for Gemini AI
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.mountsea.ai
    description: API Gateway
security: []
tags:
  - name: gemini
    description: ''
paths:
  /gemini/task/result:
    get:
      tags:
        - gemini
      summary: Get task result by taskId
      description: Get task result by taskId
      operationId: ApiPublicController_taskResult
      parameters:
        - name: taskId
          required: true
          in: query
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResultDto'
      security:
        - bearerAuth: []
components:
  schemas:
    TaskResultDto:
      type: object
      properties:
        taskId:
          type: string
          description: task id
        status:
          enum:
            - pending
            - ready
            - assigned
            - processing
            - completed
            - failed
            - cancelled
            - timeout
          type: string
          description: task status
        result:
          description: task result
          oneOf:
            - $ref: c6e5f59b-88f6-47cc-8f8c-678d60aea225
              description: video result
            - $ref: '#/components/schemas/NanoImageDto'
              description: image result
          nullable: true
        errorMessage:
          type: string
          description: error message
        errorCode:
          type: number
          description: error code
        finishedAt:
          format: date-time
          type: string
          description: task finished time
        createdAt:
          format: date-time
          type: string
          description: task created time
        traceId:
          type: string
          description: traceId
      required:
        - taskId
        - status
    NanoImageDto:
      type: object
      properties:
        prompt:
          type: string
          description: The prompt which used to generate the images
          example: A fluffy orange cat running through a sunny meadow
        action:
          enum:
            - edit
            - generate
          type: string
          description: >-
            Action type: edit (modify existing images) or generate (create new
            images)
          example: generate
        num_images:
          type: number
          default: 1
          description: only support generate 1 image, default is 1
        image_urls:
          description: >-
            Link to the picture that needs to be edited. It can be a accessible
            http or https url, The image size should not exceed 10MB for each.
            If the `action` is `edit`, this parameter is required.
          example:
            - https://example.com/image1.jpg
            - https://example.com/image2.jpg
          type: array
          items:
            type: string
            format: uri
        aspect_ratio:
          enum:
            - '21:9'
            - '1:1'
            - '4:3'
            - '3:2'
            - '2:3'
            - '5:4'
            - '4:5'
            - '3:4'
            - '16:9'
            - '9:16'
            - '1:4'
            - '4:1'
            - '1:8'
            - '8:1'
          type: string
          description: >-
            The aspect ratio of the image, nano-banana-2 supports all aspect
            ratios, other models only support 21:9, 1:1, 4:3, 3:2, 2:3, 5:4,
            4:5, 3:4, 16:9, 9:16
          example: '1:1'
        model:
          default: nano-banana-fast
          enum:
            - nano-banana-fast
            - nano-banana-pro
            - nano-banana-2
            - nano-banana-2-lite
          type: string
          description: The model of the image, default is NanoBananaFast
          example: nano-banana-fast
        resolution:
          enum:
            - 1K
            - 2K
            - 4K
          type: string
          description: >-
            The resolution of the image, only valid when model is
            nano-banana-pro or nano-banana-2
          example: 1K
      required:
        - prompt
        - action
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````