メインコンテンツへ移動
画像料金は準備中API は準備中

Qwen Image 3

Generates images from English or Chinese text, with enhanced prompts and resolution up to 2K.

ドキュメントを見る
// このモデル(alibaba/qwen-image-3/text-to-image)の Orchestor API での提供は未定です。const headers = { Authorization: `Bearer ${process.env.ORCHESTOR_API_KEY}` };const submit = await fetch("https://api.orchestor.io/v1/image-router/generate", {  method: "POST",  headers: { ...headers, "Content-Type": "application/json", "Idempotency-Key": crypto.randomUUID() },  body: JSON.stringify({    "model": "<model>",    "mode": "async",    "prompt": "夕暮れの映画のようなシーン",    "resolution": "1k",    "aspect_ratio": "1:1",    "prompt_extend": "夕暮れの映画のようなシーン",    "enable_thinking": true,    "negative_prompt": "夕暮れの映画のようなシーン",    "prompt_extend_mode": "夕暮れの映画のようなシーン"  }),});const { data } = await submit.json();console.log(data.job.id, data.status_url);
$5,000 の利用で 5% キャッシュバック

登録日から 30 日ごとの利用額で、次の 30 日間の還元率が決まります。

最初の利用から開始
  1. 0%$0
  2. 5%$5K
  3. 8%$10K
  4. 12%$20K
  5. 20%$50K

Qwen Image 3 のモデル ID は alibaba/qwen-image-3/text-to-image です。Generates images from English or Chinese text, with enhanced prompts and resolution up to 2K. このモデルの Orchestor API での提供・料金は未定です。以下は Orchestor API の共通の呼び出し方です。

1. API の呼び出し

リクエストは https://api.orchestor.io に JSON で送ります。仕様は 開発ドキュメント を正とします。

ベース URL

https://api.orchestor.io/v1/image-router/generate

設定

API キーはサーバー側の環境変数に保存します。ブラウザーのコードやリポジトリには書き込みません。

export ORCHESTOR_API_KEY="<API キー>"

リクエストパラメータ

パラメータ型必須既定値説明
modelstringはい—Orchestor のモデル ID。
seedintegerいいえ—シード。Optional random seed for similar, reproducible results.。範囲: 0 – 2147483647
promptstringはい—プロンプト。Positive prompt or editing instruction in Chinese or English. Alibaba recommends at most 4,500 tokens.
resolutionstringいいえ"1k"解像度。Output resolution tier. Both tiers produce PNG images.。選択肢: 1k, 2k
aspect_ratiostringいいえ"1:1"アスペクト比。Output aspect ratio. Exact provider-recommended dimensions are selected automatically.。選択肢: 1:1, 2:3, 3:2, 3:4, 4:3, 7:9, 9:7, 9:16, 16:9, 21:9
prompt_extendbooleanいいえtrueプロンプトを拡張。Improve the prompt before generation. Required when thinking mode is enabled.
enable_thinkingbooleanいいえtrue思考モード。Use model reasoning to improve image quality. Requires prompt enhancement.
negative_promptstringいいえ—ネガティブプロンプト。Content, styles, or artifacts to avoid in the output.
prompt_extend_modestringいいえ"direct"Direct enhancement is available for every request; agent enhancement is text-to-image only.。選択肢: direct, agent
Idempotency-Keyheaderいいえ—同じ実行の二重送信を防ぐ一意なキー。

2. 認証

外部 API キーを Authorization: Bearer <API キー> または x-api-key ヘッダーで送ります。両方を同時に送ると 401 になります。

API キー

キーはサーバー側だけで扱い、ブラウザーへ渡さないでください。キーは Platform の API キー画面で発行できます。

Authorization: Bearer $ORCHESTOR_API_KEY

3. キュー

生成は非同期です。送信するとジョブ ID と status_url が返ります。状態は IN_QUEUE・IN_PROGRESS を経て、COMPLETED・FAILED・CANCELED のいずれかで終わります。

送信して待つ

const headers = { Authorization: `Bearer ${process.env.ORCHESTOR_API_KEY}` };const submit = await fetch("https://api.orchestor.io/v1/image-router/generate", {  method: "POST",  headers: { ...headers, "Content-Type": "application/json", "Idempotency-Key": crypto.randomUUID() },  body: JSON.stringify({"model":"<model>","mode":"async","prompt":"夕暮れの映画のようなシーン","resolution":"1k","aspect_ratio":"1:1","prompt_extend":"夕暮れの映画のようなシーン","enable_thinking":true,"negative_prompt":"夕暮れの映画のようなシーン","prompt_extend_mode":"夕暮れの映画のようなシーン"}),});const { data } = await submit.json(); let status = data;while (!status.terminal) {  await new Promise(resolve => setTimeout(resolve, (status.next_poll_after_seconds ?? 5) * 1000));  const response = await fetch(`https://api.orchestor.io/v1/jobs/${data.job.id}/status`, { headers });  status = (await response.json()).data;}const result = await fetch(`https://api.orchestor.io/v1/jobs/${data.job.id}/result`, { headers });console.log(await result.json());

独自のポーリング

HTTP で直接連携する場合は、/v1/jobs/<job_id>/status を next_poll_after_seconds 秒ごとに確認し、terminal が true になったら /result から結果を取得します。生成開始前のジョブは /cancel で取り消せます。ポーリングをやめるだけでは生成は止まりません。

Webhook で受け取る

ポーリングの代わりに、送信時に mode を webhook にして公開 HTTPS の webhook_url を指定できます。ジョブが COMPLETED・FAILED・CANCELED になると、通知が 1 件 POST されます。localhost やプライベートアドレス宛ては 400 になります。

{  "model": "<model>",  "mode": "webhook",  "prompt": "夕暮れの映画のようなシーン",  "resolution": "1k",  "aspect_ratio": "1:1",  "prompt_extend": "夕暮れの映画のようなシーン",  "enable_thinking": true,  "negative_prompt": "夕暮れの映画のようなシーン",  "prompt_extend_mode": "夕暮れの映画のようなシーン",  "webhook_url": "https://example.com/hooks/orchestor"}

通知は Standard Webhooks の webhook-id・webhook-timestamp・webhook-signature ヘッダーで検証します。署名シークレット(whsec_ で始まる値)は API キー画面で確認とローテーションができます。ローテーション後 24 時間は新旧両方の署名が並びます。再送でも webhook-id は変わらないので、重複の除去に使います。

import { createHmac, timingSafeEqual } from "node:crypto"; // rawBody is the request body exactly as received, before JSON parsing.export function verifyOrchestorWebhook(rawBody: string, headers: Headers, secret = process.env.ORCHESTOR_WEBHOOK_SECRET!) {  const id = headers.get("webhook-id") ?? "";  const timestamp = headers.get("webhook-timestamp") ?? "";  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;  const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");  const expected = Buffer.from(`v1,${createHmac("sha256", key).update(`${id}.${timestamp}.${rawBody}`).digest("base64")}`);  return (headers.get("webhook-signature") ?? "").split(" ").some(signature =>    signature.length === expected.length && timingSafeEqual(Buffer.from(signature), expected));}

4. このモデルの使い方

Generates images from English or Chinese text, with enhanced prompts and resolution up to 2K.

選べる解像度・長さ・参照入力は、上のリクエストパラメータで確認してください。モデルが対応しない設定は 400 になります。

5. 料金

このモデルの料金は未定です。