alibaba/qwen-image-3
Alibaba's Qwen Image 3.0, in two grades.
`alibaba/qwen-image-3` is the standard one at a flat rate whatever the size; `alibaba/qwen-image-3-pro` renders finer text and complex layouts and is priced by tier, so a 2K image costs more than a 1K one.
Both take the same parameters.
The one to know about is `prompt_extend`: the generator rewrites your prompt by default.
| Slug | alibaba/qwen-image-3 |
| Kind | image |
| Vendor | alibaba |
| Endpoint | POST /v1/alibaba/generations |
Charged per job from what the generator reports it rendered — your Logs show the exact figure for each one; see balance and billing.
Calling it
curl https://api.sociaro.com/v1/alibaba/generations \
-H "Authorization: Bearer $SOCIARO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "alibaba/qwen-image-3",
"prompt": "a paper boat on a rain-soaked street"
}'
# then poll the job id it returns:
curl https://api.sociaro.com/v1/alibaba/generations/JOB_ID \
-H "Authorization: Bearer $SOCIARO_API_KEY"Parameters
Qwen Image 3.0 — text to image, with the prompt taken literally if you ask
| Field | Type | Required | Default | Values | What it does |
|---|---|---|---|---|---|
prompt | string | yes | — | text | What to generate. Long prompts are fine — this family reads about a thousand tokens of them. |
size | string | no | the generator picks | "width*height", e.g. 1328*1328 | Asked for and honoured exactly: request `1328*1328` and that is what comes back. Left out, the generator chooses for you and tends toward its 2K tier. What you are charged follows the tier the generator SAYS it produced, not the number you sent. |
n | integer | no | 1 | 1–6 | How many images. You are charged for the number the generator reports making, and every one of them comes back in the poll's `media_urls` (`media_url` is the first). On the Jobs API (`/v2`) `n` is refused (one image per job there; `output.count` is at most 1), and so is a `parameters` object inside `input` (send generator fields directly in `input`). |
negative_prompt | string | no | — | text | What to keep out — "blurry", "extra fingers". Useful when a prompt keeps producing the same unwanted thing. |
prompt_extend | boolean | no | true (the generator's own default) | true · false | The generator REWRITES your prompt before drawing, which usually helps a short prompt and can undo a carefully worded one. It adds three to five seconds. Send `false` when you want your wording taken literally. |
seed | integer | no | random | 0 – 2147483647 | The same seed with the same prompt and size reproduces the same image, which is how you iterate on one composition instead of rerolling it. |
watermark | boolean | no | false here | true · false | Adds the generator's own mark in the corner. Its default is on; ours is off. |
image_urls | string[] | no | — | 1–3 public https urls | Turns the request into an EDIT of the pictures you send. On the submit-and-poll door only — the Jobs API (`/v2`) refuses an input image for now and answers `unsupported_input`. Order is what the prompt means by "image 1", "image 2" — it is preserved exactly. A fourth image is refused, and so is a model that cannot edit, rather than being quietly dropped. |
prompt_extend_mode | string | no | direct | direct · agent | How the rewrite works when `prompt_extend` is on. `agent` rewrites more thoroughly but is TEXT-TO-IMAGE ONLY — send it together with `image_urls` and the generator returns a 400. |
enable_thinking | boolean | no | true (the generator's own default) | true · false | Lets the model reason before drawing, which improves the picture and lengthens the wait. It needs `prompt_extend` on, and it is not supported for an edit that also uses `agent`. |
Anything not listed here is refused rather than ignored, so a typo fails loudly instead of quietly producing something else.
Worked example
# text to image, prompt taken literally
curl https://api.sociaro.com/v1/alibaba/generations \
-H "Authorization: Bearer $SOCIARO_API_KEY" -H "Content-Type: application/json" \
-d '{ "model": "alibaba/qwen-image-3",
"prompt": "a paper boat on wet asphalt, neon reflections",
"size": "1328*1328", "prompt_extend": false }'
# then poll until it is done
curl https://api.sociaro.com/v1/alibaba/generations/{job_id} \
-H "Authorization: Bearer $SOCIARO_API_KEY"Submit and poll — this model is not on /v1/images/generations. Send it to
POST /v1/alibaba/generations and poll GET /v1/alibaba/generations/{job_id}; the finished
picture arrives as a media_url on our own domain (with n above 1, media_urls lists every
picture and media_url is the first). The same model is also on the Jobs API as
POST /v2/jobs, which gives you one envelope for every async model — see Jobs API.
prompt_extend is on unless you turn it off. The generator expands short prompts into longer
ones before drawing. That is usually an improvement when you wrote a few words, and usually not
what you want when you wrote a paragraph you care about. Turning it off also removes three to
five seconds.
Size is a request, price is a report. You may ask for any width*height. What you pay
follows the tier the generator says it produced — for alibaba/qwen-image-3-pro the 1K and 2K
tiers genuinely cost different amounts. Above those tiers no rate is published, so such a result is
NOT delivered and NOT charged — it is held back rather than handed over at a price we
would have had to invent. Stay within 2K and this never arises.
Editing. Send one to three pictures in image_urls along with an instruction and the model
edits them instead of drawing from scratch. Refer to them by position — "the woman in image 1
wearing the jacket from image 2" — because that is how the generator numbers them. Input pictures
are charged as a small separate line beside the output image. A model that cannot edit refuses
the field outright rather than ignoring it and billing you for an ordinary generation.
Pro is not just "better". It is the one to reach for when the image carries small text or a complicated layout; for an ordinary picture the standard grade costs less and is quicker.
How a job runs
Generation takes longer than a request should wait, so it goes in three moves: submit, then poll, then collect.
# 1. submit — the model id plus the fields above
curl -sS https://api.sociaro.com/v1/spicy/generations \
-H "Authorization: Bearer $SOCIARO_API_KEY" -H "Content-Type: application/json" \
-d '{ "model": "…", "prompt": "…" }'
# -> { "job_id": "<id>", "status": "submitted" }
# 2. poll every 3-5 s for images, 5-10 s for video
curl -sS https://api.sociaro.com/v1/spicy/generations/<id> \
-H "Authorization: Bearer $SOCIARO_API_KEY"
# -> { "job_id": "…", "status": "processing" }
# -> { "job_id": "…", "status": "completed", "model": "…",
# "media_url": "https://api.sociaro.com/v1/media/<media_id>" }
# -> { "job_id": "…", "status": "failed", "model": "…", "error": { "code": …, "message": … } }
# 3. collect within the hour — the opaque id IS the credential, no header needed
curl -sSL "https://api.sociaro.com/v1/media/<media_id>" -o out.mp4
Use the job_id verbatim as the path segment when polling: the two names are the same value.
Which submit and poll URL this model uses is at the top of this page, under Calling it.
Reading the poll
status is one of processing · completed · failed. Only completed carries media_url,
only failed carries error.
Gate on status, never on the poll's HTTP code. A poll-time failure is HTTP 200 with
status: "failed" and an error object of { "code", "message" }, plus provider_code when the
generator supplied one — on every failure branch, including one where the result could not be
delivered. A submit-time rejection is different: it comes back as its own HTTP status with the
reason in the body.
code is ours and stable; message is the generator's. Match on code: it comes from a small
fixed set, and provider_failed still means what it always meant. A rejection of what you sent —
a size out of range, an unusable input — additionally sets code: "invalid_request", because that is
a different thing for your code to do. message now carries the generator's own sentence, and
provider_code its own code (OutputVideoSensitiveContentDetected.PolicyViolation,
IPInfringementSuspect), so a moderated generation, a copyright refusal and a broken renderer are
finally distinguishable. Treat provider_code as informational: the vendors change these strings
without telling us, so branch on ours.
message is variable text, capped at 400 characters. It used to be a single fixed
43-character sentence, so if you compare it by equality or keep it in a narrower column, that needs
changing — match on code, and on provider_code when you need the finer distinction.
Two things that text is not. It does not name the generator behind the model: the names of the
services and hosts that actually run your job are substituted out before you see it, so do not parse
it for one. What it does not hide is a name you already have — the halves of the model id you
called (alibaba, bytedance, wan, qwen, seedance, seedream, happyhorse) stay as written,
because blanking those would garble the message exactly where it is useful: Model
alibaba/wan-2-7-image not found has to survive intact. And the text can quote your own request
back: a moderation message often contains the fragment it objected to. That is why we do not write
it into our own logs, and why forwarding or storing a failed poll's message is your decision to
make rather than something to do by default.
Collecting the result
media_url points at our host, not the generator's. It is a capability: the opaque id is the
credential, so no Authorization header is needed and anyone holding the link can fetch it. It
expires within the hour — download rather than store the link.
A job that asked for a second asset gets one beside the first on the same terms: Seedance's
return_last_frame arrives as last_frame_url, a decomposition's layers as layers[]. Treat
them as optional: they appear when you asked, the generator returned one, and the link passes the
same delivery check the main asset passed. If it does not, we omit the field rather than hand you
a link /v1/media would refuse — and the main asset is unaffected.
/v2 jobs do not return the Seedance still yet: return_last_frame is accepted there, but the
closing frame is not delivered, so a /v2 job's result carries the clip alone. Use /v1 when you
need the still.
Several images are not optional extras. An Alibaba image model asked for more than one picture
(n above 1) is charged for the number of pictures the generator reports making, and every link it
returns is delivered, never fewer than that number: media_urls lists
all of them in the generator's order (present on every image result, even a single one) and
media_url is the first. Each has its own link and its own expiry. If any one of them cannot be
delivered the job is reported failed and nothing is charged — unlike a still or a layer, an
image you paid for is never left out.
Rules the gateway adds
Two fields are ours and never reach the generator:
| Field | Notes |
|---|---|
model |
which model to run |
user |
your own end-user id. Recorded against this job's spend so you can attribute cost per end user, and stripped before the request leaves us, so the generator never sees it. Validated BEFORE the job is created, so a rejection is free: a string of at most 128 characters, no control characters, valid UTF-8. Omitting it, or sending null, is fine and simply records no end user |
An unknown field is always a 400. Most generators reject one themselves; some accept it,
ignore it, render something other than what you asked for and bill you — so we refuse it for you.
Either way you get 400 unknown field(s): [...] naming the offender, never a surprise render.
Ranges and enums are the generator's own and we do not re-validate most of them, so an
out-of-range value comes back as its rejection, in its wording and with its numbers. The one thing
we DO check ourselves is resolution, because an unsupported tier is silently ignored rather than
refused: you would ask for the higher tier, be handed a lower one, and be charged. The tiers on
this page are read from what the vendor prices, so they change when the vendor publishes one.
Authentication
Authorization: Bearer <your-api-key> on submit and on poll. The key must be valid AND granted
this model — 403 otherwise.
One deliberate exception on poll: a key that is over budget may still poll and collect a job it already submitted, so work you have already paid for is never stranded by a budget that ran out mid-generation. While the key is over budget the gateway cannot read its model list at all, so the per-model grant is not re-checked on those polls — a grant revoked after submit still collects that job. Ownership is always enforced: a job can only be polled by the key that created it, and submit is always refused in that state.