メインコンテンツへスキップ
POST
/
v1
/
images
/
variations
curl -X POST "https://api.lemondata.cc/v1/images/variations" \
  -H "Authorization: Bearer sk-your-api-key" \
  -F "[email protected]" \
  -F "n=2" \
  -F "size=1024x1024"
{
  "created": 1706000000,
  "data": [
    {
      "url": "https://..."
    },
    {
      "url": "https://..."
    }
  ]
}

概要

指定された画像のバリエーションを作成します。multipart/form-data コンテンツタイプが必要です。

リクエストボディ

image
file
必須
バリエーションの基となる画像。有効な PNG ファイルで、4MB 未満、正方形である必要があります。
model
string
デフォルト:"dall-e-2"
画像バリエーションに使用するモデル。現在は dall-e-2 のみサポートされています。
n
integer
デフォルト:"1"
生成する画像の数。1 から 10 の間である必要があります。
size
string
生成される画像のサイズ。256x256512x512、または 1024x1024 のいずれかである必要があります。
response_format
string
デフォルト:"url"
生成された画像の返却形式。url または b64_json である必要があります。
user
string
不正利用監視のためのエンドユーザーの一意識別子。

レスポンス

created
integer
画像が作成された時の Unix タイムスタンプ。
data
array
生成された画像バリエーションの配列。各オブジェクトには以下が含まれます:
  • url (string): バリエーション画像の URL(response_format が url の場合)
  • b64_json (string): Base64 エンコードされた画像(response_format が b64_json の場合)
curl -X POST "https://api.lemondata.cc/v1/images/variations" \
  -H "Authorization: Bearer sk-your-api-key" \
  -F "[email protected]" \
  -F "n=2" \
  -F "size=1024x1024"
{
  "created": 1706000000,
  "data": [
    {
      "url": "https://..."
    },
    {
      "url": "https://..."
    }
  ]
}

注意事項

画像バリエーションは DALL-E 2 でのみ利用可能です。モデルは元の画像とスタイルや内容が類似した新しい画像を生成します。

ボディ

application/json
image
file
必須

バリエーションの基となる画像。有効な PNG ファイルで、4MB 未満、正方形である必要があります。

model
string

画像バリエーションに使用するモデル。現在は dall-e-2 のみサポートされています。

n
integer

生成する画像の数。1 から 10 の間である必要があります。

size
string

生成される画像のサイズ。 256x256512x512 、または 1024x1024 のいずれかである必要があります。

response_format
string

生成された画像の返却形式。 url または b64_json である必要があります。

user
string

不正利用監視のためのエンドユーザーの一意識別子。

レスポンス

200 - application/json

Response 200

created
integer

画像が作成された時の Unix タイムスタンプ。

data
object[]

生成された画像バリエーションの配列。 各オブジェクトには以下が含まれます: url (string): バリエーション画像の URL(response_format が url の場合) b64_json (string): Base64 エンコードされた画像(response_format が b64_json の場合)