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

# Get a generation

> Reads one generation of the workspace, free: prompt, status, model, cost and, when completed, each file's URL, thumbnail, size and duration. With waitSeconds (up to 40) it waits while it runs; pollAfterSeconds comes while it still does. A failure has an error code; a refund shows refunded true. A generation of another workspace is 404 not_found. The workspace must have generation enabled (public_create): otherwise 403 feature_not_enabled.

Requires the `create:read` scope.



## OpenAPI

````yaml /api-reference/openapi.json get /create/generations/{id}
openapi: 3.1.0
info:
  title: Unite API
  version: 1.0.0
  description: >-
    Run Ad Score pre-tests from your own systems: upload a creative, create a
    pre-test, and read its result and PDF report. The Ad Score routes are under
    /adscore and need the adscore:read or adscore:write scope; uploads and
    webhook endpoints are shared by every product and stay at the root. Every
    request needs an API key sent as a Bearer token. Every response carries an
    X-Request-Id header.
servers:
  - url: https://myunite.ai/api/v1
security:
  - bearerAuth: []
tags:
  - name: Catalog
    description: What you can send when you create a pre-test.
  - name: Uploads
    description: Send creative files and brand assets.
  - name: Brands
    description: Create and complete brands for your workspace.
  - name: Pretests
    description: Create pre-tests and read their results.
  - name: Quota
    description: How many pre-tests you can still run.
  - name: Create
    description: Generate and edit images, videos and music, and read what was generated.
  - name: Webhooks
    description: Manage the endpoints that are notified when a pre-test changes.
