メインコンテンツへスキップ
ARouter は OpenAI 互換の /v1/images/generations エンドポイントを通じて画像生成をサポートします。

クイックスタート

curl https://api.arouter.ai/v1/images/generations \
  -H "Authorization: Bearer lr_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{"model": "openai/dall-e-3", "prompt": "A futuristic city skyline at sunset, photorealistic", "n": 1, "size": "1024x1024"}'
from openai import OpenAI
client = OpenAI(base_url="https://api.arouter.ai/v1", api_key="lr_live_xxxx")
response = client.images.generate(
    model="openai/dall-e-3",
    prompt="A futuristic city skyline at sunset, photorealistic",
    n=1, size="1024x1024", quality="hd"
)
print(response.data[0].url)

リクエストパラメータ

パラメータ説明
modelstring画像生成モデル ID
promptstring生成したい画像のテキスト説明。DALL-E 3 は最大 4,000 文字、DALL-E 2 は最大 1,000 文字。
ninteger生成する画像の数(デフォルト 1)。DALL-E 3 は n=1 のみサポート。
sizestring画像サイズ(モデルによって異なる)
qualitystring"standard" または "hd"(DALL-E 3 のみ、デフォルト "standard"
stylestring"vivid"(超リアル)または "natural"(DALL-E 3 のみ)
response_formatstring"url"(デフォルト)または "b64_json"

レスポンス形式

{
  "created": 1234567890,
  "data": [
    {"url": "https://...", "revised_prompt": "A photorealistic futuristic city skyline at sunset..."}
  ]
}

画像サイズ

DALL-E 3

サイズアスペクト比
1024x1024正方形(1:1)
1792x1024横長(16:9)
1024x1792縦長(9:16)

対応モデル

モデルプロバイダー解像度スタイル制御
openai/dall-e-3OpenAI最大 1792×1024style パラメータ
openai/dall-e-2OpenAI最大 1024×1024
stability/stable-diffusion-3-largeStability AI最大 1024×1024
black-forest-labs/flux-1-proReplicate柔軟

料金

モデルサイズコスト
openai/dall-e-3 スタンダード1024×1024$0.040
openai/dall-e-3 スタンダード1024×1792 または 1792×1024$0.080
openai/dall-e-3 HD1024×1024$0.080
openai/dall-e-3 HD1024×1792 または 1792×1024$0.120
openai/dall-e-21024×1024$0.020
ARouter が返す画像 URL は 1 時間後に期限切れになります。保存したい画像はダウンロードして保管してください。