Qwen Image 2.1 Free API: ModelScope Token, Daily Cap, and Code
ModelScope runs a free Qwen-Image-2.1 API once you bind a real-name-verified Alibaba Cloud account. At 1 credit per call, that tops out near 250 calls a day.
On this page

Yes, Qwen-Image-2.1 has a free API, and it is on ModelScope, Alibaba's open model hub where the Qwen team publishes the weights. ModelScope's API-Inference service runs the exact model Qwen/Qwen-Image-2.1 at no charge, but only after your ModelScope account is bound to an Alibaba Cloud account that has passed Alibaba's real-name verification. As of September 25, 2026, each call costs 1 of ModelScope's free daily credits, so a fully set-up account can make at most about 250 calls a day. The service is for non-commercial use only.
If you can't get through Alibaba's verification, or you need commercial rights or guaranteed throughput, the free API isn't the answer. The official Hugging Face demo, running the weights yourself, or a paid endpoint are the options, and each one has limits of its own.
Which free route fits your situation
Qwen-Image-2.1 was released as open weights on September 20, 2026. "Free" means different things depending on where you run it:
| Route | Cost | What you need | Main limits | Best for |
|---|---|---|---|---|
| ModelScope API-Inference | Free; 1 credit per call as of September 25, 2026 | ModelScope account bound to a real-name-verified Alibaba Cloud account, plus a verified email | Up to about 250 calls a day from daily credits; concurrency throttled by load; non-commercial | Scripts, prototypes, personal projects |
| Official Hugging Face Space | Free | Nothing for anonymous use | A public demo with no published quota or uptime promise; it can queue, pause, or change | Trying prompts, occasional one-off images |
| Local weights | Free software, your own hardware | Roughly a 16–24 GB NVIDIA GPU for the official int8 files, less with GGUF, or a Mac via mflux | Research license; setup time | Offline use, volume, no account |
| Paid third-party API (for example Kie) | About $0.02 per 1K image and $0.04 per 2K image on Kie as of September 25, 2026 | Vendor account and payment | Vendor terms; a "commercial use" label doesn't prove Qwen licensing | No Alibaba verification, more concurrency |
| Alibaba Cloud Model Studio | Not available | — | Lists no 2.1 model | Only relevant for Qwen-Image 2.0 and 3.0 |
The decision comes down to three questions:
- Can you complete Alibaba Cloud real-name verification? If yes, the ModelScope API is the only free, official, hosted way to call 2.1 from code. Set it up first and test the gate with a single request.
- If not, how much do you need? For a handful of images, the Hugging Face demo is enough. For regular use without an account, run the weights locally. For hosted volume without the Alibaba gate, you are paying a third party.
- Is the work commercial? Then none of the free routes cover you. ModelScope's free API is non-commercial by its own rules, and the weights ship under a research license. The commercial section below covers what that means.
You might have heard that there is no hosted 2.1 API at all. That is only half right. Alibaba Cloud Model Studio, the paid platform that sells Qwen-Image 2.0 and 3.0, does not list 2.1: its Qwen-Image API page (last updated September 22, 2026) covers qwen-image-3.0-pro, qwen-image-3.0, qwen-image-2.0-pro, qwen-image-2.0, qwen-image-max, qwen-image-plus and qwen-image. Hugging Face has no Inference Provider serving the model either. But ModelScope's own API-Inference panel on the 2.1 model page is live, and paid third-party hosts sell 2.1 endpoints.
The gate: Alibaba Cloud real-name verification
ModelScope's limits page says API-Inference runs on Alibaba Cloud compute, so "your ModelScope account must first bind to an Alibaba Cloud account," and to prevent abuse that cloud account "must have completed real-name verification" before API-Inference works. The model page's code dialog repeats the same requirement.
In practice that is four steps:
- Create a ModelScope account and log in.
- Complete your profile with a verified email address. ModelScope requires this before you can spend credits.
- Bind an Alibaba Cloud account to your ModelScope account.
- Complete real-name (identity) verification on that Alibaba Cloud account.
Step 4 decides whether the free API is open to you at all. Neither ModelScope site says which countries, which ID documents, or which type of Alibaba Cloud account (China site or international site) satisfies the requirement. Treat it as unknown until you try. Don't assume it works everywhere, and don't assume it is China-only.
Do this step before you write any code. Once the gate is open, the rest is routine.
How many images a day the free credits cover
ModelScope pays for API calls with its free compute credits. The English docs call them Magicubes, the model page's code dialog says "grain," and the Chinese site says 魔粒. They are all the same balance. As of September 25, 2026, the Qwen-Image-2.1 code dialog shows an estimated deduction of 1 credit per call, which is ModelScope's "standard model" tier. Lightweight models cost about 0.5 and flagship models about 2.
The daily grants, according to ModelScope's credit rules:
- 200 short-term credits for logging in each day after registering.
- 50 more short-term credits each day once an Alibaba Cloud account is bound.
Both are granted at most once a day, and short-term credits expire 24 hours after they are granted. Since API access already requires the bound account, the realistic daily figure is:
(200 + 50) short-term credits per day ÷ 1 credit per Qwen-Image-2.1 call = up to 250 calls per dayAdd any long-term credits you hold on top. Those last 90 days and come from one-time actions such as verifying your email (50 credits). The system spends whichever credits expire soonest first.
Treat 250 as a ceiling, not a quota:
- The balance is shared. The same credits pay for web generation on ModelScope (the "Generate Now" button on the model page), other API models, and training.
- Unused daily credits don't roll over. A quiet day doesn't bank 250 for tomorrow.
- Concurrency is throttled dynamically. ModelScope only aims to keep single-request use working, so parallel batches may be slowed or rejected even with credits left.
- Rules can change. The credit rules say they may be updated, and the per-call deduction is shown on the model page, not fixed in the docs. Check the code dialog before you budget.
Two refund rules help a little. ModelScope returns the full credit for inference tasks that fail for system reasons, and for inference tasks you cancel yourself. The rules only promise refunds for system-caused failures, so don't assume a task rejected over its prompt or parameters gets its credit back.

