Nano Banana API: $0.01$0.04(75%オフ)
メニュー
ImageGPT AI API

APIドキュメント

強力なAIモデルでアイデアを素晴らしい画像や動画に変換

直接画像生成APIプレイグラウンド

複数のモデルと出力フォーマットで画像生成APIをテスト・探索

モデルを選択

エンドポイント

POSThttps://api.imagegpt.online/generate/text-image

ヘッダー

リクエストボディ

コードサンプル

fetch('https://api.imagegpt.online/generate/text-image', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
  "prompt": "Photorealistic portrait of the same person (keep his real face unchanged). A man with medium curly brown hair, light skin, and soft features sits relaxed, forearms on a light blue table, holding a small white puppy with a red collar. He wears a cozy color-block knitted sweater (beige, tan, light blue, black) with ribbed neck and cuffs, a silver watch, and a turquoise-beaded bracelet. Soft diffused lighting, smooth steel-blue background, slightly elevated front angle warm, intimate, digital photo",
  "width": 512,
  "height": 512,
  "model": "FLUX-SCHNELL",
  "outputType": "binary",
  "outputFormat": "png"
})
})
  .then(response => response.blob())
  .then(blob => {
    const imageUrl = URL.createObjectURL(blob);
    console.log('Image URL:', imageUrl);
    // Display in img tag: document.getElementById('myImg').src = imageUrl;
  })
  .catch(error => console.error('Error:', error));
APIドキュメント

画像生成API

15以上のAIモデルを使用して画像を生成する統合REST API — テキストから画像、画像から画像の生成を複数の出力形式でサポート、クレジットベースの料金体系で単一エンドポイントから利用可能。

POSThttps://api.imagegpt.online/generate/text-image

すべてのリクエストにはAPIキーをリクエストヘッダーに含める必要があります。APIキーは秘密にし、本番環境のクライアントサイドコードに公開しないでください。

http header
x-api-key: YOUR_API_KEY

APIキーが欠落または無効な場合、 401 Unauthorized レスポンスが返されます。

以下のフィールドを含むJSONボディを送信してください:

パラメータ型デフォルト説明
model*
string—生成に使用するモデルID。利用可能な全IDについては上記のモデルリストを参照。
prompt*
string—生成したい画像のテキスト説明。
width
number512出力画像の幅(ピクセル)。
height
number512出力画像の高さ(ピクセル)。
outputType
string"binary"出力配信形式。"binary"(画像blob)、"url"(ホストされたリンク)、"base64"(エンコード文字列)のいずれか。
outputFormat
string"png"画像ファイル形式。"png"または"jpg"。
image
string[]—入力画像URLの配列(最大3)。画像から画像生成の場合のみ必須。

* 必須フィールド。

レスポンスの形状は選択した outputType に依存します:

binary

outputType: "binary"

js
const blob = await response.blob();
const url = URL.createObjectURL(blob);
url

outputType: "url"

json
{
  "success": true,
  "taskId": "imagegpt_img-...",
  "url": "https://...",
  "creditsDeducted": 3
}
base64

outputType: "base64"

json
{
  "success": true,
  "taskId": "imagegpt_img-...",
  "base64": "/9j/4QWm...",
  "creditsDeducted": 3
}

fetch APIを使用した最小限のテキストから画像リクエスト:

javascript
fetch('https://api.imagegpt.online/generate/text-image', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    model: 'FLUX-SCHNELL',
    prompt: 'A futuristic city at sunset, photorealistic',
    width: 512,
    height: 512,
    outputType: 'url',
    outputFormat: 'png'
  })
})
  .then(res => res.json())
  .then(data => console.log('Image URL:', data.url));

画像から画像の場合、 image 配列を追加:

javascript
body: JSON.stringify({
  model: 'FLUX-KONTEXT',
  prompt: 'Same person, wearing a red jacket',
  image: ['https://example.com/input.jpg'],
  width: 512,
  height: 512,
  outputType: 'url',
  outputFormat: 'png'
})

クレジットは生成された画像ごとに課金されます。各モデルの横のバッジはクレジットコストを示しています:

エコノミー
3クレジット / 画像

下書きやプロトタイプに最適な高速軽量モデル。

e.g. Flux Schnell、Z Image Turbo

スタンダード
10〜30クレジット / 画像

日常の生成タスクにバランスの取れた品質。

e.g. GPT Image 1.0、Seedream、Nova Canvas

プレミアム
35〜100クレジット / 画像

本番品質の出力に最高の忠実度。

e.g. Nano Banana Pro、Seedream 4.0、Ideogram

ImageGPTはNSFW、性的に露骨なコンテンツ、成人向けコンテンツ、搾取的・欺瞞的・有害なAI生成コンテンツを禁止しています。対応する画像・動画生成にはコンテンツモデレーションが適用されます。