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

# Flux 3 Klein

> Generate or edit images with reference images and output up to 4K.

<Tip>
  1. After submission, a `task_id` will be returned. If you provided a `callback_url`, when the task status becomes `finished` or `failed`, a POST request will be sent to the `callback_url`.
  2. Regardless of whether `callback_url` is provided, you can retrieve the response result through the unified [Query Task Status](/api-manual/task-management/status) endpoint.
</Tip>

Flux 3 Klein creates images from text and edits or combines reference images. Use it for product photography, illustrations, and reference-based compositions.

## Models

* **flux-3-klein** — Text-to-image generation
* **flux-3-klein-edit** — Image editing with up to 10 references

## Features

* Generate 1–4 images per request in PNG, JPEG, or WebP.
* Choose 1K, 2K, or 4K output with an aspect ratio or exact pixel dimensions.
* Edit or combine up to 10 reference images.

## Input modes

| Mode | Model | Input |
| - | - | - |
| Text to image | `flux-3-klein` | Describe the target image in `prompt`. |
| Image editing | `flux-3-klein-edit` | Supply `prompt` and 1–10 URLs in `image_urls`. |

The generation model does not accept reference images. For editing, refer to images in their supplied order, such as “the first image”.

## Required parameters

* `prompt` (string): Non-empty description of the complete target image, including the subject, framing, background, lighting, and desired edits.
* `image_urls` (array of strings): Required for `flux-3-klein-edit` only. Supply 1–10 publicly accessible HTTP(S) reference image URLs.

## Optional parameters

* `size` (string): `1:1`, `4:3`, `3:4`, `16:9`, `9:16`, `3:2`, `2:3`, or an exact `WIDTHxHEIGHT` value. Defaults to `1:1` in both modes.
* `resolution` (string): `1K`, `2K`, or `4K`. Defaults to `1K`; custom pixel dimensions require an explicit matching value.
* `n` (integer): Number of output images, from 1 through 4. Defaults to 1.
* `output_format` (string): `png` (default), `jpeg`, or `webp`.
* `enable_safety_checker` (boolean): Enable content safety checking. Defaults to `true`.

## Size

For an aspect ratio, `resolution` sets the long edge to 1024, 2048, or 4096 pixels. The short edge follows the requested ratio and is rounded to the nearest multiple of 16.

For custom `WIDTHxHEIGHT` dimensions, each side must be 256–4096 pixels and divisible by 16. Supply `resolution` explicitly using the tier determined by the longer side:

| Longer side | Required resolution |
| - | - |
| 256–1024 pixels | `1K` |
| Above 1024 through 2048 pixels | `2K` |
| Above 2048 through 4096 pixels | `4K` |

For example, `size: "1536x1024"` requires `resolution: "2K"`.

## Examples

The OpenAPI examples include generation, reference editing, and custom dimensions.

## Notes

Keep all generation parameters inside `input`; `callback_url` belongs at the request's top level.


## OpenAPI

````yaml api-manual/image-series/flux-3-klein.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: PoYo AI - Flux 3 Klein API
  description: >-
    Generate or edit images with up to ten reference images and 1K, 2K, or 4K
    output.
  version: 1.0.0
servers:
  - url: https://api.poyo.ai
    description: Production server
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Flux 3 Klein
      summary: Submit a Flux 3 Klein task
      operationId: submitFlux3KleinTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              text-to-image:
                summary: Generate an image
                value:
                  model: flux-3-klein
                  input:
                    prompt: A red fox in fresh snow at sunrise
                    size: '3:2'
                    resolution: 2K
              edit-image:
                summary: Edit a reference image
                value:
                  model: flux-3-klein-edit
                  input:
                    prompt: >-
                      Keep the product from the first image and place it in a
                      sunlit studio
                    image_urls:
                      - https://example.com/product.png
                    size: '4:3'
                    resolution: 1K
              custom-size:
                summary: Use an exact pixel size
                value:
                  model: flux-3-klein
                  input:
                    prompt: An editorial portrait with soft window light
                    size: 1536x1024
                    resolution: 2K
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      properties:
        model:
          type: string
          enum:
            - flux-3-klein
            - flux-3-klein-edit
          description: Public model identifier.
        callback_url:
          type: string
          format: uri
          description: Webhook URL for finished or failed task notifications.
        input:
          type: object
          required:
            - prompt
          additionalProperties: false
          properties:
            prompt:
              type: string
              minLength: 1
              pattern: \S
              description: >-
                Describe the complete target image, including the subject,
                framing, background, and lighting.
            image_urls:
              type: array
              minItems: 1
              maxItems: 10
              items:
                type: string
                format: uri
                pattern: ^https?://\S+$
              description: >-
                Required for flux-3-klein-edit only. Supply 1-10 reference image
                URLs. Do not send this field for flux-3-klein.
            size:
              type: string
              default: '1:1'
              description: >-
                Output aspect ratio: 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, or 2:3; or
                exact WIDTHxHEIGHT pixels. Custom dimensions must each be
                256-4096, divisible by 16, and accompanied by an explicit
                matching resolution.
            resolution:
              type: string
              enum:
                - 1K
                - 2K
                - 4K
              default: 1K
              description: >-
                Output resolution tier. For an aspect ratio, the long edge is
                1024, 2048, or 4096 pixels and the short edge is rounded to the
                nearest multiple of 16. For custom dimensions, the long edge
                selects the tier: at most 1024 = 1K, above 1024 through 2048 =
                2K, above 2048 through 4096 = 4K.
            'n':
              type: integer
              minimum: 1
              maximum: 4
              default: 1
              description: Number of output images.
            output_format:
              type: string
              enum:
                - jpeg
                - png
                - webp
              default: png
              description: Output image format.
            enable_safety_checker:
              type: boolean
              default: true
              description: Enable content safety checking.
          description: >-
            Parameters for the selected model. Media fields are required only
            for their corresponding mode.
      description: >-
        Generate or edit images with up to ten reference images and 1K, 2K, or
        4K output.
      x-poyo-model-requests:
        $ref: '#/components/schemas/ModelRequests'
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          enum:
            - 200
          example: 200
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-unified-1792468800-example
            status:
              type: string
              enum:
                - not_started
              example: not_started
            created_time:
              type: string
              format: date-time
              example: '2026-10-20T12:00:00'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              example: Invalid request parameters
            type:
              type: string
              example: invalid_request_error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Use Authorization: Bearer PoYo_API_KEY.'

````

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