Use Qwen 2 Image in OpenClaw.
Qwen 2 Image is Alibaba's image generation and editing model. OpenClaw agents call it through the same RunAPI endpoint used for chat — send a prompt, get an image URL. Supports text-to-image, image editing, and image remixing through three model variants.
Use RunAPI to generate an image with Qwen 2 Image.
Requirements:
- Call the RunAPI text_to_image endpoint at https://runapi.ai/api/v1/task/text_to_image.
- Set the model to "qwen-2-text-to-image".
- Read the API key from the RUNAPI_API_KEY environment variable.
- The response returns a task_id. Poll the task status endpoint until the task completes, then retrieve the image URL from the output.
- For image editing, use model "qwen-2-edit-image" and include an image_url field.
- For remixing, use model "qwen-2-remix-image" and include an image_url field.
curl -X POST https://runapi.ai/api/v1/task/text_to_image \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-2-text-to-image",
"prompt": "A traditional Chinese ink painting of misty mountains at dawn, elegant brushwork"
}'
{
"task_id": "tsk_abc123",
"status": "pending",
"model": "qwen-2-text-to-image"
}
Use Qwen 2 Image in OpenClaw in three steps
Configure RunAPI
Set your RunAPI API key as an environment variable. If you have not added RunAPI as an OpenClaw provider yet, follow the OpenClaw setup guide first.
export RUNAPI_API_KEY=runapi_xxx
Call Qwen 2 Image
Paste the prompt into OpenClaw or call the text_to_image endpoint directly. Set the model field to qwen-2-text-to-image for generation, qwen-2-edit-image for editing, or qwen-2-remix-image for remixing.
text_to_image
Get the result
The endpoint returns a task ID. Poll the task status endpoint until the status changes to completed, then read the image URL from the output. RunAPI SDKs handle polling automatically.
task_id: tsk_abc123
Qwen 2 Image API parameters
| Parameter | Type | Description |
|---|---|---|
model |
string |
Required. qwen-2-text-to-image, qwen-2-edit-image, or qwen-2-remix-image. |
prompt |
string |
Text description or editing instruction. |
image_url |
string |
Source image for edit or remix mode. |
size |
string |
Optional. Output dimensions. |
What is Qwen 2 Image on OpenClaw?
Qwen 2 Image is Alibaba's image model that covers generation, editing, and remixing through one API. It is strong at multilingual prompt understanding (especially Chinese and English), handles complex multi-object scenes well, and supports instruction-based editing where you describe what to change in natural language. OpenClaw agents call all three modes through the same RunAPI endpoint.
Qwen 2 Image use cases
Multilingual marketing campaigns
Generate images from prompts written in Chinese, English, or mixed-language text for bilingual marketing materials without translating prompts first.
Instruction-based image editing
Modify existing images by describing the change in plain language -- swap backgrounds, add objects, adjust lighting, or remove elements without opening an editor.
Fine-tuning open-weight models for specific domains
Use Qwen 2 Image outputs as training data or baselines when fine-tuning open-weight Qwen models for domain-specific image tasks like product catalogs or branded content.
Qwen 2 Image + OpenClaw questions
Yes. OpenClaw supports custom OpenAI-compatible providers. Add RunAPI with baseUrl https://runapi.ai/v1 and your RUNAPI_API_KEY, then call the text_to_image endpoint with model set to qwen-2-text-to-image. The same provider handles chat and image generation.
Qwen 2 Image has native multilingual support from Alibaba's Qwen architecture, so it understands Chinese prompts without translation. Other models often require English prompts for best results. If your workflow involves Chinese text or bilingual content, Qwen 2 is a strong choice.
Async. The endpoint returns a task ID immediately. Poll the task status endpoint or use a webhook callback to know when the image is ready. RunAPI SDKs and the CLI handle polling automatically.
Qwen 2 Image uses per-task billing. Check the RunAPI pricing page for current rates. There is no monthly subscription or minimum spend -- you pay only for completed generations.
OpenClaw general setup
Not configured yet? Start with the RunAPI setup guide for OpenClaw.
OpenClaw setup guide →Qwen 2 Image model catalog
See all Qwen 2 Image variants, pricing, and API docs.
Qwen 2 Image models →Try Qwen 2 Image in OpenClaw today.
Get a free RunAPI key, paste the prompt into OpenClaw, and start generating.