> ## 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.

# Gemini SDK — operations.get (video poll)



## OpenAPI

````yaml mountsea-api.mint.json GET /ms/v1beta/operations/{task_id}
openapi: 3.0.0
info:
  title: mountsea-api
  description: >-
    mountsea unified AI API — video, image, and audio generation.


    ### Async task flow

    1. `POST /ms/v1/run/{endpoint_slug}` — submit a job (returns Task with
    `status: queued`).

    2. `GET /ms/v1/tasks/{task_id}` — poll until `succeeded` (`output.images` /
    `output.videos` / `output.audio`) or `failed`/`timeout` (`error`).
       Or pass `webhook_url` in the submit body for a signed terminal callback (`x-ms-signature`).
    3. `GET /ms/v1/endpoints[/{slug}]` — marketplace listing with
    `input_schema`, `output_schema`, and `examples`.


    ### Request body

    - `{ "input": { ... } }` — all parameters and media URLs per endpoint
    `input_schema`.

    - Optional `webhook_url` for callbacks.


    ### SDK compatibility (optional)

    Prefer the native async API above? Skip this section.


    - **OpenAI SDK** — `baseURL = https://{gateway}/ms/v1`
      - Image (sync): `POST /ms/v1/images/generations|edits` — gpt-image-2 family
      - Video (async): `POST /ms/v1/videos` + `GET /ms/v1/videos/{id}` — sora-2 → Veo lite/pro slugs
    - **Gemini SDK** — `httpOptions.baseUrl = https://{gateway}/ms`
      - Image (sync): `POST /ms/v1beta/models/{model}:generateContent` — nano-banana family
      - Video (async): `POST /ms/v1beta/models/{model}:predictLongRunning` + poll `GET /ms/v1beta/operations/{task_id}`

    Unsupported `model` → **HTTP 400** before any task is created (no charge).

    Successful calls bill the **same endpoint slug** as the equivalent
    `/ms/v1/run/...` API.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.mountsea.ai
    description: API Gateway
security: []
tags:
  - name: Run
    description: Submit async tasks by endpoint slug
  - name: Tasks
    description: Poll or cancel tasks
  - name: Endpoints (marketplace)
    description: Endpoint catalog and schemas
  - name: SDK Compatibility
    description: >-
      OpenAI / Gemini official SDK — sync image APIs (same billing as native
      run)
  - name: Admin - Catalog (internal)
    description: Internal admin (swagger only, not public gateway)
paths:
  /ms/v1beta/operations/{task_id}:
    get:
      tags:
        - SDK Compatibility
      summary: Gemini SDK — operations.get (video poll)
      description: Poll long-running Veo jobs via `ai.operations.get({ operation })`.
      operationId: geminiOperationsGet
      parameters:
        - name: task_id
          required: true
          in: path
          schema:
            type: string
            example: ms-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
      responses:
        '200':
          $ref: '#/components/responses/GeminiOperationResponse'
        '404':
          $ref: '#/components/responses/NotFoundResponse'
      security:
        - bearerAuth: []
components:
  responses:
    GeminiOperationResponse:
      description: Gemini long-running Operation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GeminiOperation'
    NotFoundResponse:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
  schemas:
    GeminiOperation:
      type: object
      properties:
        name:
          type: string
        done:
          type: boolean
        response:
          type: object
          additionalProperties: true
        error:
          type: object
          additionalProperties: true
    ErrorBody:
      type: object
      properties:
        statusCode:
          type: integer
          example: 400
        message:
          type: string
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````