# Qwen Image 2.1 Turbo API on MLMux

> Alibaba Qwen Image 2.1 Turbo for fast, low-cost text-to-image generation and image editing.

- Model page: https://www.mlmux.com/qwen/qwen-image-2.1-turbo
- API model ID: `qwen/qwen-image-2.1-turbo`
- Provider: Alibaba
- Generation modes: Text to image, Image editing
- Endpoint: `POST https://api.mlmux.com/v1/images/generations`; edits with reference images use `POST https://api.mlmux.com/v1/images/edits`
- Reference images: up to 3
- Resolutions: 1K, 2K
- Aspect ratios: 1:1, 16:9, 9:16, 4:3, 3:4
- Output formats: png

## Pricing

Pay as you go in credits; 1 credit = 1 US dollar, with no subscription. `official-cheap` is the default route.

- Every image: $0.015 on `official`, $0.014 on `official-cheap`, at any resolution it supports

## Request

Send your API key as `Authorization: Bearer $MLMUX_API_KEY`. Create keys at https://www.mlmux.com/console/api-keys.

```bash
curl https://api.mlmux.com/v1/images/generations \
  -H "Authorization: Bearer $MLMUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen/qwen-image-2.1-turbo",
  "route_mode": "official-cheap",
  "prompt": "A red fox in fresh snow at sunrise, cinematic light",
  "size": "1024x1024",
  "output_format": "png",
  "n": 1
}'
```

```python
import os
import requests

headers = {"Authorization": f"Bearer {os.environ['MLMUX_API_KEY']}"}
response = requests.post(
    "https://api.mlmux.com/v1/images/generations",
    headers=headers,
    json={
      "model": "qwen/qwen-image-2.1-turbo",
      "route_mode": "official-cheap",
      "prompt": "A red fox in fresh snow at sunrise, cinematic light",
      "size": "1024x1024",
      "output_format": "png",
      "n": 1
    },
    timeout=300,
)
response.raise_for_status()
print(response.json()["data"][0]["url"])
```

The response contains the generated image URLs. Add `"async": true` to get a task to poll instead.

## Frequently asked questions

### What is Qwen Image 2.1 Turbo?

Qwen Image 2.1 Turbo is an image generation model from Alibaba. On MLMux you can run it in the browser or call it through one API. Alibaba Qwen Image 2.1 Turbo for fast, low-cost text-to-image generation and image editing.

### How do I use the Qwen Image 2.1 Turbo API?

Create an API key in the MLMux Console, then send a POST request to https://api.mlmux.com/v1/images/generations with the key in the Authorization header and model set to qwen/qwen-image-2.1-turbo. The generated images are returned in the response.

### What can Qwen Image 2.1 Turbo do?

Generation modes: Text to image and Image editing. Each request accepts up to 3 reference images and returns 1K or 2K images in aspect ratios such as 1:1, 16:9, 9:16, 4:3, and 3:4.

### How much does Qwen Image 2.1 Turbo cost?

MLMux is pay as you go, with no subscription or monthly fee, and 1 credit equals 1 US dollar. Every Qwen Image 2.1 Turbo image costs $0.014 on the default official-cheap route and $0.015 on the official route, at any resolution it supports. The prices are also listed in the pricing section of this page.

### Can I try Qwen Image 2.1 Turbo without writing code?

Yes. Sign in and use the playground at the top of this page to run Qwen Image 2.1 Turbo with the same settings as the API. The playground's code views show the matching request for your settings, and the quick start below has copy-paste examples in cURL, Python, and JavaScript.

## More

- Image API guide: https://www.mlmux.com/docs/images
- Pricing for every model: https://www.mlmux.com/pricing
- All models: https://www.mlmux.com/llms.txt
