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

# Generates a batch of images from a text caption on a given DALLE model deployment



## OpenAPI

````yaml post /deployments/{deploymentId}/images/generations
openapi: 3.1.0
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.hicap.ai/v1
security:
  - apiKeyAuth: []
paths:
  /deployments/{deploymentId}/images/generations:
    post:
      summary: >-
        Generates a batch of images from a text caption on a given DALLE model
        deployment
      operationId: ImageGenerations_Create
      parameters:
        - in: path
          name: deploymentId
          required: true
          schema:
            type: string
            example: dalle-deployment
            description: Deployment id of the dalle model which was deployed.
        - in: query
          name: api-version
          required: true
          schema:
            type: string
            example: 2025-01-01-preview
            description: api version
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/imageGenerationsRequest'
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/generateImagesResponse'
        default:
          description: An error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dalleErrorResponse'
components:
  schemas:
    imageGenerationsRequest:
      type: object
      properties:
        prompt:
          description: >-
            A text description of the desired image(s). The maximum length is
            4000 characters.
          type: string
          format: string
          example: a corgi in a field
          minLength: 1
        'n':
          description: The number of images to generate.
          type: integer
          minimum: 1
          maximum: 1
          default: 1
        size:
          $ref: '#/components/schemas/imageSize'
        response_format:
          $ref: '#/components/schemas/imagesResponseFormat'
        user:
          description: >-
            A unique identifier representing your end-user, which can help to
            monitor and detect abuse.
          type: string
          format: string
          example: user123456
        quality:
          $ref: '#/components/schemas/imageQuality'
        style:
          $ref: '#/components/schemas/imageStyle'
      required:
        - prompt
    generateImagesResponse:
      type: object
      properties:
        created:
          type: integer
          format: unixtime
          description: The unix timestamp when the operation was created.
          example: '1676540381'
        data:
          type: array
          description: The result data of the operation, if successful
          items:
            $ref: '#/components/schemas/imageResult'
      required:
        - created
        - data
    dalleErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/dalleError'
    imageSize:
      description: The size of the generated images.
      type: string
      enum:
        - 256x256
        - 512x512
        - 1792x1024
        - 1024x1792
        - 1024x1024
      default: 1024x1024
      x-ms-enum:
        name: Size
        modelAsString: true
        values:
          - value: 256x256
            description: >-
              The desired size of the generated image is 256x256 pixels. Only
              supported for dall-e-2.
            name: Size256x256
          - value: 512x512
            description: >-
              The desired size of the generated image is 512x512 pixels. Only
              supported for dall-e-2.
            name: Size512x512
          - value: 1792x1024
            description: >-
              The desired size of the generated image is 1792x1024 pixels. Only
              supported for dall-e-3.
            name: Size1792x1024
          - value: 1024x1792
            description: >-
              The desired size of the generated image is 1024x1792 pixels. Only
              supported for dall-e-3.
            name: Size1024x1792
          - value: 1024x1024
            description: The desired size of the generated image is 1024x1024 pixels.
            name: Size1024x1024
    imagesResponseFormat:
      description: The format in which the generated images are returned.
      type: string
      enum:
        - url
        - b64_json
      default: url
      x-ms-enum:
        name: ImagesResponseFormat
        modelAsString: true
        values:
          - value: url
            description: >-
              The URL that provides temporary access to download the generated
              images.
            name: Url
          - value: b64_json
            description: The generated images are returned as base64 encoded string.
            name: Base64Json
    imageQuality:
      description: The quality of the image that will be generated.
      type: string
      enum:
        - standard
        - hd
      default: standard
      x-ms-enum:
        name: Quality
        modelAsString: true
        values:
          - value: standard
            description: Standard quality creates images with standard quality.
            name: Standard
          - value: hd
            description: >-
              HD quality creates images with finer details and greater
              consistency across the image.
            name: HD
    imageStyle:
      description: The style of the generated images.
      type: string
      enum:
        - vivid
        - natural
      default: vivid
      x-ms-enum:
        name: Style
        modelAsString: true
        values:
          - value: vivid
            description: Vivid creates images that are hyper-realistic and dramatic.
            name: Vivid
          - value: natural
            description: >-
              Natural creates images that are more natural and less
              hyper-realistic.
            name: Natural
    imageResult:
      type: object
      description: The image url or encoded image if successful, and an error otherwise.
      properties:
        url:
          type: string
          description: The image url.
          example: https://www.contoso.com
        b64_json:
          type: string
          description: The base64 encoded image
        content_filter_results:
          $ref: '#/components/schemas/dalleContentFilterResults'
        revised_prompt:
          type: string
          description: >-
            The prompt that was used to generate the image, if there was any
            revision to the prompt.
        prompt_filter_results:
          $ref: '#/components/schemas/dalleFilterResults'
    dalleError:
      type: object
      allOf:
        - $ref: '#/components/schemas/errorBase'
      properties:
        param:
          type: string
        type:
          type: string
        inner_error:
          $ref: '#/components/schemas/dalleInnerError'
    dalleContentFilterResults:
      type: object
      description: Information about the content filtering results.
      properties:
        sexual:
          $ref: '#/components/schemas/contentFilterSeverityResult'
        violence:
          $ref: '#/components/schemas/contentFilterSeverityResult'
        hate:
          $ref: '#/components/schemas/contentFilterSeverityResult'
        self_harm:
          $ref: '#/components/schemas/contentFilterSeverityResult'
    dalleFilterResults:
      type: object
      description: >-
        Information about the content filtering category (hate, sexual,
        violence, self_harm), if it has been detected, as well as the severity
        level (very_low, low, medium, high-scale that determines the intensity
        and risk level of harmful content) and if it has been filtered or not.
        Information about jailbreak content and profanity, if it has been
        detected, and if it has been filtered or not. And information about
        customer block list, if it has been filtered and its id.
      allOf:
        - $ref: '#/components/schemas/dalleContentFilterResults'
        - properties:
            profanity:
              $ref: '#/components/schemas/contentFilterDetectedResult'
            jailbreak:
              $ref: '#/components/schemas/contentFilterDetectedResult'
            custom_blocklists:
              $ref: '#/components/schemas/contentFilterDetailedResults'
    errorBase:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
    dalleInnerError:
      description: Inner error with additional details.
      type: object
      properties:
        code:
          $ref: '#/components/schemas/innerErrorCode'
        content_filter_results:
          $ref: '#/components/schemas/dalleFilterResults'
        revised_prompt:
          type: string
          description: >-
            The prompt that was used to generate the image, if there was any
            revision to the prompt.
    contentFilterSeverityResult:
      type: object
      allOf:
        - $ref: '#/components/schemas/contentFilterResultBase'
        - properties:
            severity:
              type: string
              enum:
                - safe
                - low
                - medium
                - high
              x-ms-enum:
                name: ContentFilterSeverity
                modelAsString: true
                values:
                  - value: safe
                    description: >-
                      General content or related content in generic or
                      non-harmful contexts.
                  - value: low
                    description: Harmful content at a low intensity and risk level.
                  - value: medium
                    description: Harmful content at a medium intensity and risk level.
                  - value: high
                    description: Harmful content at a high intensity and risk level.
      required:
        - severity
        - filtered
    contentFilterDetectedResult:
      type: object
      allOf:
        - $ref: '#/components/schemas/contentFilterResultBase'
        - properties:
            detected:
              type: boolean
      required:
        - detected
        - filtered
    contentFilterDetailedResults:
      type: object
      description: >-
        Content filtering results with a detail of content filter ids for the
        filtered segments.
      allOf:
        - $ref: '#/components/schemas/contentFilterResultBase'
        - properties:
            details:
              items:
                $ref: '#/components/schemas/contentFilterIdResult'
              type: array
      required:
        - filtered
        - details
    innerErrorCode:
      description: Error codes for the inner error object.
      enum:
        - ResponsibleAIPolicyViolation
      type: string
      x-ms-enum:
        name: InnerErrorCode
        modelAsString: true
        values:
          - value: ResponsibleAIPolicyViolation
            description: The prompt violated one of more content filter rules.
    contentFilterResultBase:
      type: object
      properties:
        filtered:
          type: boolean
      required:
        - filtered
    contentFilterIdResult:
      type: object
      allOf:
        - $ref: '#/components/schemas/contentFilterResultBase'
        - properties:
            id:
              type: string
      required:
        - id
        - filtered
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: api-key
      description: Your Hicap API key.

````