API reference · Alibaba

alibaba/qwen-image-2/pro/text-to-image

Integrate this model through SandBase's unified API, with production-ready schemas and examples.

IMAGEAsyncOpen model
Production endpoint

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

POSThttps://api.sandbase.ai/v1/run
Model IDalibaba/qwen-image-2/pro/text-to-image
01

Input Schema

4 parameters · 1 required · 3 optional

ParameterTypeRequiredDescription
promptstringRequiredText prompt describing the desired image. Supports Chinese and English;. · Min length: 1
seedintegerOptionalRandom seed for reproducibility (0-2147483647).
aspect_ratiostringOptionalThe aspect ratio of the generated image. · Options: 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16
21:916:93:24:35:41:14:53:42:39:16
output_formatstringOptionalThe format of the generated image. · Options: jpeg, png · Default: "png"
jpegpng
02

Output Schema

FieldTypeDescription
idstringUnique identifier for the generation task
statusstringTask status: pending, running, completed, failed, timeout
modelstringModel used for the generation
outputsarrayArray of output items
outputs[].urlstringURL of the generated artifact
outputs[].content_typestringMIME type (e.g. image/png, video/mp4)
errorobject | nullError details if failed, null on success
error.typestringMachine-readable error type code
error.messagestringHuman-readable error description

Async Workflow

This model uses asynchronous execution. Submit a request and poll for the result.

  1. Submit — POST to /v1/run, receive an id
  2. Poll — GET /v1/run/{id} until status is completed, failed, or timeout
  3. Retrieve — Read outputs from the completed response
03

Code Examples

Ready-to-run snippets

