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

# Get a generation

> Poll a generation's status and read its outputs.

Returns `status` (`processing` | `completed` | `failed`), best-effort progress while processing, and `outputs[]` with freshly signed URLs once completed. If the generation was started in another workspace, pass the same `workspace_id`.


## OpenAPI

````yaml api-reference/openapi.json GET /v1/generations/{generationId}
openapi: 3.0.3
info:
  title: Flowy App API
  version: 1.3.1
  description: >-
    Run Flowy apps and direct generations programmatically.


    Authenticate with a workspace API key in the `Authorization: Bearer` header.
    A **secret** key (`flowy_…`) is for servers; a **publishable** key
    (`flowy_pk_…`) is browser-safe and only works from its allowlisted domains.
    Every run or generation bills the API key's own workspace credits
    (caller-pays), so a leaked key can never spend another workspace's balance.


    Keys carry **scopes**: `apps:read` (list/inspect apps), `runs:read` (poll
    runs), `runs:write` (start runs), `generations:read` (poll direct
    generations), `generations:write` (start direct generations), `assets:read`
    (list/read workspace assets), and `credits:read` (read the credit balance).
    A request that needs a scope the key doesn't hold returns `403`.


    A published (public) app is runnable by any key; a private app is runnable
    only by a key of its own workspace.
servers:
  - url: https://apis.tryflowy.ai/genstudio-svc-v2/api
    description: Flowy production API
security:
  - ApiKeyAuth: []
tags:
  - name: Apps
    description: Discover apps and inspect their input/output schema.
  - name: Runs
    description: Start runs and poll for their results.
  - name: Generations
    description: Start direct image/video generations and poll for their results.
  - name: Assets
    description: Browse the workspace's asset library (uploads + generated media).
  - name: Credits
    description: Read the workspace's credit balance.
  - name: Spec
    description: The machine-readable OpenAPI document.
paths:
  /v1/generations/{generationId}:
    get:
      tags:
        - Generations
      summary: Get a generation
      description: >-
        Returns a generation's status and, once complete, its outputs (signed,
        downloadable media URLs). Only generations started by your own workspace
        are visible. **Requires the `generations:read` scope.**
      operationId: getGeneration
      parameters:
        - name: generationId
          in: path
          required: true
          schema:
            type: string
          example: 64c3f2a1e8b9c0d1f2e3a4b5
        - name: workspace_id
          in: query
          required: false
          schema:
            type: string
          description: >-
            Optional workspace context (from GET /v1/workspaces); default is the
            key's own wallet.
      responses:
        '200':
          description: Generation status and outputs.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerationView'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The key lacks the generations:read scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Generation not found (or belongs to another workspace)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  headers:
    X-RateLimit-Limit:
      description: Maximum requests allowed in the current window (per minute).
      schema:
        type: integer
        example: 60
    X-RateLimit-Remaining:
      description: Requests remaining in the current window.
      schema:
        type: integer
        example: 59
    X-RateLimit-Reset:
      description: Unix epoch second at which the current window resets.
      schema:
        type: integer
        example: 1893456000
  schemas:
    GenerationView:
      type: object
      properties:
        data:
          type: object
          properties:
            generationId:
              type: string
              example: 64c3f2a1e8b9c0d1f2e3a4b5
            type:
              type: string
              enum:
                - image
                - video
              example: image
            model:
              type: string
              example: gemini-3-flash
            status:
              type: string
              enum:
                - processing
                - completed
                - failed
              example: completed
            progress:
              description: >-
                Best-effort live progress snapshot; present only while
                processing.
              nullable: true
            prompt:
              type: string
              example: a studio photo of a ceramic mug on a marble counter
            outputs:
              type: array
              items:
                type: object
                properties:
                  kind:
                    type: string
                    enum:
                      - image
                      - video
                    example: image
                  assetId:
                    type: string
                    description: >-
                      Library asset id, when the output was recorded as an
                      asset.
                  url:
                    type: string
                    description: Signed, downloadable media URL — expires.
                    example: https://cdn.tryflowy.ai/generations/mug.png
                  width:
                    type: integer
                    example: 1024
                  height:
                    type: integer
                    example: 1024
                  durationSeconds:
                    type: number
                    example: 5
            creditsCharged:
              type: number
              description: Credits actually deducted; 0 until the generation completes.
              example: 12
            error:
              type: string
              description: >-
                Human-readable failure reason. Present only when status is
                failed.
            createdAt:
              type: string
              format: date-time
              example: '2026-01-01T00:00:00Z'
            completedAt:
              type: string
              format: date-time
              example: '2026-01-01T00:01:15Z'
    Error:
      type: object
      properties:
        error:
          type: string
          example: this API key lacks the runs:write scope
      required:
        - error
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: flowy_*
      description: >-
        A workspace API key. Secret keys (`flowy_…`) are server-side — keep them
        private. Publishable keys (`flowy_pk_…`) are browser-safe but only work
        from their allowlisted domains.

````