paths:
  /create/generations/{id}:
    get:
      tags:
        - Create
      summary: Get a generation
      description: >-
        Reads one generation of the workspace, free: prompt, status, model, cost
        and, when completed, each file's URL, thumbnail, size and duration. With
        waitSeconds (up to 40) it waits while it runs; pollAfterSeconds comes
        while it still does. A failure has an error code; a refund shows
        refunded true. A generation of another workspace is 404 not_found. The
        workspace must have generation enabled (public_create): otherwise 403
        feature_not_enabled.


        Requires the `create:read` scope.
      operationId: getCreateGeneration
      parameters:
        - name: id
          in: path
          required: true
          description: The generation id (gen_...).
          schema:
            type: string
        - name: waitSeconds
          in: query
          required: false
          description: Wait up to this long while it runs.
          schema:
            type: integer
            minimum: 0
            maximum: 40
      responses:
        '200':
          description: The generation.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerationRead'
        '401':
          description: >-
            Error. Possible codes: invalid_api_key, api_key_revoked,
            api_key_expired.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Error. Possible codes: feature_not_enabled, key_owner_not_member,
            insufficient_scope.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: 'Error. Possible codes: not_found.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: 'Error. Possible codes: invalid_request.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 'Error. Possible codes: rate_limited.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: 'Error. Possible codes: internal_error.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  headers:
    X-Request-Id:
      description: >-
        Identifier of this request. Quote it when you email support@myunite.ai.
        It is also in error.requestId.
      schema:
        type: string
    RateLimit-Limit:
      description: >-
        Requests allowed per minute for this key and bucket: 600 for reads, 60
        for writes. Sent on responses once the key is accepted. On 401 errors
        and on 403 errors raised while the key is checked they may be absent.
      schema:
        type: integer
    RateLimit-Remaining:
      description: Requests left in the current window.
      schema:
        type: integer
    RateLimit-Reset:
      description: Seconds until the oldest counted request leaves the window.
      schema:
        type: integer
    Retry-After:
      description: Seconds to wait before you try again.
      schema:
        type: integer
  schemas:
    GenerationRead:
      type: object
      properties:
        generation:
          type: object
          properties:
            id:
              type: string
              description: gen_ followed by the generation id.
            status:
              type: string
              enum:
                - queued
                - generating
                - completed
                - failed
            mediaType:
              type: string
              enum:
                - image
                - video
                - audio
            model:
              type: object
              properties:
                id:
                  type: string
                name:
                  type: string
              required:
                - id
                - name
            prompt:
              description: Only when one generation is read, never in a list.
              type: string
            createdAt:
              type: string
              description: ISO 8601 UTC.
            completedAt:
              description: ISO 8601 UTC. Null until the generation ends.
              type:
                - string
                - 'null'
            cost:
              type: object
              properties:
                estimatedCredits:
                  type:
                    - number
                    - 'null'
                chargedCredits:
                  description: Null while the charge is still settling.
                  type:
                    - number
                    - 'null'
                refunded:
                  type: boolean
                refundedCredits:
                  description: >-
                    When only part of the generation is refunded (formats that
                    failed), the credits refunded or being refunded.
                  type: number
              required:
                - estimatedCredits
                - chargedCredits
                - refunded
            outputs:
              type: array
              items:
                type: object
                properties:
                  url:
                    type: string
                  thumbnailUrl:
                    type:
                      - string
                      - 'null'
                  mimeType:
                    type:
                      - string
                      - 'null'
                  width:
                    type:
                      - number
                      - 'null'
                  height:
                    type:
                      - number
                      - 'null'
                  durationSeconds:
                    type:
                      - number
                      - 'null'
                  format:
                    description: >-
                      When one piece was adapted to several formats, the WxH
                      format of this file.
                    type: string
                  ref:
                    description: >-
                      When the generation has several files, this one as a media
                      argument: gen_<id>#<n>, n counted from 1 in outputs.
                    type: string
                required:
                  - url
                  - thumbnailUrl
                  - mimeType
                  - width
                  - height
                  - durationSeconds
            error:
              anyOf:
                - type: object
                  properties:
                    code:
                      type: string
                      enum:
                        - content_rejected
                        - cancelled
                        - system_failure
                        - generation_failed
                    message:
                      type: string
                  required:
                    - code
                    - message
                - type: 'null'
            videoEditId:
              description: The edit this video came from; its cost is the edit's.
              type: string
            checks:
              description: >-
                On the single read of a video started here: its frame sheet and,
                with expectedSpeech, its speech and mouth measured, as data.
                Free.
              type: object
              properties:
                status:
                  type: string
                  enum:
                    - running
                    - done
                    - failed
                  description: >-
                    running until the video ends and is measured; failed when
                    either failed.
                code:
                  description: >-
                    check_expired: the check stayed open past its 2 hours and
                    its task is gone; the video itself is unaffected.
                  type: string
                  const: check_expired
                frameSheetUrl:
                  description: >-
                    A JPEG of 8 frames spread evenly over the video, to look at
                    the face and the scene.
                  type: string
                speech:
                  type: object
                  properties:
                    transcript:
                      type: string
                      description: >-
                        What the video says, as transcribed: data, up to 6,000
                        characters.
                    language:
                      type: string
                    guide:
                      type: string
                      const: uniform
                      description: >-
                        The expected words in the take's own pace, each lasting
                        in proportion to its letters.
                    coverage:
                      type: number
                      description: The share of expected words heard, 0 to 1.
                    missing:
                      type: array
                      items:
                        type: string
                      description: >-
                        Expected words not heard, lower case without accents or
                        punctuation.
                    extra:
                      type: array
                      items:
                        type: string
                      description: Words heard that were not expected, in the same form.
                    endsAtSeconds:
                      description: Where the speech ends.
                      type:
                        - number
                        - 'null'
                    wordsPerSecond:
                      type:
                        - number
                        - 'null'
                    stretched:
                      type: array
                      items:
                        type: object
                        properties:
                          word:
                            type: string
                            description: >-
                              The word as transcribed: one token, up to 80
                              characters, control characters removed.
                          at:
                            type: number
                            description: Seconds into the video where the word starts.
                          seconds:
                            type: number
                            description: >-
                              How long it took: to the next word for a stretched
                              word, its own length for a swallowed one.
                          guide:
                            type: number
                            description: The seconds the guide gives it.
                        required:
                          - word
                          - at
                          - seconds
                          - guide
                      description: Words held past 1.15 times the guide (a stutter).
                    swallowed:
                      type: array
                      items:
                        type: object
                        properties:
                          word:
                            type: string
                            description: >-
                              The word as transcribed: one token, up to 80
                              characters, control characters removed.
                          at:
                            type: number
                            description: Seconds into the video where the word starts.
                          seconds:
                            type: number
                            description: >-
                              How long it took: to the next word for a stretched
                              word, its own length for a swallowed one.
                          guide:
                            type: number
                            description: The seconds the guide gives it.
                        required:
                          - word
                          - at
                          - seconds
                          - guide
                      description: Words cut below 0.6 times the guide.
                    music:
                      type: boolean
                      description: Whether the transcription heard music.
                  required:
                    - transcript
                    - language
                    - guide
                    - coverage
                    - missing
                    - extra
                    - endsAtSeconds
                    - wordsPerSecond
                    - stretched
                    - swallowed
                    - music
                mouth:
                  type: object
                  properties:
                    windows:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                      description: Speech windows of 1.6 s with a face that were measured.
                    weakWindows:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                      description: >-
                        Windows where the mouth follows the voice below 0.15 of
                        correlation, or stays still.
                    weakFraction:
                      type: number
                      description: >-
                        weakWindows over windows; 0.25 or more is a mouth that
                        does not follow.
                    p25:
                      description: The 25th percentile of the windows' correlation.
                      type:
                        - number
                        - 'null'
                    still:
                      type: boolean
                      description: >-
                        Whether the mouth stays still (deviation under 0.004)
                        for 1.6 s while words are spoken.
                    lipDelayFramesMedian:
                      description: >-
                        The median delay, in frames, of the lips closing on m, b
                        and p; above 2 is late.
                      type:
                        - number
                        - 'null'
                    lateLipWords:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                      description: >-
                        Words with m, b or p whose lips close more than 2 frames
                        late.
                  required:
                    - windows
                    - weakWindows
                    - weakFraction
                    - p25
                    - still
                    - lipDelayFramesMedian
                    - lateLipWords
              required:
                - status
          required:
            - id
            - status
            - mediaType
            - model
            - createdAt
            - completedAt
            - cost
            - outputs
            - error
        pollAfterSeconds:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
      required:
        - generation
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - invalid_api_key
                - api_key_revoked
                - api_key_expired
                - insufficient_scope
                - insufficient_role
                - confirmation_required
                - content_rejected
                - insufficient_credits
                - spend_limit_reached
                - feature_not_enabled
                - key_owner_not_member
                - rate_limited
                - concurrency_limit
                - invalid_request
                - idempotency_key_required
                - idempotency_conflict
                - idempotency_key_retired
                - upload_not_found
                - upload_invalid
                - file_too_large
                - video_too_long
                - source_url_rejected
                - source_url_unreachable
                - invalid_ooh_format
                - voice_origin_mismatch
                - invalid_placement
                - brand_not_found
                - quota_exhausted
                - not_found
                - report_not_ready
                - pretest_in_progress
                - webhook_url_rejected
                - webhook_endpoint_limit
                - internal_error
              description: >-
                Stable machine-readable code. Branch on this, not on the
                message. voice_origin_mismatch is legacy: no longer returned.
            message:
              type: string
              description: Human-readable explanation in English. Its wording can change.
            requestId:
              type: string
              description: >-
                Same value as the X-Request-Id response header. Quote it when
                you email support@myunite.ai.
            docUrl:
              type: string
              description: Page that explains this code.
            param:
              description: >-
                The field, query parameter or header the error refers to, when
                there is one.
              type: string
          required:
            - code
            - message
            - requestId
            - docUrl
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key, sent as `Authorization: Bearer unite_live_...`. Create keys in
        the workspace settings.

````

## Related topics

- [Generate or edit an image, a video or music, or quote it](https://docs.myunite.ai/api-reference/create/generate-or-edit-an-image-a-video-or-music-or-quote-it.md)
- [List generations, or read several by id](https://docs.myunite.ai/api-reference/create/list-generations-or-read-several-by-id.md)
- [Get a pre-test](https://docs.myunite.ai/api-reference/pretests/get-a-pre-test.md)
- [List the models of every generation operation](https://docs.myunite.ai/api-reference/create/list-the-models-of-every-generation-operation.md)
- [Get the pre-test quota](https://docs.myunite.ai/api-reference/quota/get-the-pre-test-quota.md)


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