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

# Generate an image

> Start an image generation. Returns immediately with the image ID(s). Poll GET /images/{id} to check status and retrieve the result. Optionally include referenceImageIds for style/content guidance.



## OpenAPI

````yaml https://www.trybloom.ai/api/v1/spec.json post /images/generations
openapi: 3.1.1
info:
  title: Bloom API
  version: 1.0.0
servers:
  - url: https://www.trybloom.ai/api/v1
security:
  - apiKey: []
  - bearer: []
tags:
  - name: Account
    description: >-
      Inspect the authenticated account — profile, credit balance, and
      accessible workspaces.
  - name: Brands
    description: Manage brands and brand identity.
  - name: Images
    description: Generate, edit, and retrieve images.
paths:
  /images/generations:
    post:
      tags:
        - Images
      summary: Generate an image
      description: >-
        Start an image generation. Returns immediately with the image ID(s).
        Poll GET /images/{id} to check status and retrieve the result.
        Optionally include referenceImageIds for style/content guidance.
      operationId: images.generate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  minLength: 1
                  maxLength: 2000
                  description: Description of the image to generate (1–2000 chars)
                brandSessionId:
                  type: string
                  format: uuid
                  description: Brand session ID (from GET /brands)
                aspectRatio:
                  enum:
                    - '1:1'
                    - '2:3'
                    - '3:2'
                    - '3:4'
                    - '4:3'
                    - '4:5'
                    - '5:4'
                    - '9:16'
                    - '16:9'
                    - '21:9'
                  description: >-
                    Aspect ratio. One of "1:1", "2:3", "3:2", "3:4", "4:3",
                    "4:5", "5:4", "9:16", "16:9", "21:9"
                imageSize:
                  enum:
                    - 2K
                    - 4K
                  default: 2K
                  description: '"2K" (default, 1 credit) or "4K" (2 credits, Plus/Pro)'
                model:
                  enum:
                    - fast
                    - standard
                    - pro
                  description: >-
                    Model tier. "fast" (cheaper/faster), "standard" (mid tier),
                    or "pro" (default, highest quality).
                variantCount:
                  type: integer
                  minimum: 1
                  maximum: 5
                  description: >-
                    Number of variant images to generate (1-5, default 1). Each
                    variant costs the same credits.
                referenceImageIds:
                  type: array
                  maxItems: 10
                  items:
                    type: string
                    format: uuid
                  description: >-
                    IDs of uploaded or generated images to use as style/content
                    references (max 10)
              required:
                - prompt
                - brandSessionId
      responses:
        '202':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      ids:
                        type: array
                        minItems: 1
                        items:
                          type: string
                          format: uuid
                      variantGroupId:
                        anyOf:
                          - type: string
                            format: uuid
                          - type: 'null'
                      status:
                        const: pending
                    required:
                      - ids
                      - variantGroupId
                      - status
                required:
                  - data
        '400':
          description: '400'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: SESSION_MISSING_BRAND_IMAGE
                      status:
                        const: 400
                      message:
                        type: string
                        default: Brand session is not fully onboarded
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: REFERENCE_LIMIT_EXCEEDED
                      status:
                        const: 400
                      message:
                        type: string
                        default: Too many reference images
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '401':
          description: '401'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: UNAUTHORIZED
                      status:
                        const: 401
                      message:
                        type: string
                        default: Invalid or missing API credentials
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '402':
          description: '402'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: INSUFFICIENT_CREDITS
                      status:
                        const: 402
                      message:
                        type: string
                        default: Not enough credits to generate
                      data:
                        type: object
                        properties:
                          action_url:
                            type: string
                            format: uri
                            description: >-
                              Deep link to /pricing for the caller to top up
                              credits
                        required:
                          - action_url
                    required:
                      - defined
                      - code
                      - status
                      - message
                      - data
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: PAYMENT_REQUIRED
                      status:
                        const: 402
                      message:
                        type: string
                        default: Subscription paused — complete payment to resume
                      data:
                        type: object
                        properties:
                          action_url:
                            type: string
                            format: uri
                            description: >-
                              Deep link to /pricing to complete the pending
                              payment
                        required:
                          - action_url
                    required:
                      - defined
                      - code
                      - status
                      - message
                      - data
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '403':
          description: '403'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: FORBIDDEN
                      status:
                        const: 403
                      message:
                        type: string
                        default: Plan upgrade required
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: FEATURE_NOT_ENTITLED
                      status:
                        const: 403
                      message:
                        type: string
                        default: 4K generation requires Plus or Pro plan
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '404':
          description: '404'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: REFERENCE_IMAGE_NOT_FOUND
                      status:
                        const: 404
                      message:
                        type: string
                        default: Reference image not found
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '422':
          description: '422'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: BRAND_NOT_FOUND
                      status:
                        const: 422
                      message:
                        type: string
                        default: Brand session not found
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '429':
          description: '429'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: TOO_MANY_REQUESTS
                      status:
                        const: 429
                      message:
                        type: string
                        default: Rate limit exceeded
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Bloom API key, for example `x-api-key: bloom_sk_...`.'
    bearer:
      type: http
      scheme: bearer
      description: Bloom API key (`Bearer bloom_sk_...`) or Bloom OAuth access token.

````