Get the token from the right ModelScope site
ModelScope runs two sites with the same model and the same free API:
| Site | Token page | API base URL |
|---|---|---|
| modelscope.ai (English interface) | https://modelscope.ai/my/myaccesstoken | https://api-inference.modelscope.ai/ |
| modelscope.cn (Chinese interface) | https://modelscope.cn/my/myaccesstoken | https://api-inference.modelscope.cn/ |
Most readers outside China will start on modelscope.ai. Create the access token on the site where your account and Alibaba Cloud binding live, and send it to that same site's base URL. Neither site documents whether a token from one works on the other's host, so don't mix them.
A ModelScope access token is not an Alibaba Cloud Model Studio (DashScope) API key. A Model Studio key won't authenticate on ModelScope, and it wouldn't help anyway, since Model Studio doesn't list 2.1. Its published prices for Qwen-Image 2.0 and 3.0 tell you nothing about 2.1.
Keep the token out of your code:
export MODELSCOPE_TOKEN="your-access-token"
# Only if your token comes from modelscope.cn:
export MODELSCOPE_BASE_URL="https://api-inference.modelscope.cn/"Call Qwen-Image-2.1 from Python
The API is asynchronous. You submit a job and get a task_id back right away. Then you poll that task until its status is SUCCEED or FAILED, and finally download the image from the URL in output_images.

