PiAPI
HomeWorkspace
HomeWorkspace
Join Discord
  1. Qwen Image
  • Get Started
    • Overview
    • Quickstart
    • Make Instruction: How to Use PiAPI to Build a Workflow on Make?
  • Endpoints
    • Seedance
      • Less-Restriction Models Guide
      • Private Asset Library
      • Seedance 2.5
      • Seedance 2
      • Video Watermark Remover
      • Get task
    • Seedream
      • Seedream 5
      • Get Task
    • Byteaudio
      • Seed-audio
      • Get Task
    • Kling
      • Lipsync With PiAPI Kling API Examples
      • Motion Brush With PiAPI Kling API Example
      • Kling Elements Video Generation API
      • Kling Effects Video Generation
      • Cancel Task
        • Cancel Task
        • Cancel Tasks
      • Get Task
      • Create Task
      • Kling Virtual Try-On
      • Kling Effects
      • Kling Sound
      • Kling Avatar
      • Kling Motion Control
      • Kling Turbo
      • Kling 3.0
    • Kling omni
      • Kling o1
      • Kling 3.0 omni
      • Get Task
    • Minimax
      • Generate Video
      • Get Task
    • Sora2
      • Sora2-preview Text to Video
      • Sora2 Text to Video
      • Sora2-Pro Text to Video
      • Sora2 Remove Watermark
      • Get task
    • Tools
      • File Upload API
      • Remove Background API
      • Remove Background-Get Task
      • Segment With Prompt API
      • Segment With Prompt API-Get Task
      • Image Upscale(Super Resolution) API
      • Image Upscale-Get Task
      • Video Upscale
      • Video Upscale-Get Task
      • Video Remove Background
      • Video Remove Background-Get task
      • Skin Tokens
      • Skin Tokens-Get task
    • Gemini
      • Gemini-2.5-flash-image
      • Nano Banana Pro
      • Nano Banana 2
      • Get task
    • GPT image
      • GPT-image API
    • LLM
      • How To Avoid Timeouts in Completion API
      • LLM API | Basic Completions
    • Omni Human
      • OmniHuman 1.5
      • Get task
    • Flux
      • Flux with LoRA and Controlnet
      • Available LoRA and Controlnet
      • Flux API with Redux Variation, Fill, Inpaint and Outpaint
      • Create Task
        • Text to Image
        • Image to Image
        • Kontext
      • Get task
    • Qwen Image
      • Text to Image
        POST
      • Image Edit
        POST
      • Get task
        GET
    • Z-Image
      • Text to Image
      • Get task
    • Faceswap
      • Multi Faceswap
      • Image Faceswap
      • Video Faceswap
      • Get Task
    • WanX
      • Generate WanX Task with LoRA Using PiAPI
      • Available LoRA Types for Wanx
      • Use Cases for Wanx LoRA
      • Use Cases for Wanx Control Camera
      • Create Task
      • Get Task
    • Wan
      • Wan2.6 Text to Video
      • Wan2.6 Image to Video
      • Get task
    • Hailuo
      • Generate Video
      • Get Task
    • Veo3
      • Veo3 Text to Video
      • Veo3 Image to Video
      • Veo3.1 Text to Video
      • Veo3.1 Image to Video
      • Get task
    • Skyreels
      • Create Task
      • Get Task
    • Framepack
      • Create Task
      • Get Task
    • Hunyuan Video
      • How to Make a Hunyuan API Call
      • Available Hunyuan Lora models
      • Get Task
      • Generate Video
    • Luma Dream Machine
      • Create Task
      • Get Task
    • Suno(service stopped)
      • Music(service stopped)
      • Lyrics(service stopped)
      • Get task
    • Song(Udio)
      • Song API Task Creation Examples
      • [Udio] Song Extend
      • Get Task
      • Create Task
      • [Udio] Generate Lyrics
    • Mmaudio
      • Get Task
      • Generate Audio
    • DiffRhythm
      • Generate Audio
      • Get Task
    • Ace Step
      • Create Task
        • Text to Audio
        • Audio to Audio
        • Audio Edit
        • Audio Extend
      • Get Task
    • TTS
      • Zeroshot Text-to-Speech F5-TTS
      • Get Task
    • Trellis
      • Trellis Create Task
      • Trellis2 Create Task
      • Get Task
    • Meshy
      • Meshy Create Task
      • Get Task
    • Pixal3D
      • Pixal3D Create Task
      • Get Task
    • Joycaption
      • Image Caption
      • Get Task
    • Midjourney
      • PiAPI Penalties on Midjourney Usage
      • Detailed Explaination on Midjourney Task Result
      • Midjourney V7 API Instructions
      • Create Task
        • Imagine
        • Upscale
        • Variation
        • Reroll
        • Describe
        • Seed
        • Blend
        • Inpaint
        • Outpaint
        • Pan
      • Cancel Task
        • Cancel Task
        • Cancel Tasks
      • Get Task
    • AI Hug
      • Get Task
      • Create Task
    • PiAPI Account Management
      • PiAPI Account Info
      • Task List Info
      • User Task History
  • Resources
    • Change Log
    • Output Storage
    • Unified API Schema
    • Webhook
    • Bulk Generation Service
    • Billings
    • PiAPI MCP Server
    • Workspace Manual
      • Host-your-account (HYA) | Back-up Account
      • Host-your-account (HYA) | Debug Checklist
      • Host-your-account (HYA) | Connected Account Status
    • Announcements
      • PiAPI 2025 January 1st Pricing Update
      • The discontinued support for midjourney
      • Sunsetting Suno
  • Schemas
    • Schemas
      • motion brush
      • Create Task
      • camera control
      • Cancel Params
      • Float2 Point
      • Control Points
      • txt2video-1.3b
      • txt2video-14b
      • txt2video-14b-lora
      • img2video-14b
      • img2video-14b-lora
      • img2video-14b-keyframe
      • img2video-14b-control-camera
      • wan22-txt2video-14b
      • wan22-img2video-14b
      • hunyuan-txt2video-lora
      • Trellis API/text-to-3D
      • Trellis API/image-to-3D
      • Trellis2 API/image-to-3D
      • Kling omni multi shot
      • VideoGenerationRequest
      • TaskRequest
      • TaskConfig
      • TaskInput
      • TaskResponse
      • ErrorResponse
    • Response
      • Unified-Task-Response
    • RequestBodies
      • Unified-Task-Request-Body
    • config
    • control_net_setting
    • lora_setting
    • VideoGenerationResponse
    • Pixal3D API/image-to-3D
  1. Qwen Image

