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

# Generate images from prompts



## OpenAPI

````yaml /api-reference/openapi.json post /v1/images/generations
openapi: 3.1.0
info:
  title: SynapsAI Inference API
  version: 1.0.0
servers:
  - url: https://api.synapsai.cloud
    description: Production server
security: []
paths:
  /v1/images/generations:
    post:
      summary: Generate images from prompts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImagesGenerationsRequest'
      responses:
        '200':
          description: List of generated images (URLs or base64 strings)
          content:
            application/json:
              schema:
                type: object
                properties:
                  model:
                    type: string
                  created:
                    type: integer
                  id:
                    type: string
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                          nullable: true
                        b64_json:
                          type: string
                          nullable: true
                  size:
                    type: string
                  output_format:
                    type: string
components:
  schemas:
    ImagesGenerationsRequest:
      allOf:
        - type: object
          description: Request to generate images from text prompts.
          properties:
            prompt:
              type: string
              nullable: true
              description: >-
                Text prompt guiding image generation. Optional for unconditional
                generation.
            negative_prompt:
              type: string
              nullable: true
              description: >-
                Textual description of elements to avoid in the generated
                images.
            'n':
              type: integer
              default: 1
              description: Number of images to generate.
            output_format:
              $ref: '#/components/schemas/ImageOutputFormat'
              description: Desired image file format for outputs.
            response_format:
              $ref: '#/components/schemas/ImageResponseFormat'
              description: 'How generated images are returned: URLs or base64 JSON strings.'
            size:
              oneOf:
                - type: string
                  enum:
                    - 256x256
                    - 512x512
                    - 1024x1024
                    - 1792x1024
                    - 1024x1792
                - type: array
                  items:
                    type: integer
                  minItems: 2
                  maxItems: 2
              default: 1024x1024
              description: >-
                Desired image size either as preset string or [width, height]
                pair.
            num_inference_steps:
              type: integer
              default: 50
              description: >-
                Number of denoising / sampling steps used by the diffusion
                model.
            guidance_scale:
              type: number
              default: 7.5
              description: >-
                Classifier-free guidance scale; higher values enforce prompt
                adherence.
            seed:
              type: integer
              nullable: true
              description: Optional random seed for reproducibility of generated images.
    ImageOutputFormat:
      type: string
      description: Image file format for outputs.
      enum:
        - png
        - jpeg
        - webp
      default: png
    ImageResponseFormat:
      type: string
      description: Response format for image endpoints.
      enum:
        - url
        - b64_json
      default: url

````