Gemini 3.1 Flash Image Preview
یکپارچهسازی
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/fa/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"
}
}
مدل Gemini 3.1 Flash Image Preview (gemini-3.1-flash-image-preview) را از طریق Doitong API فراخوانی کنید. مستندات عاملها: https://doitong.com/fa/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"
}
اگر وضعیت پاسخ "queued" یا "running" است، GET https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20 را تا زمانی که وضعیت "succeeded" شود بهطور دورهای فراخوانی کنید؛ فایلها در outputs[].url قرار دارند. ارسال POST https://api.doitong.ru/v1/quote/gemini-3.1-flash-image-preview با همان بدنه، قیمت دقیق را پیش از اجرا برمیگرداند.
این درخواست: $۰٫۰۸ ۸۰ اعتبار API · ≈ ₽۸٫۵۳ اجرای آن در این صفحه
کلید API جدید شما. این کلید فقط همین حالا نمایش داده میشود و از قبل در کد و فیلد کلید API زیر قرار گرفته است. آن را محرمانه نگه دارید: هرگز آن را در کدی که در مرورگر اجرا میشود قرار ندهید.
ساختهشده در Doitong
آثار عمومی ساختهشده با Gemini 3.1 Flash Image Preview توسط جامعه Doitong. یک پرامپت را با یک کلیک دوباره استفاده کنید.
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....
ساخت درخواست
کنترلها از شِمای مدل تولید میشوند. با تغییر آنها، کد و قیمت بهروزرسانی میشوند.
/run/gemini-3.1-flash-image-preview?wait=20
قیمت → $۰٫۰۸
# 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
}
}
}
اجرای این درخواست
کلید شما در این مرورگر باقی میماند: فقط به Doitong API ارسال میشود و فقط در صورت فعالکردن گزینه «یادآوری»، در localStorage ذخیره میشود. دریافت کلید API
درباره Gemini 3.1 Flash Image Preview
از یک `prompt` تصویر تولید میکند؛ `resolution` میتواند 0.5K، 1K، 2K یا 4K باشد و نسبتهای تصویر شامل نسبتهای بسیار گستردهای مانند 8:1 و 1:8 هستند. `system_prompt`، `enable_web_search` و `thinking_level` اختیاری (minimal یا high) تولید را شکل میدهند. 1 تا 4 تصویر در PNG، JPEG یا WebP تولید میکند.
پارامترها
نام استاندارد یا نام بومی را ارسال کنید، نه هر دو. نامهای استاندارد
promptالزامی
num_imagesاختیاری
num_outputs
seedاختیاری
aspect_ratioاختیاری
output_formatاختیاری
safety_toleranceاختیاری
system_promptاختیاری
resolutionاختیاری
limit_generationsاختیاری
enable_web_searchاختیاری
thinking_levelاختیاری
خروجی
{
"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"
}
}
فیلدهای خروجی
- images
- array of object {url, content_type, file_name, file_size, width, height}تصاویر تولیدشده توسط مدل.
- description
- stringتوضیح همراه تصاویر تولیدشده.
گونههای دیگر Gemini 3.1 Flash Image Preview
مدلهای بیشتر: متن به تصویر
برای عاملهای هوش مصنوعی: این صفحه بهصورت Markdown در دسترس است https://doitong.com/fa/developers/models/gemini-3.1-flash-image-preview.md. همه مدلها و راهنماها: https://doitong.com/developers/llms.txt