Text to Image

POST
https://api.piapi.ai/api/v1/task
Generate an image from a text prompt with Qwen Image or Qwen Image 2.1. This endpoint creates an asynchronous task; use the returned task_id with Get task to retrieve the result.

Models and pricing#

ModelTask typePrice per imageDefault stepsMaximum steps
Qubico/qwen-image-2.1txt2img$0.015816
Qubico/qwen-imagetxt2img$0.015816
Select the matching model variant in Body Params. Existing Qwen Image clients can use 2.1 by changing model to Qubico/qwen-image-2.1; review any explicitly supplied steps and dimensions against the limits below.

Qwen Image 2.1 parameters#

Qwen Image 2.1 uses the Turbo model for every request, with 1–16 steps (default and recommended: 8). Eight steps retain the official evaluated sampling schedule. Steps 1–7 keep the existing service-defined shorter schedule. Steps 9–16 use a service-defined schedule with deterministic piecewise linear interpolation over the nine official sigma anchors, including the final zero. These custom schedules are not an officially evaluated recipe and may reduce image quality; 9–16 steps are not guaranteed to outperform the recommended 8 steps.
prompt is required. negative_prompt is accepted for request compatibility but is not applied by Turbo at any supported step count (no classifier-free guidance).
width and height default to 1024. Each dimension must be from 64 to 4096 pixels, and width * height must not exceed 1,763,584 pixels (1328 × 1328). Both constraints apply: 4096 × 64 is valid, but 4096 × 4096 is not. Invalid dimensions are rejected before credits are reserved.
steps defaults to 8 when omitted or non-positive. Use 1–16; values above 16 are capped at 16.
seed uses a random seed when omitted or non-positive. Supply a positive integer to select a seed.
flow_shift and negative_prompt are accepted for request compatibility but ignored for all 2.1 requests (Turbo uses no classifier-free guidance).
Each request generates one image; denoise is fixed at 1.
Qwen Image 2.1 supports text-to-image only. For image editing, use Qubico/qwen-image on the Image Edit endpoint.