Before writing the full script, a single request with curl tells you whether the gate is open. It spends one credit if it goes through:
curl -s "${MODELSCOPE_BASE_URL:-https://api-inference.modelscope.ai/}v1/images/generations" \
-H "Authorization: Bearer $MODELSCOPE_TOKEN" \
-H "Content-Type: application/json" \
-H "X-ModelScope-Async-Mode: true" \
-d '{"model": "Qwen/Qwen-Image-2.1", "prompt": "A golden cat on a sunny windowsill"}'A JSON response containing task_id means your token, binding and verification all work. Anything else, read the body before changing code.
The Python script below follows the official sample on the model page: the same endpoints, headers, model ID and response fields, as of September 25, 2026. The official sample polls every 5 seconds and saves a JPEG. The environment variables, request timeouts, the overall deadline, the error messages and saving as PNG (which keeps an alpha channel if the image has one) are additions. The script has not been run against a live account, so test it with one prompt before you loop over a batch.
pip install requests pillowimport os
import time
from io import BytesIO
import requests
from PIL import Image
# Token and base URL must come from the same ModelScope site.
BASE_URL = os.environ.get("MODELSCOPE_BASE_URL", "https://api-inference.modelscope.ai/")
TOKEN = os.environ["MODELSCOPE_TOKEN"]
MODEL_ID = "Qwen/Qwen-Image-2.1"
HEADERS = {
"Authorization": f"Bearer {TOKEN}",
"Content-Type": "application/json",
}
def submit(prompt: str) -> str:
resp = requests.post(
f"{BASE_URL}v1/images/generations",
headers={**HEADERS, "X-ModelScope-Async-Mode": "true"},
json={"model": MODEL_ID, "prompt": prompt},
timeout=30,
)
if not resp.ok:
raise SystemExit(f"Submit failed: HTTP {resp.status_code} {resp.text}")
return resp.json()["task_id"]
def wait_for(task_id: str, deadline_s: int = 300) -> dict:
stop = time.monotonic() + deadline_s
while time.monotonic() < stop:
resp = requests.get(
f"{BASE_URL}v1/tasks/{task_id}",
headers={**HEADERS, "X-ModelScope-Task-Type": "image_generation"},
timeout=30,
)
if not resp.ok:
raise SystemExit(f"Poll failed: HTTP {resp.status_code} {resp.text}")
data = resp.json()
status = data.get("task_status")
if status == "SUCCEED":
return data
if status == "FAILED":
raise SystemExit(f"Task {task_id} failed: {data}")
time.sleep(5)
raise SystemExit(f"Task {task_id} not finished after {deadline_s}s. Poll it again before resubmitting.")
def download(data: dict, path: str = "qwen_image_2_1.png") -> None:
resp = requests.get(data["output_images"][0], timeout=60)
resp.raise_for_status()
Image.open(BytesIO(resp.content)).save(path)
print("Saved", path)
if __name__ == "__main__":
task_id = submit("A golden cat sitting on a sunny windowsill, soft watercolor style")
print("task_id:", task_id)
download(wait_for(task_id))Keep the first requests to model and prompt. ModelScope's general API-Inference docs list extra fields for image models (negative_prompt, size, seed, steps, guidance, and image_url for editing models), but they describe them for other models. The documented size range, for example, is for the earlier Qwen-Image, not 2.1. Nothing on the 2.1 page confirms which of these the 2.1 endpoint honors, so add one at a time once the basic call works, and don't count on 2048×2048 output or transparent backgrounds through this API. The docs also note that most models work better with English prompts.
The sample also shows an optional loras field. LoRAs trained for the earlier 20B Qwen-Image won't fit the 7B 2.1 model, and it is not clear yet which 2.1-compatible LoRAs the API accepts.
When a request fails, find the stage first
Each of the three stages fails for different reasons, and the fix depends on which one stopped:
| Where it stopped | What you see | Likely cause | What to do |
|---|---|---|---|
| Submit | Error body, no task_id | Token from the other ModelScope site, a mistyped token, an Alibaba Cloud account not bound or not verified, or an unverified email | Read the body; match the token to its site's base URL; finish binding and verification |
| Submit | Error about the model | Model ID not exactly Qwen/Qwen-Image-2.1, or the model no longer on API-Inference | Copy the ID from the model page; check the panel still shows API-Inference |
| Submit, after many calls | Requests stop going through | Daily credits used up, including by web generation | Check spending details on ModelScope; wait for the next daily grant |
| Submit or poll | Rejections or slowdowns under load | Dynamic concurrency limits | Send one request at a time; retry later |
| Poll | task_status is FAILED | Not reported in the sample response. It could be a system error (credit refunded), a prompt rejected by moderation, or an unsupported parameter | Retry the same prompt once, then simplify the prompt and drop optional fields |
| Poll | No final status before your deadline | Job still queued or running; generation time isn't published | Keep polling the same task_id instead of submitting again, since a new submission is a new call |
| Download | Image URL won't load | Network issue, or the link is no longer valid | Download as soon as the task succeeds; how long the URL stays valid isn't documented |
ModelScope doesn't say what its API-Inference filters block for 2.1, so a FAILED status alone doesn't tell you the prompt was the problem. For how filtering differs between hosted and local runs, see Is Qwen-Image-2.1 Uncensored? Filters, License, and the Law.
No verification? Try it online or run it locally
The official Qwen Space at huggingface.co/spaces/Qwen/Qwen-Image-2.1 works in the browser without an account. It also exposes a Gradio API, so you can call it from Python:
pip install gradio_clientfrom gradio_client import Client
client = Client("Qwen/Qwen-Image-2.1")
result, seed, rewritten_prompt = client.predict(
input_images=[],
original_prompt="A golden cat sitting on a sunny windowsill, soft watercolor style",
api_name="/generate_with_enhance",
)
print("Image file:", result["path"])
print("Seed:", seed)
print("Prompt the demo actually used:", rewritten_prompt)The endpoint rewrites your prompt by default ("Enhance prompt," enable_extend=True) and returns the rewritten version. Pass enable_extend=False to keep your own wording. As of September 25, 2026, the Space was running and its API had not changed since September 23. It is still a demo: it publishes no quota or uptime promise, it can queue when busy, and the Qwen team can change or pause it at any time. Hugging Face may also apply its own limits to anonymous traffic. It's good for trying prompts, not for anything that has to keep working.
For regular use with no account at all, run the weights yourself. Run Qwen-Image-2.1 Locally: Which Weights Fit Your GPU or Mac matches the weight files to your GPU memory or Apple Silicon machine. Local output is still under the same research license.
If what you need is a free image API and it doesn't have to be Qwen, Free AI Image Generation API in 2026: What Is Actually Free? compares other free and free-to-test options.
Commercial use and paid endpoints
Three separate questions tend to get mixed up here:
- Is the API free of charge? On ModelScope, yes, within the credit ceiling.
- May you use the model commercially? Not through the free routes. ModelScope calls API-Inference "a non-commercial, non-profit product" and points commercial users to commercial platforms. Separately, the Qwen-Image-2.1 weights are released under the Qwen Research License, which allows research and evaluation. Commercial use needs a separate license from the Qwen team (the license names model-business@notice.qwencloud.com).
- Who owns the images you generate? The license text has no explicit clause about generated outputs. That is a question about outputs, not permission to run the model commercially.
This isn't legal advice. If the images are for a product or a client, read the license and ask the Qwen team before you build on it.
Paid third-party hosts do sell Qwen-Image-2.1 endpoints. Kie, for example, lists qwen2-1/text-to-image (plus an image-to-image variant) at 4 credits per 1K image, about $0.02, and 8 credits per 2K image, about $0.04, as of September 25, 2026. It offers new users some free starting credits without stating the amount. Its API is also task-based: you create a job, then poll it or receive a callback. Its docs list resolution (1K or 2K), a transparent background option and output_format. Muapi and RunComfy also host 2.1 as APIs or workflows; check their current pricing. These are paid services, and a vendor's "commercial use" badge doesn't show that it holds a commercial license from Qwen. Ask the vendor before you rely on it for paid work.
If the model itself is negotiable and you need a paid image API today without Alibaba's verification, laozhang.ai serves other image models through one API, for example gpt-image-2 and flux-2-pro at $0.03 per call as of September 25, 2026 (see its model list). It does not serve Qwen-Image-2.1. For how free tiers compare across providers, see Best Free AI API Provider: Pick by Limits, Data Use, and Region.
Disclosure: laozhang.ai is our own service. Its prices are platform pricing, not an independent comparison.
Quick answers
Is there a free Qwen Image 2.1 API key?
Yes, as a ModelScope access token from modelscope.ai/my/myaccesstoken (or the modelscope.cn equivalent). It only works for API-Inference after your account is bound to a real-name-verified Alibaba Cloud account.
How many images a day is it free for? At most about 250 calls a day as of September 25, 2026: 200 + 50 daily credits at 1 credit per call, plus any long-term credits. Web generation and other models draw from the same balance, and rate limits apply.
Can I try Qwen-Image-2.1 online without an account? Yes, on the official Hugging Face Space, in the browser or through its Gradio API. It is a demo with no published quota or uptime guarantee.
How much does the Qwen Image 2.0 API cost, and does that apply to 2.1? Qwen-Image 2.0 is sold on Alibaba Cloud Model Studio at Model Studio's prices, and 2.1 is not on that list. Those prices and free quotas don't carry over to 2.1.
Can I use the free API for a commercial product? No. ModelScope's free API is non-commercial, and the weights are research-licensed. Commercial use needs a separate license from the Qwen team.





