ChatGPT Images 2.5 API
ChatGPT Images 2.5 Client、Flare、Sunburst モデルの包括的な API リファレンスです。
モデルの種類
この API は、利用可能な 6 種類のモデルに対応しています。
機能比較
Flare と Sunburst は、以下のリクエストオプションを共通で使用します。Client 系モデルの既存のオプションは、2 番目の表に記載しています。
対応するアスペクト比
16:9, 9:16, 1:1, 3:2, 2:3, 3:4, 4:3, 5:4, 4:5, 21:9
ChatGPT Images 2.5 Client (テキストから画像生成)
エンドポイント {#}
POST /api/v1/image/task
認証
Authorization: Bearer YOUR_API_KEY
リクエストパラメータ
必須
注意: 幅と高さの比率は、次のいずれかである必要があります。 16:9, 9:16, 1:1, 3:2, 2:3, 3:4, 4:3, 5:4, 4:5, 21:9
リクエスト例
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'chatgpt-images-2.5-client',
prompt: 'A minimalist product shot of a ceramic mug on marble, soft studio light',
width: 1,
height: 1,
resolution: '1k'
})
});
const { data } = await response.json();
const taskId = data.task_id;
const pollResponse = await fetch(
`https://api.flaq.ai/api/v1/image/${taskId}`,
{
headers: { Authorization: 'Bearer YOUR_API_KEY' }
}
);
const result = await pollResponse.json();
console.log(result.data.task_result.images[0].url);
ChatGPT Images 2.5 Edit Client (画像編集)
エンドポイント
POST /api/v1/image/task
リクエストパラメータ
必須
注意: 幅と高さの比率は、次のいずれかである必要があります。 16:9, 9:16, 1:1, 3:2, 2:3, 3:4, 4:3, 5:4, 4:5, 21:9
単一画像の編集例
{
model_name: 'chatgpt-images-2.5-edit-client',
prompt: 'Replace the background with a clean studio scene and brighten the product lighting',
image_url_list: ['https://example.com/product-photo.jpg'],
width: 16,
height: 9,
resolution: '1k'
}
複数画像の合成例
{
model_name: 'chatgpt-images-2.5-edit-client',
prompt: 'Blend these reference images into a polished campaign composition while keeping the main subject identity consistent',
image_url_list: [
'https://example.com/image1.jpg',
'https://example.com/image2.jpg',
'https://example.com/image3.jpg'
],
width: 16,
height: 9,
resolution: '1k'
}
ChatGPT Images 2.5 Flare (テキストから画像生成)
エンドポイント
POST /api/v1/image/task
リクエストパラメータ
必須
幅と高さの比率は、上記の対応するアスペクト比のいずれかに一致する必要があります。
任意
リクエスト例
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'gpt-image-2.5-flare',
prompt: 'A ceramic mug on a pale stone table, warm studio lighting, minimal composition',
width: 1,
height: 1,
resolution: '1k',
quality: 'medium'
})
});
const { data } = await response.json();
const taskId = data.task_id;
ChatGPT Images 2.5 Flare Edit (画像編集)
エンドポイント
POST /api/v1/image/task
リクエストパラメータ
必須
幅と高さの比率は、上記の対応するアスペクト比のいずれかに一致する必要があります。
任意
リクエスト例
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'gpt-image-2.5-flare-edit',
prompt: 'Replace the background with a warm studio setting while keeping the product unchanged',
image_url_list: ['https://example.com/product-photo.jpg'],
width: 1,
height: 1,
resolution: '1k',
quality: 'medium'
})
});
const { data } = await response.json();
const taskId = data.task_id;
ChatGPT Images 2.5 Sunburst (テキストから画像生成)
エンドポイント
POST /api/v1/image/task
リクエストパラメータ
必須
幅と高さの比率は、上記の対応するアスペクト比のいずれかに一致する必要があります。
任意
リクエスト例
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'gpt-image-2.5-sunburst',
prompt: 'A ceramic mug on a pale stone table, warm studio lighting, minimal composition',
width: 1,
height: 1,
resolution: '1k',
quality: 'medium'
})
});
const { data } = await response.json();
const taskId = data.task_id;
ChatGPT Images 2.5 Sunburst Edit (画像編集)
エンドポイント
POST /api/v1/image/task
リクエストパラメータ
必須
幅と高さの比率は、上記の対応するアスペクト比のいずれかに一致する必要があります。
任意
リクエスト例
const response = await fetch('https://api.flaq.ai/api/v1/image/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'gpt-image-2.5-sunburst-edit',
prompt: 'Replace the background with a warm studio setting while keeping the product unchanged',
image_url_list: ['https://example.com/product-photo.jpg'],
width: 1,
height: 1,
resolution: '1k',
quality: 'medium'
})
});
const { data } = await response.json();
const taskId = data.task_id;
レスポンス形式
初期レスポンス
ChatGPT Images 2.5 の 6 種類すべてが、ポーリング用の task_id を返します。
{
"code": 0,
"data": {
"task_id": "{task_id}",
"task_status": "submitted",
"response_url": "https://api.flaq.ai/api/v1/image/{task_id}"
},
"message": "success"
}
ポーリングレスポンス
GET /api/v1/image/{task_id} をポーリングしてステータスを確認します。
{
"code": 0,
"data": {
"task_id": "{task_id}",
"task_status": "succeed",
"task_status_msg": null,
"response_url": "https://api.flaq.ai/api/v1/image/{task_id}",
"task_result": {
"credit": 0.0997,
"images": [
{
"url": "https://example.com/generated-image.jpeg"
}
]
}
},
"message": "success"
}
ステータス値
submitted: タスク受付済み
processing: 画像の生成または編集中
succeed: タスク正常完了
failed: タスク失敗
処理時間
処理時間はモデル、出力設定、プロンプトの複雑さ、参照画像の枚数によって異なります。タスクのステータスが succeed または failed になるまでポーリングしてください。受付済みまたは処理中のタスクには、まだ画像結果が含まれていない場合があります。
ベストプラクティス
- 構図を明確に指定する:ChatGPT Images 2.5 は、被写体、フレーミング、照明、意図するスタイルを明確に記述したプロンプトで、最も効果を発揮します。
- 用途に合わせてアスペクト比を設定する:SNS 投稿、バナー、商品ページ、編集記事のレイアウトなど、用途に合わせて比率を最初に設定してください。
- 編集には鮮明な元画像を使う:ピントが合い、十分な明るさの入力画像を使うと、被写体の同一性を維持しやすくなり、部分編集の品質も向上します。
- 複数画像のリクエストでは有効な参照画像に絞る:編集リクエストには、視覚的な指示が矛盾しないよう、必要な画像だけを指定してください。