GPT-Image-2 API: Bumuo at Mag-edit ng mga Larawan mula $0.02 — Pinakamurang Access na Available

GPT-Image-2 API na may 50% diskwento sa pagpepresyo ng OpenAI. Bumuo ng mga larawan mula $0.003, mag-edit gamit ang multi-reference at mask inpainting, output na PNG/JPEG/WebP hanggang 4K. Drop-in OpenAI-compatible endpoint.

S
Smart AIPI Team
7 min na basa ·
GPT-Image-2 API: Bumuo at Mag-edit ng mga Larawan mula $0.02 — Pinakamurang Access na Available

TL;DR: Live na ang GPT-Image-2 sa Smart AIPI ngayon — sa parehong araw na inilabas ito ng OpenAI. Gamitin ang model gpt-image-2 sa /v1/images/generations o /v1/images/edits. 50% mas mura ito kaysa direct sa OpenAI, may suporta sa multi-reference edits, mask inpainting, JPEG/WebP output, at 4K resolutions. Walang kailangang baguhin sa config — anumang legacy model ID (dall-e, dall-e-3, gpt-image-latest) ay diretso nang iruruta sa gpt-image-2.

Kakalabas lang ng OpenAI ng GPT-Image-2, ang bago nilang flagship image generation at editing model. Idinagdag namin ito sa Smart AIPI sa parehong araw. Gamitin ang model ID gpt-image-2 sa kahit anong /v1/images/generations o /v1/images/edits call — walang pagbabago sa config, walang redeployment, parehong API key.

Sa ibaba: ano talaga ang nagbago kumpara sa gpt-image-1.5, bakit mahalaga ang multi-reference edits + mask inpainting para sa production, ang eksaktong presyo, at gumaganang code sa apat na wika.

Ano ang Nagpapakaiba sa GPT-Image-2

Ang GPT-Image-2 ang unang OpenAI image model na praktikal i-deploy para sa seryosong creative workflows — hindi lang pang-isahang demo. Apat na konkretong pagbabago sa capability ang nagtutulak nito:

  • Native na 4K resolution. Tinatanggap ng GPT-Image-2 ang anumang dimensions hanggang 3840×2160 (4K landscape) o 2160×3840 (4K portrait), mula sa 1536×1024 na ceiling ng gpt-image-1.5. Iyan ay 7.5× na pagtalon sa maximum output pixels. Maaari ka nang bumuo ng production-ready hero images, print-quality posters, at cinematic stills sa iisang tool call.
  • Free-form resolutions. Sa mga nakaraang gpt-image model, naka-lock ka sa tatlong preset (square, landscape, portrait). Tinatanggap ng GPT-Image-2 ang kahit anong WxH kung saan parehong edge ay multiples of 16, max edge ≤ 3840px, total pixels ay nasa pagitan ng 655,360 at 8,294,400, at ang long-to-short edge ratio ay ≤ 3:1. Sinasaklaw nito ang libo-libong aspect ratio — banners, social crops, app icons, book covers, film frames.
  • High-fidelity reference processing bilang default. Ang dating input_fidelity: "high" flag ay laging naka-on na ngayon. Bawat reference image na ipapasa mo ay pinoproseso sa full detail — nananatiling malinaw ang brand logos, nakakaligtas ang product textures sa edits, at nananatiling makilala ang mga mukha ng character sa bawat turn. Walang quality/speed trade-off na kailangang i-tune.
  • Mas mabilis na low-quality drafts. Ang quality: "low" sa 1024×1024 ay nagkakahalaga ng $0.003 sa Smart AIPI at bumabalik sa humigit-kumulang 20–40 segundo. Sapat na itong mura para itapon — ideal para sa prompt exploration at UI previews bago mag-commit sa $0.10+ high-quality render.

Presyo: 50% Diskwento sa OpenAI Direct

Ang direct API pricing ng OpenAI para sa GPT-Image-2 sa 1024×1024 ay $0.006 low / $0.053 medium / $0.211 high. Ang non-square sizes (1024×1536, 1536×1024) ay 1.5× ng square rate.

