curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen-image-3.0",
"prompt": "A cafe poster with the title Autumn Limited, warm tones, refined layout",
"size": "16:9",
"resolution": "1K"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "qwen-image-3.0",
"prompt": "A cafe poster with the title Autumn Limited, warm tones, refined layout",
"size": "16:9",
"resolution": "1K",
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/images/generations";
const payload = {
model: "qwen-image-3.0",
prompt: "A cafe poster with the title Autumn Limited, warm tones, refined layout",
size: "16:9",
resolution: "1K",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01JGXYZ1234567890ABCDEF"
}
]
}
{
"error": {
"code": 400,
"message": "リクエストパラメータが無効です",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "認証に失敗しました、APIキーを確認してください",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "残高不足です、チャージしてから再試行してください",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "リクエストが多すぎます、しばらくしてから再試行してください",
"type": "rate_limit_error"
}
}
Qwen Image 3.0
Qwen Image 3.0 画像生成
- 非同期処理モード、後続の照会用にタスク ID を返します
- テキストから画像、画像から画像(1-3 枚の参考画像による編集)をサポート
- 1K / 2K 解像度をサポート、1 リクエストあたり最大 6 枚
- 標準版と Pro 版(Pro は密集レイアウトと文字に強い)
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen-image-3.0",
"prompt": "A cafe poster with the title Autumn Limited, warm tones, refined layout",
"size": "16:9",
"resolution": "1K"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "qwen-image-3.0",
"prompt": "A cafe poster with the title Autumn Limited, warm tones, refined layout",
"size": "16:9",
"resolution": "1K",
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/images/generations";
const payload = {
model: "qwen-image-3.0",
prompt: "A cafe poster with the title Autumn Limited, warm tones, refined layout",
size: "16:9",
resolution: "1K",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01JGXYZ1234567890ABCDEF"
}
]
}
{
"error": {
"code": 400,
"message": "リクエストパラメータが無効です",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "認証に失敗しました、APIキーを確認してください",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "残高不足です、チャージしてから再試行してください",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "リクエストが多すぎます、しばらくしてから再試行してください",
"type": "rate_limit_error"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen-image-3.0",
"prompt": "A cafe poster with the title Autumn Limited, warm tones, refined layout",
"size": "16:9",
"resolution": "1K"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "qwen-image-3.0",
"prompt": "A cafe poster with the title Autumn Limited, warm tones, refined layout",
"size": "16:9",
"resolution": "1K",
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/images/generations";
const payload = {
model: "qwen-image-3.0",
prompt: "A cafe poster with the title Autumn Limited, warm tones, refined layout",
size: "16:9",
resolution: "1K",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01JGXYZ1234567890ABCDEF"
}
]
}
{
"error": {
"code": 400,
"message": "リクエストパラメータが無効です",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "認証に失敗しました、APIキーを確認してください",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "残高不足です、チャージしてから再試行してください",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "リクエストが多すぎます、しばらくしてから再試行してください",
"type": "rate_limit_error"
}
}
サポートされているモデル
| モデル | 説明 | 最大枚数 | 解像度 |
|---|---|---|---|
qwen-image-3.0 | 指示追従が明確で、文字レンダリングが安定。一般用途でコスパが良い | 6 | 1K / 2K |
qwen-image-3.0-pro | 内容がより充実。新聞、絵コンテ、メニュー、試験問題など密集レイアウト向け | 6 | 1K / 2K |
文字・レイアウトが密集する場合は
-pro を推奨。一般的な画像は qwen-image-3.0 を使用。プロンプト上限は約 4.5k トークン。モデル名は 2.0 シリーズと互換ではありません。Authorizations
string
必須
すべてのエンドポイントは Bearer Token 認証が必要ですAPI Key 管理ページ で API Key を取得してください:
Authorization: Bearer YOUR_API_KEY
Body
string
必須
モデル名
qwen-image-3.0- 標準qwen-image-3.0-pro- Pro(密集テキスト / レイアウト)
boolean
デフォルト:"false"
画像タスクを送信する前にコンテンツモデレーションを実行するかどうかを指定します。
true:omni-moderation-latestでプロンプトと入力画像を審査falseまたは省略:審査リクエストを行わず、審査コストや遅延を追加しない(デフォルト)
string
必須
画像生成用のテキスト説明、最大約 4.5k トークン
string[]
参考画像 URL 配列(画像から画像 / 編集)、1-3 枚
- 公開
http(s)://URL またはdata:image/png;base64,...(base64 は先に再アップロードされます) - 形式:JPG / JPEG / PNG / BMP / TIFF / WEBP / GIF
- 1 ファイルあたり ≤ 10MB、幅/高さは 384-2048 px を推奨
string
デフォルト:"1K"
解像度ティア(課金ティアに影響)
1K(デフォルト、小文字も可)2K
size にピクセルを指定することもできます(例:1600x900)。生ピクセル指定時、面積が > 2.25M ピクセル の場合は 2K として課金されます。string
デフォルト:"1:1"
アスペクト比、または明示的なピクセルサイズサポートされる比率:
1:1(デフォルト)4:3/3:416:9/9:163:2/2:3
16x9 形式、または 1024x1024 のようなピクセル指定も可。カスタムピクセルでは、各辺(幅・高さ)が 512 ~ 2048、アスペクト 1:8 ~ 8:1。size も resolution も未設定の場合、出力は 1024×1024 固定です。integer
デフォルト:"1"
画像枚数、1-6。6 を超える値は 6 にクランプされます。
string
ネガティブプロンプト:避けたい内容
boolean
デフォルト:"false"
インテリジェントなプロンプト書き換えデフォルトは オフ(結果を予測可能にするため)。スマート書き換えを使う場合は
true を指定してください。string
書き換えモード(3.0 シリーズのみ、
prompt_extend: true が必要)direct- テキストから画像、画像から画像の両方で有効agent- テキストから画像のみ、より積極的な書き換え
サイズ対照表
resolution(ティア)+ size(比率)を組み合わせます:
| 解像度 | 1:1 | 4:3 | 3:4 | 16:9 | 9:16 | 3:2 | 2:3 |
|---|---|---|---|---|---|---|---|
| 1K | 1024×1024 | 1152×864 | 864×1152 | 1280×720 | 720×1280 | 1248×832 | 832×1248 |
| 2K | 2048×2048 | 2048×1536 | 1536×2048 | 2048×1152 | 1152×2048 | 2048×1360 | 1360×2048 |
使用例
テキストから画像(複数)
{
"model": "qwen-image-3.0",
"prompt": "Flat illustration of a city skyline at dusk, warm orange tones",
"size": "16:9",
"resolution": "1K",
"n": 4
}
密集レイアウト + 書き換え
{
"model": "qwen-image-3.0-pro",
"prompt": "A Western restaurant menu with appetizers, mains, and desserts columns, five dishes each with prices, serif font, cream background",
"size": "3:4",
"resolution": "2K",
"prompt_extend": true,
"prompt_extend_mode": "agent"
}
画像から画像(編集)
{
"model": "qwen-image-3.0-pro",
"prompt": "Change the sign text to Open, keep everything else the same",
"image_urls": ["https://example.com/shop.jpg"],
"size": "1:1"
}
ネガティブプロンプト
{
"model": "qwen-image-3.0",
"prompt": "Photorealistic mountain cabin in morning mist",
"negative_prompt": "text, watermark, people, low resolution",
"size": "3:2"
}
制限
| 項目 | 制限 |
|---|---|
| プロンプト | ≤ 4.5k トークン |
| 出力サイズ | カスタムピクセル時は各辺 512 ~ 2048;アスペクト 1:8 ~ 8:1 |
| 画像枚数 | 1-6(超過分はクランプ) |
| 参考画像 | 1-3 |
| 参考形式 | JPG / JPEG / PNG / BMP / TIFF / WEBP / GIF |
| 参考サイズ | ≤ 10MB、幅/高さは 384-2048 px を推奨 |
Response
integer
ステータスコード、成功時は 200
2.0 との違い
| 2.0 シリーズ | 3.0 シリーズ | |
|---|---|---|
| プロンプト長 | 短い | 約 4.5k トークン |
prompt_extend_mode | 非対応 | direct / agent |
| 解像度 | 1K / 2K | 1K / 2K(Pro の 2K は料金が高い) |
| 参考画像 | 対応 | 1-3 枚 |
注意事項
- 非同期:送信後に
task_idが返ります。タスク状態の取得 を 3~5 秒ごとにポーリング。クライアントタイムアウトは約 3 分(2K + 複数枚はより遅い)。 - ストレージ:画像はプラットフォーム CDN にミラーされ、長期アクセス可能です。
- 課金:納品画像枚数 × 解像度ティア。実際のピクセル面積で判定(> 2.25M ピクセル = 2K)。
qwen-image-3.0は 1K/2K 同額、-proの 2K は 1K の 2 倍。失敗時は全額返金、参考画像は無料。 - エラー:無効な size/比率、画像から画像での
agent、到達不可/過大な参考画像 → 400、レート制限 → 429。
結果の照会進捗と
result.images は タスク状態の取得 を使用してください。