> ## 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.

# Generate images

> 

Use a compatible Hicap model ID in the request body. Azure deployment IDs and api-version are not part of this route. Supported optional parameters depend on the model.

> [!NOTE]
>
> Choose an exact compatible ID from [the model list](https://docs.hicap.ai/api-reference/models.md). Supported parameters and output formats vary by model and connection; this schema does not guarantee every upstream feature. See [endpoint availability](https://docs.hicap.ai/api-reference/introduction.md#endpoint-availability).


## OpenAPI

````yaml post /images/generations
openapi: 3.1.0
info:
  title: Hicap API
  description: >-
    OpenAI-compatible request reference. Authenticate using the api-key header.
    Listed paths and request shapes do not guarantee support for every model,
    connection, backend, or parameter; see
    https://docs.hicap.ai/api-reference/introduction.
  version: 1.0.0
  contact:
    name: Hicap Support
    email: support@hicap.ai
servers:
  - url: https://api.hicap.ai/v1
security:
  - apiKeyAuth: []
paths:
  /images/generations:
    post:
      summary: >-
        Generates a batch of images from a text caption on a given DALLE model
        deployment
      description: >-


        Use a compatible Hicap model ID in the request body. Azure deployment
        IDs and api-version are not part of this route. Supported optional
        parameters depend on the model.
      operationId: ImageGenerations_Create
      parameters:
        - name: x-hicap-tags
          in: header
          required: false
          description: >-
            One JSON object mapping dimension keys to short string values. Never
            include secrets or direct personal identifiers. Opaque identity
            references require approved policy and verified destination
            handling; see the identity attribution guide.
          schema:
            type: string
          example: '{"feature":"support","env":"production"}'
      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: >-
            Gateway or backend error. Body shape varies; inspect HTTP status
            before parsing.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  message:
                    type: string
                  error:
                    type: object
                    additionalProperties: true
                additionalProperties: true
components:
  schemas:
    imageGenerationsRequest:
      type: object
      properties:
        prompt:
          type: string
          minLength: 1
          description: >-
            Describe the image to generate. Prompt limits depend on the selected
            model.
          example: A corgi in a field
        'n':
          type: integer
          minimum: 1
          description: Requested image count. Supported counts depend on the model.
        size:
          type: string
          description: >-
            A size value supported by the selected image model. Confirm
            supported values before use.
        response_format:
          type: string
          description: >-
            A response format value supported by the selected image model.
            Confirm supported values before use.
        user:
          description: >-
            A unique identifier representing your end-user, which can help to
            monitor and detect abuse.
          type: string
          format: string
          example: user123456
        quality:
          type: string
          description: >-
            A quality value supported by the selected image model. Confirm
            supported values before use.
        style:
          type: string
          description: >-
            A style value supported by the selected image model. Confirm
            supported values before use.
        model:
          type: string
          minLength: 1
          description: Exact compatible Hicap model ID from GET /v1/models.
      required:
        - prompt
        - model
    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
    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'
    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'
    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
    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.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.