Sa Smart AIPI, eksaktong 50% ng OpenAI retail ang bawat tier:

Kalidad Resolusyon OpenAI direct Smart AIPI Matitipid mo
Low1024×1024$0.006$0.00350%
Medium1024×1024$0.053$0.026550%
High1024×1024$0.211$0.105550%
Low1024×1536 / 1536×1024$0.005$0.0045~50%
Medium1024×1536 / 1536×1024$0.041$0.0398~50%
High1024×1536 / 1536×1024$0.165$0.1583~50%

Isang tipikal na creative iteration cycle — 10 low-quality drafts sa 1024×1024, tapos isang high-quality na 1536×1024 final render — ay nagkakahalaga ng $0.19 sa Smart AIPI kumpara sa $0.38 direkta mula sa OpenAI. I-scale mo iyan sa studio na gumagawa ng 100 ganoong cycle bawat araw at nakakatipid ka ng $570 bawat buwan nang walang dagdag na effort.

Walang ibang provider ang nag-aalok ng GPT-Image-2 sa ganitong diskwento. Ang OpenRouter ay nagpapasa lang ng direct OpenAI pricing plus margin. Ang Fal, Replicate, at Vertex ay hindi nagho-host ng OpenAI models. I-aaggregate ng Smart AIPI ang image capacity ng ChatGPT Business subscription at ipapasa nang diretso ang natipid.

Multi-Reference Edits: Naisasantabing Creative Workflows

Tinatanggap ng edit endpoint ng GPT-Image-2 ang maraming reference images sa iisang call. Ito ang capability na nagbubukas ng totoong creative workflows — product composites, brand-consistent characters sa iba’t ibang scene, collage generation.

Sinusuportahan ng Smart AIPI ang lahat ng paraan na ipinapadala sila ng official OpenAI SDK:

Python SDK (multipart with image[])

from openai import OpenAI
client = OpenAI(base_url="https://api.smartaipi.com/v1")

result = client.images.edit(
    model="gpt-image-2",
    image=[
        open("body-lotion.png", "rb"),
        open("bath-bomb.png",  "rb"),
        open("incense-kit.png","rb"),
        open("soap.png",       "rb"),
    ],
    prompt="Photorealistic gift basket 'Relax & Unwind' with a ribbon, containing the items in the reference images.",
)

with open("gift-basket.png","wb") as f:
    f.write(base64.b64decode(result.data[0].b64_json))

JSON API (array of base64 strings)

curl https://api.smartaipi.com/v1/images/edits \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "Gift basket containing all the items from the references",
    "image": ["<base64-png-1>", "<base64-png-2>", "<base64-png-3>"]
  }'

curl multipart (both image[] and repeated image work)

curl https://api.smartaipi.com/v1/images/edits \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model=gpt-image-2" \
  -F "image[][email protected]" \
  -F "image[][email protected]" \
  -F "image[][email protected]" \
  -F "image[][email protected]" \
  -F "prompt=Gift basket with all the referenced items"

Mask Inpainting: Surgical na mga Edit

Magpasa ng mask kasabay ng image para limitahan ang edits sa partikular na rehiyon. Ang puting pixels sa mask ay nagsasaad ng mga bahaging ire-rewrite; ang itim na pixels ay mananatiling walang pagbabago.

curl https://api.smartaipi.com/v1/images/edits \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model=gpt-image-2" \
  -F "image=@sunlit_lounge.png" \
  -F "[email protected]" \
  -F "prompt=Replace the pool with a flamingo float"

Mga requirement sa mask format: kaparehong pixel dimensions ng primary image, PNG na may alpha channel, ≤ 50MB. Kung ang source mask mo ay RGB na walang transparency, kasama sa OpenAI docs ang 10-line PIL snippet na nagdaragdag ng alpha channel mula sa grayscale values.

Generate: Basic Request

