curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen-image-3.0",
"prompt": "雲海の上にある古都、金色の朝日、映画ポスターの構図、読みやすい日本語タイトル",
"size": "16:9",
"resolution": "2K",
"n": 1,
"metadata": {
"prompt_extend": true,
"negative_prompt": "ぼやけ、低品質、文字化け",
"watermark": false
}
}'
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen-image-3.0-pro",
"prompt": "1 枚目の人物と 2 枚目の衣装を維持し、現代的な雑誌表紙にしてください",
"image_urls": [
"https://example.com/person.png",
"https://example.com/outfit.png"
],
"size": "3:4",
"resolution": "2K",
"n": 1
}'
{
"id": "<string>",
"object": "<string>",
"model": "<string>",
"status": "<string>",
"progress": 123,
"created_at": 123
}Qwen Image 3.0
Qwen Image 3.0 画像生成
qwen-image-3.0 または qwen-image-3.0-pro で画像を生成します
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen-image-3.0",
"prompt": "雲海の上にある古都、金色の朝日、映画ポスターの構図、読みやすい日本語タイトル",
"size": "16:9",
"resolution": "2K",
"n": 1,
"metadata": {
"prompt_extend": true,
"negative_prompt": "ぼやけ、低品質、文字化け",
"watermark": false
}
}'
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen-image-3.0-pro",
"prompt": "1 枚目の人物と 2 枚目の衣装を維持し、現代的な雑誌表紙にしてください",
"image_urls": [
"https://example.com/person.png",
"https://example.com/outfit.png"
],
"size": "3:4",
"resolution": "2K",
"n": 1
}'
{
"id": "<string>",
"object": "<string>",
"model": "<string>",
"status": "<string>",
"progress": 123,
"created_at": 123
}中国本土のユーザー向け: 中国本土のユーザーは
https://toapis.cn を API エンドポイント(Base URL)としてご利用ください。本ドキュメント内の例では https://toapis.com を https://toapis.cn に置き換えてください。qwen-image-3.0とqwen-image-3.0-proに対応- テキストからの画像生成、画像編集、複数参照画像に対応
- 参照画像は最大 3 枚
- 1K / 2K と 7 種類のアスペクト比に対応
- 1 リクエストにつき 1 枚のみ生成。
nは1に固定 - 非同期タスクとして実行し、タスク ID で結果を取得
image_urls は公開アクセス可能な画像 URL のみ対応します。base64 Data URI は使用できません。ローカル画像は先に画像アップロード APIでアップロードしてください。対応モデル
| モデル | テキストから画像 | 画像から画像 | 参照画像 | 出力 |
|---|---|---|---|---|
qwen-image-3.0 | 対応 | 対応 | 最大 3 枚 | 1 枚固定 |
qwen-image-3.0-pro | 対応 | 対応 | 最大 3 枚 | 1 枚固定 |
Authorizations
string
必須
すべての API は Bearer Token 認証が必要です。API Key 管理ページでキーを取得し、次のヘッダーを送信します。
Authorization: Bearer YOUR_API_KEY
Body
string
必須
モデル名。使用できる値は次の 2 つです。
qwen-image-3.0qwen-image-3.0-pro
string
必須
画像の説明または編集指示。空文字列は指定できません。
string
出力画像のアスペクト比:
1:1、4:3、3:4、16:9、9:16、3:2、2:3WIDTH*HEIGHT または WIDTHxHEIGHT のピクセル指定も使用できます。総ピクセル数は 512*512 から 2048*2048、アスペクト比は 1:8 から 8:1 の範囲にしてください。省略時はモデルがサイズを選択します。string
デフォルト:"1K"
size にアスペクト比を指定した場合の解像度:1K- デフォルト2K
metadata.resolution も使用できますが、トップレベルの指定を推奨します。integer
デフォルト:1
生成枚数。
1 に固定されています。2 以上を指定すると 400 invalid_request になります。string[]
画像編集、画像から画像、複数参照に使用する画像 URL の配列です。
- 最大 3 枚
- URL のみ対応。base64 は非対応
- ローカル画像は画像アップロード APIを使用
string
注文 ID など、クライアント側の業務 ID。指定すると同じステータス API でこの ID を使って照会できます。
object
解像度とピクセルサイズ
アスペクト比を指定した場合、両モデルで次のピクセルサイズに変換されます。| 比率 | 1K | 2K |
|---|---|---|
1:1 | 1024×1024 | 2048×2048 |
4:3 | 1152×864 | 1600×1200 |
3:4 | 864×1152 | 1200×1600 |
16:9 | 1280×720 | 1920×1080 |
9:16 | 720×1280 | 1080×1920 |
3:2 | 1152×768 | 1728×1152 |
2:3 | 768×1152 | 1152×1728 |
Response
string
ステータス照会に使用するタスク ID。
string
常に
generation.task。string
使用したモデル。
string
queued、in_progress、completed、failed。integer
0 から 100 の進捗率。
integer
Unix タイムスタンプの作成時刻。
リクエスト例
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen-image-3.0",
"prompt": "雲海の上にある古都、金色の朝日、映画ポスターの構図、読みやすい日本語タイトル",
"size": "16:9",
"resolution": "2K",
"n": 1,
"metadata": {
"prompt_extend": true,
"negative_prompt": "ぼやけ、低品質、文字化け",
"watermark": false
}
}'
curl --request POST \
--url https://toapis.com/v1/images/generations \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen-image-3.0-pro",
"prompt": "1 枚目の人物と 2 枚目の衣装を維持し、現代的な雑誌表紙にしてください",
"image_urls": [
"https://example.com/person.png",
"https://example.com/outfit.png"
],
"size": "3:4",
"resolution": "2K",
"n": 1
}'
タスクの送信結果
{
"id": "task_img_abc123def456",
"object": "generation.task",
"model": "qwen-image-3.0-pro",
"status": "queued",
"progress": 0,
"created_at": 1787270400
}
タスクの照会
curl --request GET \
--url https://toapis.com/v1/images/generations/task_img_abc123def456 \
--header 'Authorization: Bearer <YOUR_API_KEY>'
{
"id": "task_img_abc123def456",
"object": "generation.task",
"model": "qwen-image-3.0-pro",
"status": "completed",
"progress": 100,
"result": {
"type": "image",
"data": [
{ "url": "https://files.toapis.com/generated/qwen-image-result.png" }
]
}
}
生成画像の URL は 24 時間有効です。
expires_at より前に保存してください。料金
- 成功した出力:1 リクエスト
$0.03 - 参照画像:1 枚
$0.003 - 参照画像の無料枠はありません
- 2 つのモデルは現在同じ料金ルールです