Existing Qwen Image#

Qubico/qwen-image remains available. It keeps its default of 8 steps and maximum of 16, with an output-area limit of 1,048,576 pixels (1024 × 1024). Each dimension is 64–4096 pixels (default 1024), subject to that total-area limit: 4096 × 64 is valid, while 4096 × 4096 is not. Each model has its own parameter variant below. The legacy model also honors flow_shift values from 1 to 7; omission or null defaults to 1, values below 1 become 1, and values above 7 become 7. Set 3 explicitly if desired. negative_prompt: Accepted and encoded, but the current legacy workflow uses CFG=1, so negative_prompt does not provide classifier-free negative guidance.

Task usage#

One generated image costs 150000 points ($0.015). A newly accepted task can show these points as meta.usage.frozen; after successful completion they appear in meta.usage.consume, with no remaining frozen points for that task. An accepted pending-task cancellation releases the reserved credits without a generation charge. Omitted numeric inputs can be echoed as 0 in the task response; this does not change the generation defaults above.
At 1 step, some outputs can be heavily blurred and lose readable text. Use the default 8 steps for general use.

Request

Header Params

Body Params application/jsonRequired

Examples
{
  "model": "Qubico/qwen-image-2.1",
  "task_type": "txt2img",
  "input": {
    "prompt": "A small ceramic teapot beside a window, clean product photograph, no text",
    "width": 1024,
    "height": 1024,
    "steps": 8,
    "seed": -1
  }
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location 'https://api.piapi.ai/api/v1/task' \
--header 'X-API-Key;' \
--header 'Content-Type: application/json' \
--data '{
  "model": "Qubico/qwen-image-2.1",
  "task_type": "txt2img",
  "input": {
    "prompt": "A small ceramic teapot beside a window, clean product photograph, no text",
    "width": 1024,
    "height": 1024,
    "steps": 8,
    "seed": -1
  }
}'

Responses

🟢200Success
application/json
Bodyapplication/json

Examples
Illustrative response; task ID and output URL are placeholders.
{
  "code": 200,
  "data": {
    "task_id": "00000000-0000-4000-8000-000000000001",
    "model": "Qubico/qwen-image-2.1",
    "task_type": "txt2img",
    "status": "pending",
    "config": {
      "service_mode": "",
      "webhook_config": {
        "endpoint": "",
        "secret": ""
      }
    },
    "input": {
      "prompt": "A small ceramic teapot beside a window, clean product photograph, no text",
      "width": 1024,
      "height": 1024,
      "steps": 8,
      "seed": -1,
      "negative_prompt": ""
    },
    "output": null,
    "meta": {
      "created_at": "2026-10-12T05:31:13.737522909Z",
      "started_at": "0001-01-01T00:00:00Z",
      "ended_at": "0001-01-01T00:00:00Z",
      "usage": {
        "type": "point",
        "frozen": 150000,
        "consume": 0
      },
      "is_using_private_pool": false
    },
    "detail": null,
    "logs": [],
    "error": {
      "code": 0,
      "message": "",
      "detail": null
    }
  },
  "message": "success"
}
Modified at 2026-10-14 04:51:21
Previous
Get task
Next
Image Edit