gemini-3.1-flash-image API hình ảnh AI
gemini-3.1-flash-image (Nano Banana 2): Tạo ảnh, chỉnh sửa theo ảnh tham chiếu và lặp thiết kế qua Flatkey. Ví dụ dùng contents/parts của Gemini, không thể thay trực tiếp bằng thân Images API.
Đầu ra
Xem trước
Tóm tắt yêu cầu
- Điểm cuối
- POST /v1beta/models/gemini-3.1-flash-image:generateContent
- ID model
- gemini-3.1-flash-image
- Tỷ lệ khung hình
- 16:9
- Độ phân giải
- 1K
Chỉ xem trước. Đăng nhập để gửi yêu cầu đến Flatkey.
{
"model": "gemini-3.1-flash-image",
"contents": [
{
"role": "user",
"parts": [
{
"text": "Scene: A poolside sports broadcast catches a swimmer in a blue cap during freestyle, with one arm entering the water and a sharp splash across the lane. Use a low pool-deck camera, blue water, lane markings, and abstract blue lower-third graphics without readable text. Keep swimmer direction, splash shape, and framing consistent; no real athletes, teams, logos, or watermark.\n\nComposition 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.\n\nAvoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above."
}
]
}
],
"generationConfig": {
"responseModalities": [
"TEXT",
"IMAGE"
],
"imageConfig": {
"aspectRatio": "16:9",
"imageSize": "1K"
}
}
}Hiệu suất API
gemini-3.1-flash-image Độ tin cậy và khả dụng của API
Dữ liệu đo lường yêu cầu Flatkey cho gemini-3.1-flash-image sẽ hiển thị tại đây khi có đủ lưu lượng production.
Hoạt động API
gemini-3.1-flash-image Mức sử dụng và hoạt động yêu cầu API
Theo dõi số lượng yêu cầu và hoạt động suy luận thành công của gemini-3.1-flash-image trong kỳ báo cáo gần nhất.
gemini-3.1-flash-image giá
gemini-3.1-flash-image Giá và thanh toán API
Thẻ giá hiển thị giá token đầu vào và đầu ra hiện tại của Flatkey. Giá token không phải giá cố định mỗi ảnh: thiết lập, tham chiếu và đầu ra ảnh hưởng mức dùng. Giá và hạn mức miễn phí trực tiếp của Google không tự áp dụng.
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
- /v1beta/models/gemini-3.1-flash-image:generateContent
- Cơ sở tính phí
- 1M tokens
- Số đầu ra
- 1
gemini-3.1-flash-image trình tạo ảnh AI và API: năng lực chính
Tuyến gemini-3.1-flash-image của Google hỗ trợ văn bản · ảnh. Danh mục: Marketing.
Văn bản thành ảnh
Mô tả chủ thể, bố cục, ánh sáng và chữ cần tạo. Đặt điều khiển đầu ra trong trường yêu cầu, không chỉ trong prompt.
Ảnh tham chiếu
Thêm ảnh tham chiếu và nêu phần cần giữ, cần sửa. Tuân thủ giới hạn trong bảng tham số.
Số đầu ra
Chỉ chọn tỷ lệ và kích thước có trong Playground. Flash, Flash Lite và Pro có giới hạn đầu ra khác nhau.
API
Giữ đúng ID và cấu trúc contents/parts trong ví dụ. Thử yêu cầu nhỏ trước khi chạy theo lô.
So sánh
gemini-3.1-flash-image So sánh API: năng lực và quyền truy cập
So sánh dữ kiện danh mục của gemini-3.1-flash-image với mốc thế hệ trước trước khi thay đổi tích hợp.
| Khả năng | Thế hệ trước | gemini-3.1-flash-image |
|---|---|---|
| Nhà cung cấp | Chưa xác minh trong ảnh chụp danh mục này | |
| Phương thức | Chưa xác minh trong ảnh chụp danh mục này | văn bản · ảnh |
| Ngữ cảnh | Chưa xác minh trong ảnh chụp danh mục này | Danh mục không liệt kê cửa sổ ngữ cảnh |
| Điểm cuối | Chưa xác minh trong ảnh chụp danh mục này | /v1beta/models/gemini-3.1-flash-image:generateContent |
| Tính phí | Chưa xác minh trong ảnh chụp danh mục này | $0.5/$3 per 1M tokens |
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
- 1×
- Giá trực tiếp
- $0.06
- Ước tính yêu cầu
- Giá theo mức dùng
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
gemini-3.1-flash-image- Endpoint
/v1beta/models/gemini-3.1-flash-image:generateContent
Ả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
gemini-3.1-flash-image- Endpoint
/v1beta/models/gemini-3.1-flash-image:generateContent
Tương thích tham số
Các giá trị từ cùng cấu hình mà Playground sử dụng.
aspect_ratioTỷ lệ khung hình1:1 · 2:3 · 3:2 · 3:4 · 4:3 · 4:5 · 5:4 · 9:16 · 16:9 · 21:9
Mặc định: 1:1image_sizeKích thước1K · 2K · 4K
Mặc định: 1KimageGiới hạn tham chiếu4 tệp
Endpoint: /v1beta/models/gemini-3.1-flash-image:generateContentTừ 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 gemini-3.1-flash-image cho tạo ảnh
Bắt đầu bằng prompt gemini-3.1-flash-image cho tạo ảnh, sau đó điều chỉnh các trường yêu cầu trong playground.
Tạo bằng Image 2
Scene: A 16:9 futuristic game loadout frame shows a helmeted rider beside a black-and-orange motorcycle in a rainy industrial hangar. Blue-and-orange interface controls and a circular part-selection panel sit around the vehicle. Keep the rider, motorcycle geometry, wet floor reflections, lighting direction, and selected-part position fixed for a clean equipment swap. 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.
Scene: A poolside sports broadcast catches a swimmer in a blue cap during freestyle, with one arm entering the water and a sharp splash across the lane. Use a low pool-deck camera, blue water, lane markings, and abstract blue lower-third graphics without readable text. Keep swimmer direction, splash shape, and framing consistent; no real athletes, teams, 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 metallic wireless-earbud charging case floats open above a glossy black surface while the two matching earbuds hover above their slots. Purple and cyan rim lights define the rounded metal, black interior, reflections, and empty dark background. Preserve the case, earbuds, hinge, highlights, and three-quarter camera angle. 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: A cloaked figure crouches on a rain-slick elevated walkway beneath massive futuristic bridges. Cyan fog, magenta tower lights, railings, and wet reflections lead toward the distant city. Hold the figure's silhouette, facing direction, cloak edge, camera height, and neon light placement as a cinematic storyboard keyframe. No readable signs, 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 wet green park, a man in a coral-red raincoat and yellow boots struggles with an inverted rainbow umbrella in a gust of wind. His arms brace against the bent canopy while rain streaks through the trees and puddles reflect the bright colors. Keep the umbrella shape, body pose, wind direction, and safe footing clear; no injury, readable text, logos, 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 softly faded historical dock scene shows several workers repairing a large wooden boat at a riverside boatyard. Timber ribs, scaffolding, hand tools, smaller boats, and weathered work clothes fill the wide documentary frame. Restore the wood grain, riverbank structures, faces, and natural color aging without modern objects, readable signs, logos, captions, 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 dùng API gemini-3.1-flash-image
Vì sao dùng gemini-3.1-flash-image qua Flatkey?
Dùng một gateway cho gemini-3.1-flash-image, kiểm soát tài khoản và các mô hình còn lại trong danh mục.
gemini-3.1-flash-image trong một API
Giữ rõ model ID và endpoint của gemini-3.1-flash-image trong khi dùng cùng khóa Flatkey cho các workload khác.
Giá danh mục trực tiếp
Xem đơn vị tính phí hiện tại của gemini-3.1-flash-image trước khi gửi yêu cầu, rồi xác nhận ước tính cuối trong tài khoản.
Bàn giao mô hình thực tế
Thử prompt gemini-3.1-flash-image trong playground công khai và mang cùng thiết lập vào tích hợp đã xác thực.
Kiểm soát sử dụng và định tuyến
Tập trung khóa, hạn mức và định tuyến cho gemini-3.1-flash-image mà không đổi quy trình ứng dụng hướng tới nhà cung cấp.
API
gemini-3.1-flash-image API
Bốn cách truy cập với cùng key và danh mục mô hình. Chọn một cách để xem ví dụ chạy được.
curl https://router.flatkey.ai/v1beta/models/gemini-3.1-flash-image:generateContent \ -H "Content-Type: application/json" \ -H "Authorization: Bearer sk-***" \ -d '{"model":"gemini-3.1-flash-image","contents":[{"role":"user","parts":[{"text":"Tạo ảnh sản phẩm chất lượng cao bằng gemini-3.1-flash-image: bố cục sạch, ánh sáng chính xác, tập trung rõ vào chủ thể và chi tiết chân thực."}]}],"generationConfig":{"responseModalities":["TEXT","IMAGE"],"imageConfig":{"aspectRatio":"1:1","imageSize":"1K"}}}'
Câu hỏi thường gặp
gemini-3.1-flash-image API
câu hỏi về giá, tính năng và cách dùng
Giải đáp về giá, năng lực, endpoint và giới hạn danh mục của gemini-3.1-flash-image.




