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

# Image-01 Image to Image

> Image-to-image capability for the `Image-01` model.

Exposed fields: `model`, `prompt`, `subject_reference`, `aspect_ratio`, `width`, `height`, `response_format`, `seed`, `n`, `prompt_optimizer`. `subject_reference` is expanded as a JSON request in this document.



## OpenAPI

````yaml api-reference/en/zmodelImage/minimax/image01-image-to-image.json POST /v1/images/edits
openapi: 3.0.1
info:
  title: Image-01 image-to-image
  version: 1.0.0
  description: >-
    Image-01 image-to-image capability documentation. The unified API endpoint
    is `/v1/images/edits`, used for generating or redrawing images based on a
    reference image.
  license:
    name: Project License
    url: https://github.com/QuantumNous/new-api/blob/main/LICENSE
servers:
  - url: https://api.powertokens.ai
    description: Baze API server endpoint
security: []
tags:
  - name: Image Generation
    description: Image-01 image-to-image capability
paths:
  /v1/images/edits:
    post:
      tags:
        - Image Generation
      summary: Image-01 image-to-image
      description: >-
        Image-to-image capability for the `Image-01` model.


        Exposed fields: `model`, `prompt`, `subject_reference`, `aspect_ratio`,
        `width`, `height`, `response_format`, `seed`, `n`, `prompt_optimizer`.
        `subject_reference` is expanded as a JSON request in this document.
      operationId: minimaxImageToImage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MiniMaxImageToImageRequest'
            examples:
              subject_reference_example:
                summary: Using subject_reference
                value:
                  model: image-01
                  prompt: Turn this portrait into a manga cover
                  subject_reference:
                    - type: character
                      url: https://example.com/reference.png
                  response_format: url
                  'n': 1
      responses:
        '200':
          description: Success. Returns the unified image response structure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MiniMaxImageResponse'
        '400':
          description: >-
            Invalid request parameters, e.g. missing `subject_reference` or
            invalid field combination for the unified API endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_request:
                  summary: Parameter error
                  value:
                    error:
                      message: Malformed request body or invalid field values
                      type: invalid_request_error
                      code: bad_request_body
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  summary: Unauthorized
                  value:
                    error:
                      message: Invalid token
                      type: api_error
                      code: access_denied
          description: Authentication failed, e.g. missing or invalid token.
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                request_too_large:
                  summary: Request body too large
                  value:
                    error:
                      message: >-
                        Request body too large, please reduce the input and
                        retry
                      type: api_error
                      code: read_request_body_failed
          description: Request body too large.
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                quota_exceeded:
                  summary: Insufficient quota or rate limited
                  value:
                    error:
                      message: Insufficient account quota, please retry later
                      type: api_error
                      code: insufficient_user_quota
          description: Rate limit triggered or insufficient account quota.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                internal_error:
                  summary: Internal processing failure
                  value:
                    error:
                      message: Internal processing failed, please retry later
                      type: api_error
                      code: gen_relay_info_failed
          description: Internal server error while processing the request.
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                bad_gateway:
                  summary: Abnormal upstream response
                  value:
                    error:
                      message: The upstream provider returned an invalid response
                      type: api_error
                      code: bad_response_status_code
          description: The upstream provider returned an abnormal response.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                service_unavailable:
                  summary: Service temporarily unavailable
                  value:
                    error:
                      message: >-
                        No available channel for the current model, please retry
                        later
                      type: api_error
                      code: get_channel_failed
          description: >-
            Upstream provider temporarily unavailable, or no available channel
            for the current model.
      security:
        - BearerAuth: []
components:
  schemas:
    MiniMaxImageToImageRequest:
      type: object
      required:
        - model
        - prompt
        - subject_reference
      properties:
        model:
          type: string
          enum:
            - image-01
          description: Model name for this capability.
        prompt:
          type: string
          description: Image editing prompt.
          maxLength: 1500
        subject_reference:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/SubjectReferenceItem'
          description: >-
            Subject reference information, used to enforce character or object
            consistency in the generated result.
        aspect_ratio:
          type: string
          description: Target aspect ratio.
          enum:
            - '1:1'
            - '16:9'
            - '4:3'
            - '3:2'
            - '2:3'
            - '3:4'
            - '9:16'
            - '21:9'
        width:
          type: integer
          description: >-
            Generated image width (pixels). Only effective when model is
            image-01. Note: width and height must be set together, range [512,
            2048], and must be multiples of 8. If set together with
            aspect_ratio, aspect_ratio takes priority.
          minimum: 512
          maximum: 2048
          multipleOf: 8
        height:
          type: integer
          description: >-
            Generated image height (pixels). Only effective when model is
            image-01. Note: width and height must be set together, range [512,
            2048], and must be multiples of 8. If set together with
            aspect_ratio, aspect_ratio takes priority.
          minimum: 512
          maximum: 2048
          multipleOf: 8
        response_format:
          type: string
          enum:
            - url
            - base64
          description: >-
            Response format. Use `url` to get a temporary download link, or
            `base64` to get Base64-encoded content.
        seed:
          type: integer
          format: int64
          description: Random seed.
        'n':
          type: integer
          minimum: 1
          maximum: 9
          description: Number of images to generate.
        prompt_optimizer:
          type: boolean
          description: Whether to enable prompt optimization.
    MiniMaxImageResponse:
      type: object
      properties:
        created:
          type: integer
          format: int64
        data:
          type: array
          items:
            $ref: '#/components/schemas/MiniMaxImageData'
        metadata:
          $ref: '#/components/schemas/MiniMaxImageMetadata'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              description: >-
                Error type, e.g. `invalid_request_error`, `api_error`, or
                upstream-compatible error types.
            code:
              type: string
    SubjectReferenceItem:
      type: object
      required:
        - type
        - url
      properties:
        type:
          type: string
          description: Subject type. Currently only `character` is supported.
        url:
          type: string
          description: Reference image URL or Data URL.
    MiniMaxImageData:
      type: object
      properties:
        url:
          type: string
        b64_json:
          type: string
    MiniMaxImageMetadata:
      type: object
      properties:
        provider_request_id:
          type: string
          description: Request tracking ID returned by the upstream provider.
        provider_status_code:
          type: integer
          description: Status code returned by the upstream provider.
        provider_status_msg:
          type: string
          description: Status message returned by the upstream provider.
        success_count:
          type: integer
          description: Number of successfully generated results in this request.
        failed_count:
          type: integer
          description: Number of results not returned in this request.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Pass `Authorization: Bearer <token>` in the request header.'

````