Gemini 3.1 Flash Image Preview
Integrar
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.ru/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.ru/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.ru/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.ru/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/rm/developers/docs/mcp)
claude mcp add --transport http doitong-models https://api.doitong.ru/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"
}
}
Cloma il model Gemini 3.1 Flash Image Preview (gemini-3.1-flash-image-preview) tras la Doitong API. Documentaziun per agents: https://doitong.com/rm/developers/models/gemini-3.1-flash-image-preview.md
POST https://api.doitong.ru/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"
}
Sche il status da la resposta è "queued" u "running", fa polling GET https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20 fin ch'el è "succeeded"; las datotecas èn en outputs[].url. POST https://api.doitong.ru/v1/quote/gemini-3.1-flash-image-preview cun il medem body returna il pretsch exact avant l'execuziun.
Questa dumonda: $0,08 80 credits API · ≈ ₽8,53 Lantschar sin questa pagina
Tia nova clav API. Quest vegn mussada mo ussa ed è gia en il code ed en il champ da la clav API sutvart. Mantegna ella secreta: na la metta mai en code che vegn exequì en in navigatur.
Fatg sin Doitong
Ovras publicas fatgas cun Gemini 3.1 Flash Image Preview da la communitad Doitong. Reutilisescha in prompt cun in clic.
Art style: Glamour 3D. A clearly recognizable likeness of Семен — keep their real face shape, skin tone, hairstyle, build and any signature look (hair, kit, number). 25лет статный 180 русые волосы зелёные глаза немного есть борода. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ FINAL STYLE ENFORCEMENT...
Art style: Cinematic Realistic. Tight medium shot. Daniel reaches out and gently places a solid reassuring hand on Mark's shoulder, giving it an affectionate squeeze. Mark looks down at the hand, then raises his eyes to meet Daniel's gaze, lingering eye contact, warm cinematic key light, soft...
Art style: 3D Pixar. Pixar 3D style, vibrant karaoke club lounge Billionaire, neon lights, glowing atmosphere. Beautiful cute animated Kazakh girl sitting with friends at a table, looking with sparkling starry eyes at a handsome charming guy sitting nearby, magical colorful ambience...
Art style: Children's Book. Full-length view, the entire figure visible from head to feet, standing upright and centered — a small, very fluffy kitten with soft downy fur in warm grey-and-cream tabby tones, faint stripes along the back and tail. It has an oversized round head, huge expressive...
Art style: Реалистичный кинематографичный. Крупный план лица женщины-эксперта, завершающей свою мысль. Она смотрит прямо в объектив, ее взгляд выражает поддержку. Волосы обрамляют лицо, создавая мягкую рамку. Детали макияжа и текстура губной помады видны отчетливо. На заднем плане огни торгового...
Art style: 3D Pixar. Артём открывает входную дверь из дома и выходит на яркую, оживленную и красочную городскую улицу, наполненную энергией и солнечным светом. Артем одет в дорогой классический черный костюм. Стиль Pixar, оптимистичное настроение, широкоугольный объектив....
Art style: 3D Pixar. Тесная ночная комната на верхнем этаже старого дома, окно приоткрыто, за стеклом мерцают далёкие городские огни и влажные крыши после дождя, стол завален радиодеталями, проводами, блокнотами и старым приёмником. Средний план с лёгкого верхнего угла, камера смотрит на Леру у...
Школьный коридор после уроков, на заднем плане видны уходящие ученики. Рома стоит у стены, его рубашка надорвана, под глазом начинает проступать синяк. Он сжимает кулаки, глядя в пол. Освещение — резкий свет из окна, подчеркивающий его гнев и обиду. Композиция на уровне глаз ребенка, передающая...
Art style: Cinematic Realistic. Мудрэо медленно встает с трона, опираясь на свой посох. Вся пещера внезапно заливается ярким, благодатным светом множества невидимых огней. Фигура старца выглядит величественно и умиротворенно. Камера — общий план, вид сверху, показывающий все пространство пещеры....
Art style: 3D Pixar. Крупный план лица мамы. Ее глаза широко распахнуты, рот приоткрыт в безмолвном шоке. Стакан с соком на подносе начинает опасно наклоняться. Комичное, преувеличенное выражение ужаса в стиле Pixar. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ FINAL STYLE ENFORCEMENT (this is the...
Art style: Кинематографичный, реалистичный, теплые тона. Александр с напряженным лицом поднимает тяжелую штангу в домашнем спортзале. Солнечный свет падает через окно, подчеркивая его мускулы. Стиль: кинематографичный, реалистичный. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ FINAL STYLE ENFORCEMENT...
Strong rule: style --- Cinematic Realistic ---. A tall rigid woman in her 50s, ice-pale skin, silver-white hair pulled back severely, sharp pale grey eyes. Dressed in formal dark charcoal robes with stiff high collar. Posture perfectly upright, expression permanently disapproving. Icy ceremonial...
Art style: 3D-анимация, стилизованная под арты из игр сери.... Азамат стоит перед Айсулуу в типичном бишкекском дворике. На экране появляется интерфейс в стиле GTA: 'НОВАЯ МИССИЯ: Курут Безумия'. Освещение вечернее, длинные тени. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ FINAL STYLE ENFORCEMENT...
Art style: 3D-анимация, стилизованная под арты из игр сери.... Азамат отдает пакет огромному молчаливому вышибале. Тот, не говоря ни слова, протягивает Азамату взамен один-единственный старый, ржавый ключ. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ FINAL STYLE ENFORCEMENT (this is the authoritative...
Strong rule: style --- high-detail 3D fantasy anime, Chinese donghua, ... ---. Молодая женщина 20-25 лет, неземная красота в стиле high-fantasy 3D anime. Длинные, как жидкий шелк, серебристо-белые волосы. Идеальная фарфоровая кожа, светящаяся в лунном свете. Нежное, аристократичное лицо с тонкими...
Art style: 3D Pixar animation, high quality, vibrant color.... Pixar style. A cramped, dull grey office cubicle. Sasha is sitting at her desk, looking extremely tired and frustrated. Huge, exaggerated mountains of paperwork are piled up around her. Fluorescent lighting....
Construir ina dumonda
Ils controls vegnan generads dal schema dal model. Il code e il pretsch s'actualiseschan durant che ti als midas.
/run/gemini-3.1-flash-image-preview?wait=20
calculaziun → $0,08
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/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.ru/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.ru/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.ru/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
}
}
}
Executar questa dumonda
Tia clav resta en quest browser: ella vegn tramessa mo al Doitong API e memorisada (localStorage) mo sch'ella scheccas Tiar a memoria. Obtegnair ina clav API
Davart Gemini 3.1 Flash Image Preview
Generescha maletgs dad in `prompt`, cun `resolution` da 0.5K, 1K, 2K u 4K e relaziuns d'aspect inclus extremas sco 8:1 e 1:8. `system_prompt`, `enable_web_search` e `thinking_level` opziunals (minimal u high) furman la generaziun. Producescha 1 fin a 4 maletgs en PNG, JPEG u WebP.
Parameters
Invia u il num canonic u il num nativ, betg omaduas. Nums canonics
promptobligatori
num_imagesopziunal
num_outputs
seedopziunal
aspect_ratioopziunal
output_formatopziunal
safety_toleranceopziunal
system_promptopziunal
resolutionopziunal
limit_generationsopziunal
enable_web_searchopziunal
thinking_levelopziunal
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.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
"cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
}
}
Champs da l'output
- images
- array of object {url, content_type, file_name, file_size, width, height}Maletgs producids dal model.
- description
- stringDescripziun che accumpogna ils maletgs generads.
Autras variantes Gemini 3.1 Flash Image Preview
Dapli models: Text a maletg
Per agents AI: questa pagina sco Markdown è disponibla sut https://doitong.com/rm/developers/models/gemini-3.1-flash-image-preview.md. Tut ils models e las guidas: https://doitong.com/developers/llms.txt







