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

# POST /v1/images/generations

> Available at the instance root or under a provider/namespace prefix. Shared paths select the wire dialect from client headers; without dialect evidence, the first listed route wins.



## OpenAPI

````yaml /generated/openapi.json post /v1/images/generations
openapi: 3.1.0
info:
  description: >-
    Forwarding, management, portal and OAuth APIs generated from Rust types.
    Input and output schemas preserve their respective Serde contracts.
    Streaming events and WebSocket messages are documented alongside HTTP
    payloads.
  title: GPROXY HTTP API
  version: 4.2.1
servers: []
security:
  - bearer: []
  - anthropicKey: []
  - googleKey: []
  - queryKey: []
paths:
  /v1/images/generations:
    post:
      tags:
        - Forwarding
      summary: POST /v1/images/generations
      description: >-
        Available at the instance root or under a provider/namespace prefix.
        Shared paths select the wire dialect from client headers; without
        dialect evidence, the first listed route wins.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Input_CreateImageRequestBody'
        required: true
      responses:
        2XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Output_ImagesResponse'
            text/event-stream:
              schema:
                type: string
              x-event-schema:
                $ref: '#/components/schemas/Output_ImageGenerationStreamEvent'
          description: Successful protocol response
        default:
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/Output_Envelope'
                  - properties:
                      error:
                        $ref: '#/components/schemas/Output_ErrorDetail'
                    required:
                      - error
                    type: object
                  - allOf:
                      - $ref: '#/components/schemas/Output_ErrorEvent'
                      - properties:
                          type:
                            const: error
                        required:
                          - type
                        type: object
                  - properties:
                      error:
                        $ref: '#/components/schemas/Output_GenerateContentError'
                    required:
                      - error
                    type: object
            text/plain:
              schema:
                type: string
          description: Gateway or upstream error
