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

# Retrieve a generation

> Poll this endpoint to track status when not using webhooks.

Poll this endpoint to track status when not using [webhooks](/api-reference/webhooks). Recommended cadence: every 1–2 seconds, with a sensible overall timeout (most renders finish within \~30s).

When the render finishes, `status` transitions to `complete` (with `imageUrl` and `imageVariants`) or `failed` (with `error`).

`imageVariants` exposes resized, CDN-cached versions of `imageUrl` (`list` / `card` / `detail`) for surfaces where the full-resolution render is overkill — emails, lists, mobile. Names describe the intended surface, so pick by where you're rendering, not by pixel width.


## OpenAPI

````yaml GET /v1/generations/{id}
openapi: 3.1.0
info:
  title: Selektable API
  version: 1.0.0
  description: >-
    Generate AI product visualizations from a customer photo. Two modes are
    supported: `virtual-try-on` (fashion) and `room-visualizer` (interior).
    Generations are asynchronous: subscribe a webhook endpoint (recommended) or
    poll the generation.
  contact:
    name: Selektable Support
    url: https://selektable.com
servers:
  - url: https://app.selektable.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Generations
    description: Create and retrieve AI visualizations
  - name: Webhook Endpoints
    description: Manage outgoing webhook destinations
paths:
  /v1/generations/{id}:
    get:
      tags:
        - Generations
      summary: Retrieve a generation
      description: Poll this endpoint to track status when not using webhooks.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The generation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Generation'
        '401':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
components:
  schemas:
    Generation:
      type: object
      properties:
        id:
          type: string
          example: agen_abc123
        object:
          type: string
          enum:
            - generation
        status:
          type: string
          enum:
            - processing
            - complete
            - failed
        mode:
          type: string
          enum:
            - virtual-try-on
            - room-visualizer
        imageSize:
          type: string
          enum:
            - 1K
            - 2K
            - 4K
        imageUrl:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            Permanent CDN URL to the original render at the requested
            `imageSize` (1K/2K/4K). Safe to store and embed.
        imageVariants:
          type:
            - object
            - 'null'
          description: >-
            Permanent CDN URLs to resized JPEG/WebP variants of `imageUrl`,
            served by Cloudflare Image Transformations. Use a variant instead of
            the original when you need a smaller payload (emails, lists,
            mobile). `null` until `status` is `complete`.
          properties:
            list:
              $ref: '#/components/schemas/ImageVariant'
              description: 200px wide. Tables, recent-renders strips, dense grids.
            card:
              $ref: '#/components/schemas/ImageVariant'
              description: Email embeds, product cards, cart drawers, mobile widths.
            detail:
              $ref: '#/components/schemas/ImageVariant'
              description: PDP hero, full-screen overlay, primary surface.
        products:
          type: array
          items:
            $ref: '#/components/schemas/Product'
        hint:
          type:
            - string
            - 'null'
        error:
          type:
            - object
            - 'null'
          properties:
            code:
              type: string
            message:
              type: string
        metadata:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
        createdAt:
          type: string
          format: date-time
        completedAt:
          type:
            - string
            - 'null'
          format: date-time
    ImageVariant:
      type: object
      required:
        - url
        - width
      properties:
        url:
          type: string
          format: uri
          description: Permanent, CDN-cached URL for this variant.
        width:
          type: integer
          description: Maximum width in pixels. Height scales proportionally.
    Product:
      type: object
      required:
        - productId
        - productTitle
        - imageUrl
      properties:
        productId:
          oneOf:
            - type: string
            - type: number
        productTitle:
          type: string
        imageUrl:
          type: string
          format: uri
        productUrl:
          type: string
          format: uri
        dimensions:
          type: object
          description: Optional real-world dimensions (improves interior scale accuracy).
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - authentication_error
                - authorization_error
                - invalid_request_error
                - rate_limit_error
                - not_found_error
                - conflict_error
                - api_error
            code:
              type: string
            message:
              type: string
            param:
              type: string
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your Selektable API key (`selektable_...`), sent as `Authorization:
        Bearer <key>`.

````