---
title: "qwen2-1-text-to-image"
method: POST
path: "/api/v1/qwen2-1-text-to-image"
tags: ["Image: Text-to-Image"]
---

# qwen2-1-text-to-image

`POST /api/v1/qwen2-1-text-to-image`

## Request

- Base URL: `https://api.muapi.ai`
- URL: `https://api.muapi.ai/api/v1/qwen2-1-text-to-image`
- Auth: one of:
  - API key in header `x-api-key`
  - OAuth 2 (client credentials, token URL `https://api.muapi.ai/oauth/token`)

Generate images from text using Qwen 2.1 (Alibaba). Input: text prompt, aspect ratio, resolution, background. Output: image. Use for: photorealistic scenes, editorial photography, on-image typography, transparent-background assets.

## Query parameters

- `webhook` string
- `team_id` integer, nullable

## Headers

- `x-api-key` string
- `x-embed-code` string, nullable
- `x-agent-embed-code` string, nullable
- `x-whitelabel-studio` string, nullable
- `authorization` string, nullable

## Request body

- Qwen21TextToImageRequest
  - `prompt` string, required: The prompt describing the image content, style, and composition to generate.
  - `aspect_ratio` '1:1' | '16:9' | '9:16' | '3:2' | '2:3' | '4:3' | '3:4' | '21:9' | '9:21', nullable: Output image aspect ratio.
  - `resolution` '1K' | '2K', nullable: Output resolution tier. 2K produces four times the pixels and takes longer.
  - `background` 'opaque' | 'transparent', nullable: Background type. Transparent outputs a PNG/WebP with an alpha channel; describe only the subject when using it.
  - `output_format` 'jpeg' | 'png' | 'webp', nullable: Output image format. JPEG has no alpha channel and cannot be combined with a transparent background.
  - `enhance_prompt` boolean, nullable: Rewrites the prompt into a fuller scene description before generating, improving quality.
  - `seed` integer, nullable: Random seed. Omit to generate with a random seed.
  - `webhook_url` string, uri, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/muapi/apis/muapi-api.md) · [All operations](https://skmtc.dev/muapi/apis/muapi-api/llms.txt) · [OpenAPI document](https://skmtc.dev/muapi/apis/muapi-api/revisions/e4b7374381e5?raw)
