Gemini 3.1 Flash Image Preview
Integra
gemini-3.1-flash-image-preview
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/gemini-3.1-flash-image-preview?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.com/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/gemini-3.1-flash-image-preview?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/gemini-3.1-flash-image-preview", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
# 1. Connect once (Claude Code; Cursor, VS Code, Claude Desktop: https://doitong.com/mt/developers/docs/mcp)
claude mcp add --transport http doitong-models https://api.doitong.com/v1/mcp \
--header "Authorization: Bearer $DOITONG_API_KEY"
# 2. Your agent calls the "run" tool with:
{
"model_id": "gemini-3.1-flash-image-preview",
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}
}
Ċempel il-mudell Gemini 3.1 Flash Image Preview (gemini-3.1-flash-image-preview) permezz tad-Doitong API. Dokumentazzjoni għall-aġenti: https://doitong.com/mt/developers/models/gemini-3.1-flash-image-preview.md
POST https://api.doitong.com/v1/run/gemini-3.1-flash-image-preview?wait=20
Authorization: Bearer $DOITONG_API_KEY
Content-Type: application/json
{
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}
Jekk l-istatus tar-rispons huwa "queued" jew "running", agħmel polling fuq GET https://api.doitong.com/v1/requests/REQUEST_ID?wait=20 sakemm ikun "succeeded"; il-fajls jinsabu f’outputs[].url. POST https://api.doitong.com/v1/quote/gemini-3.1-flash-image-preview bl-istess body jirritorna l-prezz eżatt qabel it-tħaddim.
Din it-talba: $0.08 80 krediti tal-API Ħaddmu f’din il-paġna
Iċ-ċavetta API l-ġdida tiegħek. Jintwera biss issa u diġà jinsab fil-kodiċi u fil-qasam taċ-ċavetta API hawn taħt. Żommu sigriet: qatt tpoġġih f’kodiċi li jaħdem f’browser.
Magħmul fuq Doitong
Xogħlijiet pubbliċi magħmula b’Gemini 3.1 Flash Image Preview mill-komunità ta’ Doitong. Uża prompt mill-ġdid bi klikk waħda.
Art style: Cinematic Realistic. Крупный план Джулса, который с философским видом накалывает кусок блина на вилку. Он смотрит на Винни с легким снисхождением. Винни на заднем плане выглядит взбешенным, его лицо искажено от злости. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ FINAL STYLE ENFORCEMENT...
Art style: 3D Pixar. Мальчик раскрывает упаковку и находит внутри красивую книгу с историями о приключениях. Мама сидит рядом и улыбается. Мягкий свет, радость и уют. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ FINAL STYLE ENFORCEMENT (this is the authoritative rendering directive — it overrides any...
Art style: 3D Pixar. Стойка ресепшн в дорогом отеле. Соня в униформе натянуто улыбается раздраженному гостю. Рядом стоит ее коллега с сочувствующим видом. Стиль Pixar, обстановка строгая и деловая, освещение холодное. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ FINAL STYLE ENFORCEMENT (this is the...
Art style: 3D Pixar. Взрослый персонаж опускается на одно колено перед ребенком в центре загроможденной комнаты. Она мягко касается плеча девочки, глядя ей прямо в глаза с доброй улыбкой. Вокруг них разбросаны плюшевые медведи и детали конструктора. Камера на уровне глаз персонажей, создавая...
Art style: 3D stylized animation. Девушка со светлыми волосами в черном платье стоит у красной ковровой дорожки. Ее глаза широко раскрыты от удивления, рот слегка приоткрыт. Теплое освещение падает на ее лицо. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ FINAL STYLE ENFORCEMENT (this is the...
Art style: 3D Pixar, cinematic lighting, glossy materials. Оникс и Жемчужина с маленькой белой собачкой на поводке стоят на улице перед очень богатым, современным особняком с большими окнами. Вечернее освещение, теплый свет из окон дома. 3D Pixar стиль, высокая детализация....
Art style: 3D Pixar. A cinematic close-up of a 3-year-old boy named Maxim looking guilty and clutching his stomach, large expressive eyes filled with regret, soft warm indoor lighting with a shallow depth of field. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ FINAL STYLE ENFORCEMENT (this is the...
Art style: 3D Pixar cinematic. In the same chocolate hallway, Kai, the mango boy from the poster, walks past Luna. He suddenly stops in his tracks and looks at her, completely amazed. Soft cinematic lighting, 3D Pixar style. Он с ее не сводит глаз. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ FINAL...
Art style: 3D Pixar. The romantic scene culminates in a kiss. As their lips touch, a bright golden orb of light transfers from the man's chest into Akari. His eyes, once full of love, become vacant and dull. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ FINAL STYLE ENFORCEMENT (this is the authoritative...
Art style: 3D animated cinematic style. A young boy in a navy school blazer and tie standing confidently in the dining room. He points his finger forward with a determined, defiant expression on his metallic face. The background is a blurred, elegant room with warm lighting. Navy blue, silver,...
Art style: 3D Pixar. Тесная, темная комната типичного геймера, заставленная техникой. На столе стоят два монитора, светящиеся яркими цветами запущенной игры. Повсюду видны провода, банки из-под газировки и коробки от пиццы. Камера расположена под низким углом, создавая ощущение погружения в...
Art style: Ghibli-inspired Watercolor. Glass leaf cling, outside rain ease, inside cozy. Foreground: leaf edge. Midground: slide path. Background: calm green. Cool to warm. Fading tenacity. Medium eye. Textures: vein press. Depth trail. Rain light. Micro-details: quiver micro. (132 words)...
Art style: 3D Pixar. Уютная гостиная с мягкими диванами и вышитыми подушками. Марьям сидит на полу у ног матери, положив голову ей на колени. Мама нежно гладит ее по волосам. Освещение мягкое, рассеянное, создающее атмосферу близости. Цвета: терракотовый, оливковый и золотистый. Крупный план лиц....
Art style: 3D Pixar. Стерильный медицинский кабинет с современным аппаратом УЗИ. Пациентка спокойно лежит на кушетке, Нутриэль проводит обследование датчиком в области живота. На экране монитора видны четкие анатомические структуры. Освещение прохладное, с мягким голубоватым свечением от экрана...
Art style: Cinematic Realistic. Экстремально крупный план лица Халифа. В центре внимания — его радостные глаза и пухлые щеки. Он задорно улыбается, обнажая первые зубки. Свет падает сбоку, создавая мягкие тени и подчеркивая текстуру нежной кожи. На заднем плане едва угадываются контуры золотых...
Art style: 3D Pixar. Мама обнимает мальчика в гостиной. Мальчик улыбается, мама смотрит на него с нежностью и гордостью. На фоне тёплый домашний интерьер. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ FINAL STYLE ENFORCEMENT (this is the authoritative rendering directive — it overrides any style wording...
Ibni talba
Il-kontrolli jiġu ġġenerati mill-iskema tal-mudell. Il-kodiċi u l-prezz jaġġornaw hekk kif tibdilhom.
/run/gemini-3.1-flash-image-preview?wait=20
kwotazzjoni → $0.08
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/gemini-3.1-flash-image-preview?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.com/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/gemini-3.1-flash-image-preview?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/gemini-3.1-flash-image-preview", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run",
"arguments": {
"model_id": "gemini-3.1-flash-image-preview",
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
},
"wait_seconds": 20
}
}
}
Ħaddem din it-talba
Iċ-ċavetta tiegħek tibqa’ f’dan il-browser: tintbagħat biss lid-Doitong API u tiġi ssejvjata (localStorage) biss jekk timmarka Ftakar. Ikseb ċavetta API
Dwar Gemini 3.1 Flash Image Preview
Jiġġenera immaġnijiet minn `prompt`, b’`resolution` ta’ 0.5K, 1K, 2K jew 4K u proporzjonijiet tal-aspett inkluż estremi bħal 8:1 u 1:8. `system_prompt`, `enable_web_search` u `thinking_level` fakultattivi (minimal jew high) jikkontrollaw il-ġenerazzjoni. Jipproduċi minn 1 sa 4 immaġnijiet f’PNG, JPEG jew WebP.
Parametri
Ibgħat jew l-isem kanoniku jew l-isem nattiv, mhux it-tnejn. Ismijiet kanoniċi
promptmeħtieġ
num_imagesmhux obbligatorju
num_outputs
seedmhux obbligatorju
aspect_ratiomhux obbligatorju
output_formatmhux obbligatorju
safety_tolerancemhux obbligatorju
system_promptmhux obbligatorju
resolutionmhux obbligatorju
limit_generationsmhux obbligatorju
enable_web_searchmhux obbligatorju
thinking_levelmhux obbligatorju
Output
{
"id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
"object": "request",
"model": "gemini-3.1-flash-image-preview",
"status": "succeeded",
"created_at": "2026-10-20T12:00:00Z",
"started_at": "2026-10-20T12:00:02Z",
"completed_at": "2026-10-20T12:00:09Z",
"queue_position": null,
"cost": {
"credits": 80,
"usd": "0.08",
"charged": 80,
"refunded": 0
},
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
},
"output": {
"images": [
{
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
"content_type": "image/jpeg",
"file_name": "0-output.jpeg",
"file_size": 1843200,
"width": 1024,
"height": 768
}
],
"description": "string"
},
"outputs": [
{
"type": "image",
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
"content_type": "image/jpeg",
"file_size": 1843200,
"width": 1024,
"height": 768,
"stored": true
}
],
"error": null,
"metrics": {
"inference_seconds": 6.8
},
"urls": {
"self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
"cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
}
}
Oqsma tal-output
- images
- array of object {url, content_type, file_name, file_size, width, height}Immaġnijiet prodotti mill-mudell.
- description
- stringDeskrizzjoni li takkumpanja l-immaġnijiet iġġenerati.
Varjanti oħra ta’ Gemini 3.1 Flash Image Preview
Aktar mudelli: Test għal immaġni
Għall-aġenti tal-AI: din il-paġna bħala Markdown tinsab fuq https://doitong.com/mt/developers/models/gemini-3.1-flash-image-preview.md. Il-mudelli u l-gwidi kollha: https://doitong.com/developers/llms.txt







