GPT-Image-2 API: $0.02 থেকে ইমেজ জেনারেট ও এডিট করুন — উপলব্ধ সবচেয়ে সস্তা অ্যাক্সেস
OpenAI pricing-এর তুলনায় 50% ছাড়ে GPT-Image-2 API। $0.003 থেকে ইমেজ জেনারেট করুন, multi-reference ও mask inpainting দিয়ে এডিট করুন, PNG/JPEG/WebP আউটপুট 4K পর্যন্ত। OpenAI-compatible drop-in endpoint।
TL;DR: GPT-Image-2 আজই Smart AIPI-তে live — OpenAI যেদিন release করেছে, সেদিনই। gpt-image-2 model ব্যবহার করুন /v1/images/generations বা /v1/images/edits-এ। এটি OpenAI direct-এর চেয়ে 50% সস্তা, multi-reference edits, mask inpainting, JPEG/WebP output, এবং 4K resolution support করে। কোনো config change লাগবে না — যেকোনো legacy model ID (dall-e, dall-e-3, gpt-image-latest) সরাসরি gpt-image-2-তে route হবে।
OpenAI刚? OpenAI সম্প্রতি GPT-Image-2 release করেছে, তাদের নতুন flagship image generation ও editing model। আমরা সেটি একই দিনে Smart AIPI-তে যোগ করেছি। যেকোনো /v1/images/generations বা /v1/images/edits call-এ gpt-image-2 model ID ব্যবহার করুন — কোনো config change নেই, redeployment নেই, একই API key।
নীচে: gpt-image-1.5-এর তুলনায় কী বদলেছে, production-এর জন্য multi-reference edits + mask inpainting কেন গুরুত্বপূর্ণ, exact pricing, এবং চারটি language-এ working code।
GPT-Image-2 কেন আলাদা
GPT-Image-2 প্রথম OpenAI image model যা serious creative workflow-এ deploy করার জন্য practical — শুধু one-off demo নয়। চারটি concrete capability change এটির value বাড়ায়:
- Native 4K resolution. GPT-Image-2 3840×2160 (4K landscape) বা 2160×3840 (4K portrait) পর্যন্ত যেকোনো dimension accept করে, যেখানে gpt-image-1.5-এর ceiling ছিল 1536×1024। এটি maximum output pixel-এ 7.5× jump। এখন একটিই tool call-এ production-ready hero image, print-quality poster, এবং cinematic still generate করা যায়।
- Free-form resolutions. আগের gpt-image model-গুলো আপনাকে তিনটি preset-এ আটকে রাখত (square, landscape, portrait)। GPT-Image-2 যেকোনো WxH accept করে, যেখানে উভয় edge 16-এর multiple, max edge ≤ 3840px, total pixel 655,360 থেকে 8,294,400-এর মধ্যে, এবং long-to-short edge ratio ≤ 3:1। এতে হাজার হাজার aspect ratio কভার হয় — banner, social crop, app icon, book cover, film frame।
- High-fidelity reference processing by default. পুরনো
input_fidelity: "high"flag এখন সবসময় on। আপনি যে reference image-ই পাঠান, সেটি full detail-এ process হয় — brand logo crisp থাকে, product texture edit-এর পরও টিকে থাকে, character face turn-to-turn recognizable থাকে। quality/speed trade-off টিউন করার দরকার নেই। - Faster low-quality drafts. 1024×1024-এ
quality: "low"Smart AIPI-এর মাধ্যমে $0.003 খরচে প্রায় 20–40 সেকেন্ডে ফিরে আসে। এটি discard করার জন্য যথেষ্ট সস্তা — prompt exploration এবং UI preview-এর জন্য ideal, high-quality render-এ $0.10+ খরচ করার আগে।
Pricing: OpenAI Direct-এর তুলনায় 50% কম
GPT-Image-2-এর জন্য OpenAI direct API pricing 1024×1024-এ $0.006 low / $0.053 medium / $0.211 high। Non-square size (1024×1536, 1536×1024) square rate-এর 1.5× খরচ করে।
Smart AIPI-এর মাধ্যমে প্রতিটি tier ঠিক OpenAI retail-এর 50%:
| Quality | Resolution | OpenAI direct | Smart AIPI | You save |
|---|---|---|---|---|
| Low | 1024×1024 | $0.006 | $0.003 | 50% |
| Medium | 1024×1024 | $0.053 | $0.0265 | 50% |
| High | 1024×1024 | $0.211 | $0.1055 | 50% |
| Low | 1024×1536 / 1536×1024 | $0.005 | $0.0045 | ~50% |
| Medium | 1024×1536 / 1536×1024 | $0.041 | $0.0398 | ~50% |
| High | 1024×1536 / 1536×1024 | $0.165 | $0.1583 | ~50% |
একটি typical creative iteration cycle — 1024×1024-এ 10 low-quality draft, তারপর একটি high-quality 1536×1024 final render — Smart AIPI-তে খরচ $0.19, যেখানে OpenAI direct-এ $0.38। দিনে 100 এমন cycle তৈরি করা একটি studio-তে স্কেল করলে আপনি কোনো extra effort ছাড়াই প্রতি মাসে $570 সাশ্রয় করবেন।
আর কোনো provider এই discount-এ GPT-Image-2 দেয় না। OpenRouter OpenAI direct pricing-এর উপর margin যোগ করে pass-through করে। Fal, Replicate, এবং Vertex OpenAI model host করে না। Smart AIPI ChatGPT Business subscription image capacity aggregate করে এবং savings সরাসরি pass through করে।
Multi-Reference Edits: Composable Creative Workflow
GPT-Image-2-এর edit endpoint একটি call-এ একাধিক reference image accept করে। এটিই real creative workflow unlock করে — product composite, scene জুড়ে brand-consistent character, collage generation।
Official OpenAI SDK যেভাবে এগুলো send করে, Smart AIPI সবগুলো support করে:
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 Edits
এডিট নির্দিষ্ট region-এ সীমাবদ্ধ করতে image-এর সঙ্গে mask পাঠান। mask-এর white pixel rewrite হওয়ার এলাকা নির্দেশ করে; black pixel unchanged থাকে।
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"
Mask format requirement: primary image-এর সমান pixel dimension, alpha channel সহ PNG, ≤ 50MB। যদি source mask RGB হয় এবং transparency না থাকে, OpenAI docs-এ একটি 10-line PIL snippet আছে যা grayscale value থেকে alpha channel যোগ করে।
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"
}'
Response একটি standard OpenAI shape — { "created": ..., "data": [{ "b64_json": "..." }] }। PNG bytes পেতে b64_json base64-decode করুন।
Output Formats: PNG, JPEG, WebP
output_format ব্যবহার করে container নিয়ন্ত্রণ করুন। JPEG, PNG-এর তুলনায় উল্লেখযোগ্যভাবে দ্রুত stream back হয়, এবং latency fidelity-এর চেয়ে বেশি গুরুত্বপূর্ণ হলে এটিই সঠিক default। ফাইল size টিউন করতে JPEG বা WebP-এর সাথে output_compression (0–100) ব্যবহার করুন।
{
"model": "gpt-image-2",
"prompt": "Cinematic landscape, golden hour",
"size": "3840x2160",
"quality": "high",
"output_format": "jpeg",
"output_compression": 85
}
Supported Parameters (v1/images/generations & v1/images/edits)
model—gpt-image-2(default),gpt-image-1.5,gpt-image-1,gpt-image-1-mini. Legacy aliasdall-e,dall-e-3,gpt-image,gpt-image-latestসব gpt-image-2-তে map হয়।prompt— required text instruction.n— batch size, 1–10. Smart AIPI server-side loop করে কারণ Codex image tool প্রতি call-এ একটিই image produce করে।size—autoবা যেকোনো WxH যা gpt-image-2-এর constraints পূরণ করে (16-এর multiple, edge ≤ 3840, 655,360 ≤ pixels ≤ 8,294,400, long:short ≤ 3:1)।quality—low/medium/high/auto(default medium)।output_format—png(default) /jpeg/webp।output_compression— 0–100, শুধু jpeg/webp।background—auto/opaque। Transparent gpt-image-2-এ supported নয়; দরকার হলে gpt-image-1.5 ব্যবহার করুন।moderation—auto(default) /low।image(শুধু edits) — single base64 string বা array of base64 strings (JSON) /imageবাimage[]multipart file part।mask(শুধু edits) — single base64 string (JSON) / multipart file। White=edit, black=preserve।
Response Shape
OpenAI-এর /v1/images response-এর সঙ্গে identical। একটি field ঐচ্ছিকভাবে যোগ হয়: যদি Codex backend একটি revised_prompt emit করে, Smart AIPI সেটি প্রতিটি image item-এ surface করে।
{
"created": 1777064910,
"data": [
{
"b64_json": "iVBORw0KGgo...",
"revised_prompt": "A detailed photorealistic coffee mug..."
}
]
}
Get Started
Free credits included. প্রতিটি নতুন account-এ $5 free credits দেওয়া হয় — প্রায় 1,650 low-quality draft, 188 medium render, বা 47 high-quality hero image-এর জন্য যথেষ্ট। smartaipi.com/signup-এ sign up করুন।
- Sign up করুন smartaipi.com/signup-এ (free credits, credit card লাগবে না)
- Create an API key করুন dashboard-এ
- Set your base URL করুন
https://api.smartaipi.com/v1-এ - Use model করুন
gpt-image-2
একই OpenAI-compatible API shape, একই Python / JavaScript / curl code, একই image-generation tools — এখন OpenAI-এর newest flagship image model, half price-এ।
OpenAI-সামঞ্জস্যপূর্ণ API গেটওয়ে। 75% কম খরচে frontier AI models ব্যবহার করুন।
ফ্রিতে শুরু করুন