# Step 1: Submit
curl -X POST https://api.sandbase.ai/v1/run \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "model": "alibaba/qwen-image-2/pro/text-to-image",
  "prompt": "# 1930s Luxury Automobile Manufacturing – 11-Stage Infographic\n## LAYOUT\n- 3 rows, flowchart with arrows left→right, curving down between rows\n- Row 1: Stages 1–3 | Row 2: Stages 4–6 | Row 3: Stages 7–11\n- Style: hand-drawn sketch, watercolor coloring. Car color: deep burgundy/cream accents\n- Car style: 1930s grand tourer (long hood, flowing fenders, wire wheels, art deco chrome)\n---\n## ROW 1\n### STAGE 1 – DESIGN & COACHBUILDING PLANNING\n- Isometric design studio with wooden drafting tables\n- 3 designers in waistcoats: one drawing side-profile with French curves, one sculpting a cream clay scale model on turntable, one reviewing a full-size blueprint on wall\n- Art Deco posters on walls, inkwells, callipers, blackboard with chassis dimensions\n### STAGE 2 – SUPPLY CHAIN & RAW MATERIALS\n- Components spread out with label lines:\n  - **STEEL INGOTS & BILLETS** – dark gray blocks, warm foundry glow\n  - **ALUMINUM SHEETS** – silver sheets on wooden pallet\n  - **ASH WOOD TIMBER** – honey-brown planks bundled (for body frame)\n  - **LEATHER HIDES** – rolled cognac-brown full-grain hides\n  - **WIRE SPOKES & HUB CASTINGS** – bundled steel spokes, gray castings\n  - **GLASS PANES** – transparent sheets in straw-packed crates\n  - **CHROME & BRASS FITTINGS** – shiny strips, handles, hood ornament blanks\n- Background: foundry/tannery silhouettes with smoking chimneys\n### STAGE 3 – PART FABRICATION (METALWORK & WOODWORK)\nTwo bordered sub-boxes:\n**Top – \"METALWORK & FORGING\":**\nSteel billets → **DROP FORGE** (hammer press, glowing orange part) → **PRECISION LATHE** (belt-driven, machinist in flat cap) → **HAND GAUGING** (micrometers, go/no-go gauges on wooden bench)\n**Bottom – \"COACHWORK FRAME & PANEL BEATING\":**\n**ASH CUTTING** (bandsaw, sawdust) → **FRAME JIG ASSEMBLY** (skeletal wooden body on jig, car shape visible) → **HAND PANEL BEATING** (craftsman hammering aluminum over wooden buck) → **ENGLISH WHEEL** (rolling panel for smooth curves)\n---\n## ROW 2\n### STAGE 4 – CHASSIS & MECHANICAL ASSEMBLY\n- **LADDER CHASSIS** – dark steel twin rails + cross-members on trestles, riveted. Workers fitting braces\n- **FRONT AXLE & LEAF SPRINGS** – beam axle with semi-elliptic springs, worker with wrench\n- **REAR AXLE & DIFFERENTIAL** – live axle with pumpkin-shaped housing\n- **DRUM BRAKES** – cable-operated assemblies at each wheel position\n- **STEERING GEARBOX** – worm-and-sector box, drag link to front axle\n### STAGE 5 – ENGINE BUILDING & INSTALLATION\n- Left: **ENGINE BENCH** – inline-8 block (dark green/gray), forged crankshaft being lowered in, pistons in a row, twin brass carburetors, magneto ignition, cylinder head being torqued. Oil cans, rags, hand tools\n- Right: **ENGINE DROP-IN** – completed engine lowered by chain hoist on A-frame crane into chassis. Two workers guiding. Transmission bell housing visible\n### STAGE 6 – BODY MOUNTING\n- Bare aluminum body shell (silver, on wooden frame) lowered by overhead gantry onto rolling chassis\n- 4–5 workers guiding body down. Red alignment lines between mount points\n- Labels: \"Body mount bolts\", \"Firewall alignment\", \"Running board brackets\"\n- Full car silhouette now recognizable: long hood, set-back cabin, swept tail\n---\n## ROW 3\n### STAGE 7 – PAINTING & FINISHING\n- Painter in white coveralls spraying with gun: gray primer on rear half, deep burgundy lacquer on front half\n- Second worker wet-sanding between coats\n- Labels: \"Lead filler & primer\", \"Nitrocellulose lacquer\", \"Hand rubbing & polishing\"\n### STAGE 8 – INTERIOR TRIMMING\n- Cabin cutaway showing: hand-stitched diamond-tufted cognac leather seats, burled walnut dashboard with round gauge holes and chrome bezels, leather door panels with chrome cranks, dark maroon wool carpet, cream cloth headliner\n### STAGE 9 – CHROME & BRIGHTWORK\n- Vignettes: chrome bumpers bolted on, art deco hood ornament (leaping figurine) on radiator cap, round chrome headlamps on fenders, tall vertical-bar radiator grille, trim strips and door handles. Worker polishing fender to mirror shine\n### STAGE 10 – MECHANICAL TESTING\n- Completed burgundy car with cream fenders and full chrome\n- Labels: \"Ignition timing & carburetor tuning\" (mechanic with timing light), \"Brake balance test\", \"Wheel alignment\" (string method), \"Electrical check\" (lights glowing), \"Fluid fill & leak check\"\n- Handwritten checklist on clipboard resting on fender\n### STAGE 11 – ROAD TEST & DELIVERY\n- Left: car in motion on country road, dust trail, driver in goggles/leather cap. Green hills in watercolor background\n- Right: car at Art Deco showroom entrance. Factory director in three-piece suit, client in top hat receiving leather key fob, chauffeur in uniform by driver's door\n---\n## STYLE GUIDE\n- **Colors:** Burgundy body (#6B1024), cream accents (#F5E6C8), dark steel chassis, silver aluminum, honey-brown ash wood, cognac leather, bright chrome highlights\n- **Typography:** Bold uppercase sans-serif titles (\"STAGE [#] – [NAME]\"), smaller labels with thin connector lines\n- **Style:** Ink outlines, watercolor flat fill, isometric/3/4 view, period-correct details (belt-driven machines, chain hoists, flat caps, Art Deco flourishes)\n- **Arrows:** Thin black, left→right, curving down between rows\n- **Proportions:** Landscape ~3:1, 3 equal rows, Stage 3 taller, Row 3 has 5 narrower stages",
  "output_format": "png"
}'

# Step 2: Poll result (replace <id>)
curl https://api.sandbase.ai/v1/run/<id> \
  -H "Authorization: Bearer YOUR_API_KEY"