メインコンテンツへスキップ
POST
/
v1
/
images
/
generations
OpenAI image generations
curl --request POST \
  --url https://maas.apigo.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "一只可爱的小猫在花园里玩耍,阳光明媚,油画风格",
  "model": "gpt-image-1",
  "size": "1024x1024",
  "quality": "high"
}
'
{
  "created": 1589478378,
  "background": "auto",
  "output_format": "png",
  "quality": "high",
  "size": "1024x1024",
  "data": [
    {
      "url": "https://example.com/generated-image.png"
    }
  ],
  "usage": {
    "input_tokens": 15,
    "input_tokens_details": {
      "image_tokens": 0,
      "text_tokens": 15
    },
    "output_tokens": 1,
    "total_tokens": 16
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.apigo.ai/llms.txt

Use this file to discover all available pages before exploring further.

テキスト プロンプトから画像を作成します。
  • Authorization: Bearer {API_KEY}で認証する
  • これをテキストから画像へのルートとして使用します。編集、修復、または画像の拡張には、/v1/images/edits を使用してください。
  • gpt-image-1dall-e-3、および dall-e-2 は異なるパラメーター セットを公開しており、それらの違いは上のネイティブ パラメーター パネルに表示されるようになりました。
  • 応答に一時的な url 値が含まれている場合は、それらをサーバー側ですぐにミラーリングします。 b64_json が含まれている場合は、メインスレッドで大きな画像をデコードしすぎないようにします。

承認

Authorization
string
header
必須

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

ボディ

application/json
prompt
string
必須

Text prompt for the desired image.

:

"一只可爱的小猫在花园里玩耍,阳光明媚,油画风格"

model
enum<string>

Image generation model.

利用可能なオプション:
gpt-image-1,
dall-e-3,
dall-e-2
background
enum<string>

Only supported by gpt-image-1.

利用可能なオプション:
transparent,
opaque,
auto
moderation
enum<string>

Only supported by gpt-image-1.

利用可能なオプション:
auto,
low
n
integer
デフォルト:1

Number of images to generate. dall-e-3 only supports 1.

必須範囲: 1 <= x <= 10
output_compression
integer
デフォルト:100

Compression level for gpt-image-1 jpeg/webp output.

必須範囲: 0 <= x <= 100
output_format
enum<string>

Only supported by gpt-image-1.

利用可能なオプション:
png,
jpeg,
webp
partial_images
integer
デフォルト:0

Number of partial images for streaming previews.

必須範囲: 0 <= x <= 3
quality
enum<string>

Supported values vary by model.

利用可能なオプション:
auto,
high,
medium,
low,
hd,
standard
response_format
enum<string>

Only applies to dall-e-2 and dall-e-3.

利用可能なオプション:
url,
b64_json
size
enum<string>

Allowed values depend on the selected model.

利用可能なオプション:
1024x1024,
1536x1024,
1024x1536,
auto,
256x256,
512x512,
1792x1024,
1024x1792
stream
boolean
デフォルト:false

Only supported by gpt-image-1.

style
enum<string>

Only supported by dall-e-3.

利用可能なオプション:
vivid,
natural
user
string

Unique identifier for the end user.

レスポンス

Successful image generation response

created
integer<int64>
必須

Unix timestamp in seconds.

data
object[]
必須
background
enum<string>
利用可能なオプション:
transparent,
opaque,
auto
output_format
enum<string>
利用可能なオプション:
png,
jpeg,
webp
quality
enum<string>
利用可能なオプション:
auto,
high,
medium,
low,
hd,
standard
size
string
usage
object