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

# Get a generation

> The current state of one generation. Poll every 2–5 seconds with backoff; images usually finish in under a minute, video in a few minutes. Output URLs appear when `status` is `completed`.



## OpenAPI

````yaml /openapi.v1.json get /v1/generations/{generation_id}
openapi: 3.1.0
info:
  contact:
    email: hello@ekly.ai
    name: Ekly
    url: https://docs.ekly.ai
  description: >-
    Generate images, video, music and speech with the same models and credits as
    the Ekly app.


    Authenticate with an organization API key from Settings → Team as a bearer
    token. Every endpoint lives under /v1 and follows the additive-only
    versioning policy at https://docs.ekly.ai/versioning.
  termsOfService: https://ekly.ai/terms
  title: Ekly API
  version: '1.0'
servers:
  - description: Production
    url: https://api.ekly.ai
security:
  - ApiKey: []
tags:
  - description: Public, versioned developer API
    name: v1
paths:
  /v1/generations/{generation_id}:
    get:
      tags:
        - v1
      summary: Get a generation
      description: >-
        The current state of one generation. Poll every 2–5 seconds with
        backoff; images usually finish in under a minute, video in a few
        minutes. Output URLs appear when `status` is `completed`.
      operationId: get_generation
      parameters:
        - description: The `id` returned when you created the generation.
          in: path
          name: generation_id
          required: true
          schema:
            description: The `id` returned when you created the generation.
            title: Generation Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerationResponse'
          description: Successful Response
        '401':
          content:
            application/json:
              example:
                error:
                  code: unauthenticated
                  message: >-
                    This API key is not valid. Create a new one in Settings →
                    Team.
                  trace_id: c3746d5302dc4be6b2e8fa99fa762a8c
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: API key missing, invalid, revoked or expired.
        '403':
          content:
            application/json:
              example:
                error:
                  code: forbidden
                  message: API keys can only call the /v1 API.
                  trace_id: c3746d5302dc4be6b2e8fa99fa762a8c
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not allowed for this key or organization.
        '404':
          content:
            application/json:
              example:
                error:
                  code: not_found
                  message: No generation with that id for this key.
                  trace_id: c3746d5302dc4be6b2e8fa99fa762a8c
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: No such resource.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '429':
          content:
            application/json:
              example:
                error:
                  code: rate_limited
                  message: Rate limit exceeded; retry after 12s.
                  trace_id: c3746d5302dc4be6b2e8fa99fa762a8c
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Rate limit exceeded; see Retry-After.
      security:
        - ApiKey: []
components:
  schemas:
    GenerationResponse:
      description: >-
        One generation. Poll GET /v1/generations/{id} until status is completed
        or failed.
      properties:
        completed_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Completed At
        created_at:
          format: date-time
          title: Created At
          type: string
        credits_charged:
          anyOf:
            - type: number
            - type: 'null'
          description: Credits actually charged; null while pending.
          title: Credits Charged
        error:
          anyOf:
            - $ref: '#/components/schemas/GenerationError'
            - type: 'null'
        id:
          examples:
            - 6f1c2d3e-9a0b-4c7d-8e1f-2a3b4c5d6e7f
          title: Id
          type: string
        idempotency_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Idempotency Key
        model:
          examples:
            - seedance-2-5-fal
          title: Model
          type: string
        outputs:
          items:
            $ref: '#/components/schemas/GenerationOutput'
          title: Outputs
          type: array
        prompt:
          title: Prompt
          type: string
        status:
          enum:
            - pending
            - completed
            - failed
          title: Status
          type: string
        type:
          enum:
            - image
            - video
            - audio
          title: Type
          type: string
      required:
        - id
        - type
        - status
        - model
        - prompt
        - created_at
      title: GenerationResponse
      type: object
    ErrorResponse:
      description: Every non-2xx /v1 response.
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      required:
        - error
      title: ErrorResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    GenerationError:
      properties:
        code:
          description: >-
            One of the public failure categories: rate_limited, timeout, safety,
            invalid_voice, invalid_request, billing_or_access, provider_auth,
            provider_unavailable, provider_error.
          title: Code
          type: string
        message:
          title: Message
          type: string
      required:
        - code
        - message
      title: GenerationError
      type: object
    GenerationOutput:
      properties:
        asset_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Workspace asset id for this output. Pass it as a reference input to
            chain generations.
          title: Asset Id
        content_type:
          anyOf:
            - type: string
            - type: 'null'
          examples:
            - video/mp4
          title: Content Type
        duration_seconds:
          anyOf:
            - type: number
            - type: 'null'
          title: Duration Seconds
        height:
          anyOf:
            - type: integer
            - type: 'null'
          title: Height
        url:
          description: >-
            Download URL. Fetch promptly or store the file; URLs are not
            permanent.
          title: Url
          type: string
        width:
          anyOf:
            - type: integer
            - type: 'null'
          title: Width
      required:
        - url
      title: GenerationOutput
      type: object
    ErrorBody:
      properties:
        code:
          description: >-
            Stable machine-readable code: unauthenticated, invalid_api_key,
            payment_required, forbidden, api_key_scope, not_found, conflict,
            validation_error, rate_limited, client_error, internal_error.
          title: Code
          type: string
        details:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          description: >-
            Only on 422: one entry per offending field, with `loc`, `msg` and
            `type`.
          title: Details
        message:
          description: >-
            Human-readable explanation; safe to show to a developer, not meant
            for parsing.
          title: Message
          type: string
        trace_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Quote this when contacting support; it identifies the exact request.
          title: Trace Id
      required:
        - code
        - message
      title: ErrorBody
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    ApiKey:
      bearerFormat: ek_live_…
      description: >-
        An organization API key created in Settings → Team, sent as
        `Authorization: Bearer <key>`.
      scheme: bearer
      type: http

````

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