gpt-image-2-low-token
gpt-image-2-low-token
छविOpenAIgpt-image-2gpt-image-2-low-token

GPT-Image 2 是 OpenAI 的图像生成与编辑模型,适合文字生成图片、参考图改图、商品图优化、海报素材、创意概念图和营销视觉制作。它适合需要较高画面质量、指令理解和商业可用性的图片生成场景。

प्रमाणीकरण

Base URL
https://api.dreamtoai.com
Authorization
Authorization: Bearer YOUR_API_KEY
Content-Type
application/json
मॉडल नाम (model)
gpt-image-2-low-token

इंटीग्रेशन प्रोटोकॉल

यह प्रोटोकॉल क्यों चुनें

适合已有 OpenAI Images 图片生成接口代码,且希望同步拿到图片结果的用户。

एंडपॉइंट URL
POST/v1/images/generations
Authorization: Bearer YOUR_API_KEYContent-Type: application/json

रिक्वेस्ट / रिस्पॉन्स JSON

रिक्वेस्ट उदाहरण
इमेज URL के साथreference_images[]
{
  "model": "gpt-image-2-low-token",
  "prompt": "生成一张产品海报,白色背景,商业摄影风格",
  "size": "2752x1536",
  "response_format": "url",
  "reference_images": [
    "https://example.com/reference.png"
  ]
}
Base64 के साथreference_images[].mime_type + data_base64
{
  "model": "gpt-image-2-low-token",
  "prompt": "生成一张产品海报,白色背景,商业摄影风格",
  "size": "2752x1536",
  "response_format": "url",
  "reference_images": [
    {
      "mime_type": "image/jpeg",
      "data_base64": "BASE64_IMAGE_DATA"
    }
  ]
}
रिस्पॉन्स उदाहरण
{
  "created": 1710000000,
  "data": [
    {
      "url": "https://example.com/output.png"
    }
  ]
}

रिक्वेस्ट / रिस्पॉन्स फ़ील्ड

रिक्वेस्ट फ़ील्ड
फ़ील्डप्रकारआवश्यक
modelstringY
promptstringY
sizestringY
response_formatstringY
reference_imagesarrayY
रिस्पॉन्स फ़ील्ड
फ़ील्डप्रकारआवश्यक
createdintegerY
dataarrayY
data[]objectY
data[].urlstringY

कोड उदाहरण

cURLrequest.sh
curl -X POST "https://api.dreamtoai.com/v1/images/generations" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "model": "gpt-image-2-low-token",
  "prompt": "生成一张产品海报,白色背景,商业摄影风格",
  "size": "2752x1536",
  "response_format": "url",
  "reference_images": [
    "https://example.com/reference.png"
  ]
}'

# रेफ़रेंस फ़ाइल अपलोड करने के लिए cURL
curl -X POST "https://api.dreamtoai.com/v1/files/upload" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "kind=image" \
  -F "purpose=reference" \
  -F "[email protected]"