Gemini 3.1 Flash Image Preview · Edit
Integrar
gemini-3.1-flash-image-preview/edit
# 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/edit?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/edit?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/edit", 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/pt-PT/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/edit",
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}
}
Chame o modelo Gemini 3.1 Flash Image Preview · Edit (gemini-3.1-flash-image-preview/edit) através da Doitong API. Documentação para agentes: https://doitong.com/pt-PT/developers/models/gemini-3.1-flash-image-preview/edit.md
POST https://api.doitong.com/v1/run/gemini-3.1-flash-image-preview/edit?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"
}
Se o estado da resposta for "queued" ou "running", consulte GET https://api.doitong.com/v1/requests/REQUEST_ID?wait=20 repetidamente até ficar "succeeded"; os ficheiros estão em outputs[].url. POST https://api.doitong.com/v1/quote/gemini-3.1-flash-image-preview/edit com o mesmo corpo devolve o preço exato antes da execução.
Este pedido: 0,08 $ 80 créditos da API Executar nesta página
A sua nova chave de API. É apresentada apenas agora e já está inserida no código e no campo da chave de API abaixo. Mantenha-a secreta: nunca a coloque em código que seja executado num navegador.
Criado na Doitong
Trabalhos públicos criados com Gemini 3.1 Flash Image Preview pela comunidade Doitong. Reutilize um prompt com um clique.
Strong rule: style --- 3D Pixar ---. Деревянный стол на веранде, заваленный тарелками с овощами, фруктами и тарелкой с сосисками. Максим тянется за абрикосом, Катя пытается налить сок, всё выглядит хаотично. Камера — вид сверху, композиция «флэтлей». Освещение — яркий свет, проходящий сквозь...
Strong rule: style --- 3D Pixar ---. Высокий скалистый берег, омываемый бурными волнами глубокого темно-синего цвета. На вершине скалы стоит Певец, его фигура занимает центральную часть кадра. Камера снимает со среднего плана, чуть снизу вверх, чтобы подчеркнуть значимость момента. Солнце...
Strong rule: style --- 3D Pixar ---. Молодая девушка около 22 лет с яркими, выразительными карими глазами и копной каштановых вьющихся волос, собранных в небрежный пучок. На ней стильные очки в тонкой золотистой оправе и уютный оверсайз-худи пастельно-фиолетового цвета. Лицо отражает...
Strong rule: style --- 3D Pixar ---. Маленький йоркширский терьер с длинной шелковистой шерстью стального и золотистого окраса. На макушке аккуратный хвостик с крошечным красным бантиком. У собаки блестящие черные глаза-бусинки и влажный нос. Она выглядит очень энергичной и любопытной. Стиль —...
Strong rule: style --- 3D Pixar ---. Вечерний сад в лучах заходящего солнца. Анна сидит на ступеньках крыльца, прислонившись к перилам, на её коленях спит уставший Буня. Рядом на траве сидят дети, прислонившись друг к другу. Камера — общий план, широкий угол. Освещение — теплый оранжево-розовый...
Strong rule: style --- 3D Pixar ---. Низкий ракурс: Буня стремительно убегает по дорожке, сжимая в зубах длинную сосиску. В расфокусе на заднем плане видны бегущие за ним ноги Анны и детей. Камера направлена вслед собаке. Освещение — длинные тени от вечернего солнца. Атмосфера веселой погони....
Strong rule: style --- 3D Pixar ---. Ярко-голубой надувной бассейн посреди зеленого газона. Катя и Максим замерли в прыжке над водой, их тела напряжены, на лицах восторг. Камера с низкого ракурса, широкоугольный объектив. Освещение — ослепительное полуденное солнце, создающее блики на воде....
Strong rule: style --- 3D Pixar ---. Уютный уголок сада с деревянным шезлонгом под раскидистой яблоней. На маленьком столике рядом стоит стакан лимонада со льдом и лежит раскрытая книга. На заднем плане виднеется аккуратный дачный домик с белыми ставнями. Камера под углом 45 градусов, средний...
Strong rule: style --- 3D Pixar ---. Женщина 38 лет с добрым, но слегка уставшим лицом, красные волосы собраны в небрежный пучок. Она одета в практичные черные шорты и в белой футболки и садовые перчатки. Образ дополнен небольшими серьгами-гвоздиками. Стиль фотографии — современный реализм,...
Strong rule: style --- 3D Pixar ---. Мальчик 9 лет с короткими взъерошенными русыми волосами и задорными веснушками на носу. Одет в ярко-синие плавательные шорты с рисунком пальм. У него худощавое телосложение, на лице широкая беззубая улыбка, выражающая полный восторг. Глаза светлые, искрящиеся...
Strong rule: style --- 3D Pixar ---. Силуэт Певца на фоне огромного заходящего солнца. Он стоит в профиль, голова гордо поднята. Камера на дальнем плане. Небо окрашено в невероятные оттенки огненно-рыжего, пурпурного и глубокого синего. Солнце выглядит как огромный светящийся шар. Атмосфера...
Strong rule: style --- 3D Pixar ---. Анна стоит посреди цветочной клумбы с маленькой тяпкой в руках, она вся мокрая, с её шляпы капает вода. Сбоку в кадр входит струя воды из садового шланга. Камера — средний план, фронтальный ракурс. Освещение яркое, контрастное. Лицо Анны выражает комичное...
Strong rule: style --- 3D Pixar ---. На горизонте появляется старинный парусник с ярко-алыми парусами, освещенный ярким солнцем. Он скользит по синей глади воды, оставляя за собой белый след. Камера снимает с уровня воды, глядя в сторону корабля. Цвета невероятно насыщенные: глубокая синева моря...
Strong rule: style --- 3D Pixar ---. Подводный мир в лазурных тонах. Лучи солнца пронзают толщу воды, создавая танцующие световые столбы (каустику) на песчаном дне. Камера находится под водой, снимая снизу вверх. Видны косяки мелких серебристых рыб и медленно колышущиеся водоросли. Атмосфера...
Strong rule: style --- 3D Pixar ---. Стилизованный молодой мужчина около 30 лет с округлым лицом и светлой кожей. У него светло-каштановые волосы средней длины, разделенные на прямой пробор, и выразительные большие голубые глаза за очками в широкой черной оправе. На лице аккуратная бородка и...
Strong rule: style --- 3D Pixar ---. Стилизованный молодой мужчина около 30 лет с округлым лицом и светлой кожей. У него светло-каштановые волосы средней длины, разделенные на прямой пробор, и выразительные большие голубые глаза за очками в широкой черной оправе. На лице аккуратная бородка и...
Criar um pedido
Os controlos são gerados a partir do esquema do modelo. O código e o preço são atualizados à medida que os altera.
/run/gemini-3.1-flash-image-preview/edit?wait=20
cotação → 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/edit?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/edit?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/edit", 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/edit",
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
},
"wait_seconds": 20
}
}
}
Executar este pedido
A sua chave permanece neste navegador: é enviada apenas para a Doitong API e guardada em localStorage apenas se selecionar Lembrar. Obter uma chave de API
Sobre Gemini 3.1 Flash Image Preview · Edit
Edita imagens com um `prompt`, utilizando `image_urls` e, opcionalmente, `video_url`, `audio_url` ou `pdf_url` como contexto (cada um limitado a 15MB). Suporta `resolution` de 0.5K a 4K, proporções extremas, pesquisa web, um `system_prompt` e `thinking_level`. Devolve 1 a 4 imagens editadas.
Parâmetros
Envie o nome canónico ou o nome nativo, não ambos. Nomes canónicos
promptobrigatório
num_imagesopcional
num_outputs
seedopcional
aspect_ratioopcional
output_formatopcional
safety_toleranceopcional
image_urlsopcional
images
system_promptopcional
resolutionopcional
video_urlopcional
video
audio_urlopcional
audio
pdf_urlopcional
limit_generationsopcional
enable_web_searchopcional
thinking_levelopcional
Os parâmetros de ficheiro aceitam um URL https:// público, um URI data: até 10 MB ou o file_url de um carregamento. Ficheiros
Resultado
{
"id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
"object": "request",
"model": "gemini-3.1-flash-image-preview/edit",
"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"
}
}
Campos do resultado
- images
- array of object {url, content_type, file_name, file_size, width, height}Imagens resultantes da edição.
- description
- stringDescrição que acompanha as imagens geradas.
Outras variantes de Gemini 3.1 Flash Image Preview
Mais modelos: Edição de imagem
Para agentes de IA: esta página em Markdown está disponível em https://doitong.com/pt-PT/developers/models/gemini-3.1-flash-image-preview/edit.md. Todos os modelos e guias: https://doitong.com/developers/llms.txt






