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

# Post apiv1image generations



## OpenAPI

````yaml https://backend.aflux.ai/openapi post /api/v1/image-generations
openapi: 3.0.3
info:
  title: AdFlux Backend API
  version: v1
servers:
  - url: /
security: []
tags:
  - name: auth
  - name: users
  - name: uploads
  - name: projects
  - name: campaigns
  - name: placements
  - name: billing
  - name: payments
  - name: image-generations
paths:
  /api/v1/image-generations:
    post:
      tags:
        - image-generations
      operationId: imageGenerationsCreate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateImageRequest'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationAcceptedResponse'
        default:
          $ref: '#/components/responses/DefaultError'
      security:
        - Bearer: []
components:
  schemas:
    GenerateImageRequest:
      type: object
      required:
        - projectId
        - assetKind
        - aspectRatio
        - userNotes
      properties:
        projectId:
          type: string
          format: uuid
        assetKind:
          $ref: '#/components/schemas/GeneratedAssetKind'
        aspectRatio:
          $ref: '#/components/schemas/GeneratedImageAspectRatio'
        userNotes:
          type: string
          minLength: 1
          maxLength: 2000
        destinationUrl:
          type: string
          nullable: true
          maxLength: 2048
          description: >-
            A hint about who the advertiser is, and nothing more: only the
            scheme, host and path reach the image model, never the query string.
            Placeholders (see CreateCampaignRequest.destinationUrl) cannot be
            substituted at this point — the image is generated before the
            campaign exists, so there is no campaign to name — and a URL still
            carrying one after the query string is cut is left out of the prompt
            altogether.
        objective:
          $ref: '#/components/schemas/CampaignObjective'
          nullable: true
        adCopy:
          type: string
          nullable: true
          maxLength: 4000
    ImageGenerationAcceptedResponse:
      type: object
      required:
        - requestId
      properties:
        requestId:
          type: string
          format: uuid
    GeneratedAssetKind:
      type: string
      enum:
        - CAMPAIGN_MEDIA
    GeneratedImageAspectRatio:
      type: string
      enum:
        - SQUARE
        - PORTRAIT
    CampaignObjective:
      type: string
      enum:
        - AWARENESS
        - TRAFFIC
        - CONVERSIONS
        - APP_INSTALLS
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
  responses:
    DefaultError:
      description: Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````