curl https://api.smartaipi.com/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "A photorealistic coffee mug on a weathered oak table",
    "size": "2048x2048",
    "quality": "high"
  }'

Ang response ay standard na OpenAI shape — { "created": ..., "data": [{ "b64_json": "..." }] }. I-base64-decode ang b64_json para makuha ang PNG bytes.

Output Formats: PNG, JPEG, WebP

Gamitin ang output_format para kontrolin ang container. Mas mabilis bumalik ang JPEG kaysa PNG at ito ang tamang default kapag mas mahalaga ang latency kaysa lossless fidelity. Ipares ang JPEG o WebP sa output_compression (0–100) para i-tune ang laki ng file.

{
  "model": "gpt-image-2",
  "prompt": "Cinematic landscape, golden hour",
  "size": "3840x2160",
  "quality": "high",
  "output_format": "jpeg",
  "output_compression": 85
}

Mga Sinusuportahang Parameter (v1/images/generations & v1/images/edits)

  • modelgpt-image-2 (default), gpt-image-1.5, gpt-image-1, gpt-image-1-mini. Ang legacy aliases na dall-e, dall-e-3, gpt-image, gpt-image-latest ay lahat tumutugma sa gpt-image-2.
  • prompt — kinakailangang text instruction.
  • n — batch size, 1–10. Nag-loop ang Smart AIPI sa server-side dahil ang Codex image tool ay isang image lang bawat call ang nilalabas.
  • sizeauto o anumang WxH na tumutugon sa constraints ng gpt-image-2 (multiples of 16, edges ≤ 3840, 655,360 ≤ pixels ≤ 8,294,400, long:short ≤ 3:1).
  • qualitylow / medium / high / auto (default ay medium).
  • output_formatpng (default) / jpeg / webp.
  • output_compression — 0–100, jpeg/webp only.
  • backgroundauto / opaque. Hindi suportado ng gpt-image-2 ang transparent; gamitin ang gpt-image-1.5 kung kailangan mo iyon.
  • moderationauto (default) / low.
  • image (edits only) — single base64 string o array ng base64 strings (JSON) / image o image[] multipart file parts.
  • mask (edits only) — single base64 string (JSON) / multipart file. White=edit, black=preserve.

Response Shape

Kapareho ng response ng OpenAI /v1/images. Isang field ang opsyonal na idinadagdag: kung maglalabas ang Codex backend ng revised_prompt, ipinapakita ito ng Smart AIPI sa bawat image item.

{
  "created": 1777064910,
  "data": [
    {
      "b64_json": "iVBORw0KGgo...",
      "revised_prompt": "A detailed photorealistic coffee mug..."
    }
  ]
}

Magsimula

Kasama ang free credits. Bawat bagong account ay may $5 na free credits — sapat para sa humigit-kumulang 1,650 low-quality drafts, 188 medium renders, o 47 high-quality hero images. Mag-sign up sa smartaipi.com/signup.

  1. Mag-sign up sa smartaipi.com/signup (free credits, walang credit card)
  2. Lumikha ng API key sa dashboard
  3. I-set ang base URL mo sa https://api.smartaipi.com/v1
  4. Gamitin ang model gpt-image-2

Kaparehong OpenAI-compatible API shape, kaparehong Python / JavaScript / curl code, kaparehong image-generation tools — ngayon, kasama ang pinakabagong flagship image model ng OpenAI, sa kalahati ng presyo.

GPT-Image-2 Image Generation Image Editing OpenAI Cheapest API Multi-Reference Mask
S
Isinulat ni
Smart AIPI

API gateway na compatible sa OpenAI. Ma-access ang frontier AI models nang 75% mas mababa ang gastos.

Magsimula nang libre

Naipadala ang mensahe

Babalikan ka namin sa loob ng 2 business days.

Makipag-ugnayan sa Support

May tanong ka ba o kailangan ng tulong? Padalhan kami ng mensahe at babalikan ka namin sa loob ng 2 business days.