components:
  schemas:
    Input_CreateImageRequestBody:
      additionalProperties: true
      properties:
        background:
          anyOf:
            - $ref: '#/components/schemas/Input_ImageBackground2'
            - type: 'null'
        model:
          type:
            - string
            - 'null'
        moderation:
          anyOf:
            - $ref: '#/components/schemas/Input_ImageModeration'
            - type: 'null'
        'n':
          format: int64
          type:
            - integer
            - 'null'
        output_compression:
          format: int64
          type:
            - integer
            - 'null'
        output_format:
          anyOf:
            - $ref: '#/components/schemas/Input_ImageOutputFormat2'
            - type: 'null'
        partial_images:
          format: int64
          type:
            - integer
            - 'null'
        prompt:
          type: string
        quality:
          anyOf:
            - $ref: '#/components/schemas/Input_ImageQuality2'
            - type: 'null'
        response_format:
          anyOf:
            - $ref: '#/components/schemas/Input_ImageResponseFormat2'
            - type: 'null'
        size:
          type:
            - string
            - 'null'
        stream:
          type:
            - boolean
            - 'null'
        style:
          anyOf:
            - $ref: '#/components/schemas/Input_ImageStyle'
            - type: 'null'
        user:
          type:
            - string
            - 'null'
      required:
        - prompt
      type: object
    Output_ImagesResponse:
      additionalProperties: true
      properties:
        background:
          anyOf:
            - $ref: '#/components/schemas/Output_OutputImageBackground'
            - type: 'null'
        created:
          format: int64
          type: integer
        data:
          items:
            $ref: '#/components/schemas/Output_GeneratedImage'
          type:
            - array
            - 'null'
        output_format:
          anyOf:
            - $ref: '#/components/schemas/Output_ImageOutputFormat2'
            - type: 'null'
        quality:
          anyOf:
            - $ref: '#/components/schemas/Output_OutputImageQuality'
            - type: 'null'
        size:
          anyOf:
            - $ref: '#/components/schemas/Output_OutputImageSize'
            - type: 'null'
        usage:
          anyOf:
            - $ref: '#/components/schemas/Output_ImageUsage'
            - type: 'null'
      required:
        - created
      type: object
    Output_Envelope:
      properties:
        error:
          $ref: '#/components/schemas/Output_EnvelopeBody'
      required:
        - error
      type: object
    Output_ErrorDetail:
      properties:
        code:
          type:
            - string
            - 'null'
        message:
          type: string
        param:
          type:
            - string
            - 'null'
        type:
          type:
            - string
            - 'null'
      required:
        - message
      type: object
    Output_ErrorEvent:
      additionalProperties: true
      properties:
        error:
          $ref: '#/components/schemas/Output_StreamError'
        request_id:
          type:
            - string
            - 'null'
      required:
        - error
      type: object
    Output_GenerateContentError:
      additionalProperties: true
      properties:
        code:
          format: int64
          type: integer
        details:
          items: true
          type:
            - array
            - 'null'
        message:
          type: string
        status:
          type:
            - string
            - 'null'
      required:
        - code
        - message
      type: object
    Input_ImageBackground2:
      enum:
        - transparent
        - opaque
        - auto
      type: string
    Input_ImageModeration:
      enum:
        - low
        - auto
      type: string
    Input_ImageOutputFormat2:
      enum:
        - png
        - jpeg
        - webp
      type: string
    Input_ImageQuality2:
      enum:
        - standard
        - hd
        - low
        - medium
        - high
        - auto
        - xhigh
        - max
      type: string
    Input_ImageResponseFormat2:
      enum:
        - url
        - b64_json
      type: string
    Input_ImageStyle:
      enum:
        - vivid
        - natural
      type: string
    Output_OutputImageBackground:
      enum:
        - transparent
        - opaque
      type: string
    Output_GeneratedImage:
      additionalProperties: true
      properties:
        b64_json:
          type:
            - string
            - 'null'
        revised_prompt:
          type:
            - string
            - 'null'
        url:
          type:
            - string
            - 'null'
      type: object
    Output_ImageOutputFormat2:
      enum:
        - png
        - jpeg
        - webp
      type: string
    Output_OutputImageQuality:
      enum:
        - low
        - medium
        - high
        - xhigh
        - max
      type: string
    Output_OutputImageSize:
      anyOf:
        - enum:
            - 1024x1024
            - 1024x1536
            - 1536x1024
          type: string
        - type: string
    Output_ImageUsage:
      additionalProperties: true
      properties:
        input_tokens:
          format: int64
          type: integer
        input_tokens_details:
          $ref: '#/components/schemas/Output_ImageTokenDetails'
        output_tokens:
          format: int64
          type: integer
        output_tokens_details:
          anyOf:
            - $ref: '#/components/schemas/Output_ImageTokenDetails'
            - type: 'null'
        total_tokens:
          format: int64
          type: integer
      required:
        - input_tokens
        - input_tokens_details
        - output_tokens
        - total_tokens
      type: object
    Output_EnvelopeBody:
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
    Output_StreamError:
      additionalProperties: true
      properties:
        message:
          type: string
        type:
          $ref: '#/components/schemas/Output_StreamErrorType'
      required:
        - type
        - message
      type: object
    Output_ImageTokenDetails:
      additionalProperties: true
      properties:
        image_tokens:
          format: int64
          type: integer
        text_tokens:
          format: int64
          type: integer
      required:
        - image_tokens
        - text_tokens
      type: object
    Output_StreamErrorType:
      enum:
        - api_error
        - authentication_error
        - billing_error
        - invalid_request_error
        - not_found_error
        - overloaded_error
        - permission_error
        - rate_limit_error
        - timeout_error
        - conflict_error
        - request_too_large
      type: string
  securitySchemes:
    bearer:
      scheme: bearer
      type: http
    anthropicKey:
      in: header
      name: x-api-key
      type: apiKey
    googleKey:
      in: header
      name: x-goog-api-key
      type: apiKey
    queryKey:
      in: query
      name: key
      type: apiKey

````

## Related topics

- [Routing & Endpoints](https://gproxy.leenhawk.com/reference/routing-table.md)
- [POST /v1/images/edits](https://gproxy.leenhawk.com/api-reference/forwarding/post-v1imagesedits.md)
- [POST /v1/search](https://gproxy.leenhawk.com/api-reference/forwarding/post-v1search.md)
- [POST /v1/interactions](https://gproxy.leenhawk.com/api-reference/forwarding/post-v1interactions.md)
- [POST /v1/responses](https://gproxy.leenhawk.com/api-reference/forwarding/post-v1responses.md)


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