> ## 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 Text to Image

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

Exposed fields: `model`, `prompt`, `aspect_ratio`, `width`, `height`, `response_format`, `seed`, `n`, `prompt_optimizer`.



## OpenAPI

````yaml api-reference/en/zmodelImage/minimax/image01-text-to-image.json POST /v1/images/generations
openapi: 3.0.1
info:
  title: Image-01 text-to-image
  version: 1.0.0
  description: >-
    Image-01 text-to-image capability documentation. The unified API endpoint is
    `/v1/images/generations`, used for generating images from text prompts.
  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 generation capability
paths:
  /v1/images/generations:
    post:
      tags:
        - Image Generation
      summary: Image-01 text-to-image
      description: >-
        Text-to-image capability for the `image-01` model.


        Exposed fields: `model`, `prompt`, `aspect_ratio`, `width`, `height`,
        `response_format`, `seed`, `n`, `prompt_optimizer`.
      operationId: minimaxTextToImage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MiniMaxTextToImageRequest'
            examples:
              basic_request:
                summary: Basic request
                value:
                  model: image-01
                  prompt: A cinematic sunrise over a calm harbor
                  aspect_ratio: '16:9'
                  response_format: base64
                  seed: 0
                  'n': 1
                  prompt_optimizer: false
      responses:
        '200':
          description: Success. Returns the unified image response structure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MiniMaxImageResponse'
        '400':
          description: Invalid request parameters.
          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:
    MiniMaxTextToImageRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          enum:
            - image-01
          description: Model name for this capability.
        prompt:
          type: string
          description: Image generation prompt.
          maxLength: 1500
        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. Explicitly passing `0` will be preserved.
        'n':
          type: integer
          minimum: 1
          maximum: 9
          description: Number of images to generate.
        prompt_optimizer:
          type: boolean
          description: >-
            Whether to enable prompt optimization. Explicitly passing `false`
            will be preserved.
    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
    MiniMaxImageData:
      type: object
      properties:
        url:
          type: string
          description: >-
            Image download URL. Typically a temporary link; please save
            promptly.
        b64_json:
          type: string
          description: Base64-encoded image content.
    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.'

````