GPT-image-2 API hình ảnh AI
GPT Image 2 là mô hình ảnh của OpenAI trong luồng tạo ảnh Flatkey. Dùng /v1/images/generations và cấu hình số lượng, kích thước, chất lượng, định dạng, nền và moderation trước khi gửi.
Đầu ra
Xem trước
Tóm tắt yêu cầu
- Điểm cuối
- POST /v1/images/generations
- ID model
- GPT-image-2
- Tỷ lệ khung hình
- 1:1
- Độ phân giải
- 1024x1024
- Chất lượng
- high
- Số đầu ra
- 1
Chỉ xem trước. Đăng nhập để gửi yêu cầu đến Flatkey.
{
"model": "gpt-image-2",
"prompt": "Goal: Create a glossy miniature 3D diorama, like a handcrafted ceramic toy “box garden,” filled with salsa dancing, Cuban travel, music, plants, and colorful personal-favorite objects.\n\nCanvas: Square 1:1 image, front-facing three-quarter view of a small white corner room on a white base, photographed like a high-end product shot against a clean pale background. Use soft studio lighting, crisp focus, bright saturated colors, shiny enamel/plastic/ceramic textures, and charming miniature scale.\n\nMain subject: In the center, place exactly 2 salsa dancers: a woman in a flowing glossy {argument name=\"dress color\" default=\"red\"} salsa dress with matching heels, hair in a bun with red flowers, and a man in a shiny black suit with a red shirt and black fedora. They are mid-dance in a dramatic close embrace, one arm raised, posed on a small round patterned rug.\n\nRoom layout and counted objects: Build a cozy L-shaped corner room with exactly 2 white walls and 1 white floor base. Include exactly 1 blue shuttered window on the left wall with flower boxes. Include exactly 1 black wall lantern, exactly 1 framed tropical beach picture, exactly 1 small chalkboard sign reading “¡BAILA!” with a heart, exactly 1 blue folding chair, exactly 1 round blue café table, exactly 1 white coffee cup on a saucer, and exactly 1 yellow potted pink flower on or beside the table. On the back wall, hang exactly 1 clothesline with exactly 5 clipped travel photos/postcards, including one that reads “CUBA.” Add exactly 1 large yellow poster on the right back wall reading “SALSA” with silhouettes of dancers and the word “LIVE” near the bottom.\n\nMusic and dance details: At the front left, include exactly 1 black DJ controller/turntable console with exactly 2 visible vinyl records, one red-centered and one blue-centered. Near the front center, place exactly 1 glossy black cat figurine with bright yellow eyes, sitting beside exactly 2 golden music notes and exactly 1 black maraca-like handheld instrument. Keep the vibe playful and musical, like a tiny salsa party scene.\n\nBookshelves and decor: On the right wall, place exactly 1 blue bookshelf with exactly 2 shelves of colorful books and small decorative items. Put exactly 3 potted plants on top of the shelf: one yellow pot with green cactus and pink flower, one red mug-shaped pot with yellow flowers, and one small green pot. Include another shelf section with books and a small face-like pot. In the room overall, include exactly 9 visible potted plants or succulent arrangements: the yellow pink-flower pot near the café table, a green plant near the dancers, a pink succulent, a red cactus pot on the back shelf, a green succulent mound behind the dancers, a yellow pot with small plant near the stereo shelf, the yellow cactus pot on the bookshelf, the red mug flower pot on the bookshelf, and a large red pot with leafy green plant at the front right.\n\nTravel and beach details: At the front right, add exactly 1 small toy sailboat with a blue triangular sail, white triangular sail, brown mast, and white hull, floating on exactly 1 stylized blue wavy water base. Near the lower right foreground, place exactly 1 fan of color swatches containing many rainbow rectangles and exactly 1 black pen or marker laid across it.\n\nStyle constraints: Make everything miniature, rounded, glossy, tactile, and highly detailed, like a joyful collectible clay/ceramic diorama. Use a cheerful palette dominated by red, blue, yellow, green, and white. Ensure the scene feels packed but organized, with no human-scale realism, no blur, no dark mood, no extra text beyond the visible signs and posters, and no watermark.",
"n": 1,
"size": "1024x1024",
"quality": "high",
"output_format": "png",
"background": "opaque",
"moderation": "auto"
}khả năng
GPT Image 2 hiệu năng và khả dụng của API
Telemetry request của Flatkey cho GPT Image 2 sẽ xuất hiện khi có đủ lưu lượng; không suy ra benchmark hay điểm chất lượng từ dữ liệu này.
API
GPT Image 2 mức dùng API và hoạt động request
Phần này phản ánh các request thực tế của Flatkey cho GPT Image 2 và không hiển thị dữ liệu cho đến khi thu thập đủ lưu lượng.
Giá
Giá GPT Image 2 theo token đầu vào hình ảnh
Giá bên dưới được tính từ dữ liệu giá Flatkey cho mô hình này và các nhóm hiển thị do API giá trả về.
Nạp thêm tín dụng
Dùng cùng số dư và API key Flatkey cho mô hình hình ảnh, video, âm thanh và văn bản.
- Loại mô hình
- Văn bản thành ảnh
- API
- /v1/images/generations
- Cơ sở tính phí
- ảnh
- Số đầu ra
- 1–10
Khả năng tạo và chỉnh sửa hình ảnh của GPT Image 2
Các trường tích hợp được ghi nhận hiển thị bên dưới; không suy diễn cam kết benchmark hay chất lượng.
Tạo và chỉnh sửa từ văn bản
Tạo hình ảnh mới hoặc chỉnh sửa ảnh hiện có qua /v1/images/generations và /v1/images/edits.
Sáng tạo theo ảnh tham chiếu
Dùng ngữ cảnh hình ảnh để giữ chủ thể và bố cục cho nội dung sản phẩm, biên tập và chiến dịch.
Biến thể hình ảnh linh hoạt
Chuyển một brief thành tài sản vuông, dọc hoặc ngang cho từng kênh.
Bàn giao an toàn cho sản xuất
Chuẩn bị kết quả theo hành vi đã ghi nhận về chất lượng, định dạng, nền và kiểm duyệt.
So sánh
GPT Image 2 so với GPT Image 1: trường chuyển đổi
Các trường tích hợp được ghi nhận hiển thị bên dưới; không suy diễn cam kết benchmark hay chất lượng.
| Khả năng | GPT Image 1 | GPT Image 2 |
|---|---|---|
| Endpoint API | Chưa rõ tại đây | /v1/images/generations; /v1/images/edits |
| Kích thước | Chưa rõ tại đây | 1024x1024, 1536x1024, 1024x1536, auto |
| Định dạng | Chưa rõ tại đây | PNG, JPEG, WebP |
| Chất lượng/nền/moderation | Chưa rõ tại đây | Đã ghi nhận ở trên |
| Xếp hạng chất lượng ảnh | Không khẳng định | Không khẳng định |
Chọn đúng yêu cầu trước khi tích hợp
Kiểm tra luồng hỗ trợ, chi phí hiện tại và hợp đồng tham số chính xác của Flatkey.
Tính từ cấu hình hiện tại và giá danh mục khi có đơn giá cố định.
- Cấu hình hiện tại
- 1024x1024 · high · 1×
- Giá trực tiếp
- $0.0088 / ảnh
- Ước tính yêu cầu
- $0.0088
Phí cuối cùng phụ thuộc yêu cầu và nhóm tài khoản; giá token hoặc phân tầng không thể quy về một số cố định.
Luồng và Model ID
Chỉ dùng luồng được đánh dấu khả dụng. Flatkey giữ một ID công khai, phần thân chọn kiểu đầu vào.
Văn bản thành ảnh
Tạo ảnh mới từ văn bản.
- ID mô hình
gpt-image-2- Endpoint
/v1/images/generations
Ảnh theo tham chiếu
Dùng ảnh tham chiếu để chỉnh sửa hoặc tạo biến thể.
- ID mô hình
gpt-image-2- Endpoint
/v1/images/generations
Tương thích tham số
Các giá trị từ cùng cấu hình mà Playground sử dụng.
nSố ảnh1–10
Mặc định: 1sizeKích thước1024x1024 · 1536x1024 · 1024x1536 · auto
Mặc định: 1024x1024qualityChất lượngauto · high · medium · low
Mặc định: highoutput_formatĐịnh dạng đầu rapng · jpeg · webp
Mặc định: pngbackgroundNềnopaque · auto
Mặc định: opaquemoderationKiểm duyệtauto · low
Mặc định: autoimageGiới hạn tham chiếu4 tệp
Endpoint: /v1/images/generationsTừ thử nghiệm đến production
Dùng cùng hợp đồng trong Playground và API, đồng thời xử lý xác thực, số dư, trạng thái và đầu ra.
Vòng đời yêu cầu
- 1
Kiểm tra mô hình, prompt, tham chiếu và đầu ra.
- 2
Gửi yêu cầu ảnh.
- 3
Đọc kết quả hoặc tác vụ bất đồng bộ.
- 4
Lưu tệp và siêu dữ liệu.
Kiểm tra production
Chặn giá trị và số tham chiếu không hỗ trợ.
Xử lý riêng khóa, số dư, giới hạn và giá nhóm.
Nêu rõ prompt hoặc tài sản cần thay.
Giữ task ID, giới hạn thử lại và không coi timeout là thành công.
Thư viện prompt
Ví dụ prompt GPT Image 2 cho sản phẩm và marketing
Bắt đầu bằng chủ thể, hành động, máy quay hoặc bố cục cụ thể cùng thiết lập đầu ra rõ ràng; tách trường yêu cầu khỏi prompt.
Tạo bằng Image 2
Scene: A 16:9 sci-fi game loadout screen in a blue-purple spaceship hangar. A female armored character stands centered with a glowing violet rifle; armor slots line the left, three weapon slots line the right, and the lower slot is highlighted. Keep the HUD hierarchy, pose, lighting, and equipment geometry fixed for an exact equipment-switch frame. No readable words, logos, invented stats, or watermark. Composition and rendering: Deliver one 16:9 game-interface keyframe. Separate the character, held equipment and HUD into clear depth layers; keep slot spacing and icon scale consistent, with the selected item visually dominant. Preserve the scene-specific game art style. Let material edges catch the existing light without letting interface glow obscure the silhouette. Keep all equipment fully inside the frame. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.
Tạo bằng Image 2
Scene: A rainy night soccer broadcast frame under bright stadium floodlights. A black-uniform player strikes the ball while two white-uniform defenders close in, with the goal and a blurred crowd behind. Keep the broadcast camera angle, blank blue score bars, spray, and motion blur consistent; leave overlays abstract and text-free. No real teams, athletes, logos, or watermark. Composition and rendering: Deliver one 16:9 broadcast still at the decisive instant. Use coherent perspective for the playing surface and equipment, readable separation between competitors, and a softer crowd behind the action. Keep the principal subject sharp, with directional blur limited to fast extremities and spray. Preserve the specified broadcast angle and reserve overlay areas clear of the action. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.
Tạo bằng Image 2
Scene: A closed matte-black square smartwatch with a black strap rests on a wet glossy black tabletop. Water droplets catch a cool blue rim light and a soft reflection sits beneath the watch. Use a low three-quarter product camera and preserve the case, strap, highlights, and empty dark background. No readable branding, extra products, hands, or watermark. Composition and rendering: Deliver one 16:9 commercial product still. Keep the complete product silhouette inside generous crop-safe margins. Resolve edges, seams and material transitions precisely; shape highlights to describe volume without clipping bright surfaces or crushing dark details. Align reflections with the object and light source. Retain the stated camera angle and existing negative space; add no decorative props. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.
Tạo bằng Image 2
Scene: On a rain-soaked observatory roof at sunrise, a lone figure in a long dark coat walks toward a large telescope beside an open dome. Wet stone reflects the warm doorway light; cloud-covered mountains sit beyond. Hold the screen direction and end on the telescope and figure in the same wide composition. No readable text, logos, or watermark. Composition and rendering: Deliver one 16:9 storyboard keyframe, not a collage or an action sequence. Separate foreground, character plane and background through the existing light and atmospheric depth. Keep the stated pose and eyelines readable, and retain environmental landmarks for continuity. Match the described photographic, illustrated or puppet medium; give fabric and surfaces texture appropriate to that medium. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.
Tạo bằng Image 2
Scene: In a bright home kitchen, a surprised cook in a blue shirt and cream apron reaches toward pancakes, a frying pan, flour, bowl, and whisk suspended midair. Freeze the comic cause-and-effect moment with believable weight, warm daylight, and a clear path for each object. No injury, logos, readable words, or watermark. Composition and rendering: Deliver one 16:9 physical-comedy still at the described instant. Make the cause of the gag readable through body balance, grip and object spacing. Separate the reaction from the airborne props; retain believable gravity and contact points. Keep the face and important props sharp, with only restrained directional blur on fast edges. Preserve the stated lighting and room or stage layout. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.
Tạo bằng Image 2
Scene: A rainy period harbor platform shelters people in era-appropriate coats and umbrellas as a vintage green tram arrives on wet tracks. Wooden waterfront buildings and misty mountains sit behind the reflections. Preserve the historical clothing, tram shape, rain direction, and stable wide composition; no readable signage, logos, or watermark. Composition and restoration: Deliver one 16:9 archival-style still. Preserve the original framing, period-specific construction and restrained tonal range; retain monochrome, sepia or faded color as described. Recover modest detail in faces, clothing and architecture without synthetic sharpening. Keep fine grain and authentic aging consistent across the frame; repair damage without replacing historical features. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.
Vì sao chọn Flatkey
Vì sao dùng GPT Image 2 qua Flatkey?
Giữ rõ dữ kiện, trường yêu cầu và ranh giới giá của GPT Image 2 khi chuyển từ thử nghiệm sang môi trường thực tế.
Đủ điều khiển đã ghi nhận
Đặt n, size, quality, output format, background và moderation trước khi chuyển request cho console.
Minh bạch từng loại giá
Xem từng chiều input, output và cache đã ghi nhận của GPT Image 2, thay vì coi một giá nổi bật là giá chung.
Điểm bắt đầu theo quy trình
Dùng ví dụ sản phẩm, quảng cáo và storyboard làm prompt có thể chỉnh sửa.
Không hứa điều chưa xác minh
Trang không hứa đầu ra nền trong suốt, tạo miễn phí hay giá cố định mỗi ảnh khi các dữ kiện đó chưa được xác minh.
API
Endpoint API và cấu hình yêu cầu GPT Image 2
Gửi ID model cùng các điều khiển hình ảnh được hỗ trợ.
curl https://router.flatkey.ai/v1/images/generations \ -H "Content-Type: application/json" \ -H "Authorization: Bearer sk-***" \ -d '{"model":"gpt-image-2","prompt":"Creative direction: Create a vertical illustrated fantasy narrative poster with a large dark-haired profile silhouette on the left, a layered mountain temple city in the center, a red torii gate, drifting cherry blossoms, and small travelers along the bottom edge. Use a cream paper texture with ink-and-wash detail, a restrained charcoal, vermilion, and muted violet palette, and reserve a clean right margin for the title and credits.\n\nComposition, material and finish: Build the silhouette and temple city as nested visual layers, with the gate as the vermilion focal accent. Keep small travelers distinct from architectural detail. Use delicate ink edges and paper grain rather than photographic skin or glossy 3D surfaces. Leave the right title margin genuinely empty; avoid added lettering, duplicated gates, muddied silhouettes and watermarks.","n":1,"size":"1024x1024","quality":"high","output_format":"png","background":"opaque","moderation":"auto"}'
Câu hỏi thường gặp
GPT Image 2
API: giá và câu hỏi về prompt
Giá, khả năng tương thích, giới hạn và chi tiết yêu cầu riêng của mô hình.





