GPT Image 2 API · Edit
ᠵᡠᠸᡝᠪᡠᠮᠪᡳ
openai/gpt-image-2/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/openai/gpt-image-2/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",
"images": [
"https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
]
}'
# 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/openai/gpt-image-2/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",
"images": [
"https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
]
}),
});
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",
"images": [
"https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
],
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/openai/gpt-image-2/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/mnc/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": "openai/gpt-image-2/edit",
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
"images": [
"https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
]
}
}
GPT Image 2 API · Edit ᠮᠣᠳᡝᠯ (openai/gpt-image-2/edit) ᠪᡝ Doitong API ᠵᠠᠯᡳᠨᡩᡝ ᠠᠰᡠᠮᠪᡳ. ᠠᡤᡝᠨᡨᡳ ᡩᠠᡳᠯᠠᠨ: https://doitong.com/mnc/developers/models/openai/gpt-image-2/edit.md
POST https://api.doitong.com/v1/run/openai/gpt-image-2/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",
"images": [
"https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
]
}
ᡝᡵᡝᠮᡝ ᠪᡠᠮᡝᠨᡳ ᠠᠨᠠᠮᡝ "queued" ᡳᠨᡠ "running" ᠪᡝ, GET https://api.doitong.com/v1/requests/REQUEST_ID?wait=20 ᠪᡝ ᠠᠨᠠᠮᡝ "succeeded" ᠪᡝᠴᡳ ᠠᠰᡠᠮᠪᡳ; ᡶᡳᠯᡝ ᠪᡝ outputs[].url ᠪᡝᠴᡳ ᠣᠨᡩᠣᠮᡝ. POST https://api.doitong.com/v1/quote/openai/gpt-image-2/edit ᠪᡝ ᡝᠮᡠ ᠪᡠᠶᡝᠮᡝ ᠪᡝ ᠠᠰᡠᠮᠪᡳᡩᡝ ᠵᠠᠯᡤᠠᠨ ᠪᡝ ᠶᠠᠪᡠᠮᠪᡳ ᠰᡳᠨᡳ ᠠᠮᡤᠠ ᠠᠰᡠᠮᠪᡳ ᠣᠯᡥᠣᠮᡝ.
ᡝᠨᡳ ᠵᠠᠯᡳᠨ: ≈$0.222 222 API ᠺᠷᡝᡩᡳᠲ ᡝᡵᡝ ᠵᠠᠯᡳᠨᡩᡝ ᠠᠰᡠᠮᠪᡳ
ᠰᡳᠨᡳ ᠵᠠᠮᡠᠰᡳᠨ API ᠵᡳᡵᡤᠠ. ᡝᠯᡝ ᡝᠨᡩᡝ ᡳᠯᡤᠠᠮᠪᡳ ᡝᡵᡝ ᠮᡠᠨᡩᡝ ᡴᠣᡩᡝ ᡩᠠᠮᡠ ᠮᡝᠨᡩᡝᡵᡝ ᠪᠠᡩᡝᠯᡝᠨ ᠠᠮᡪᡳ ᡳᠨᡠ API ᠵᡳᡵᡤᠠ ᡩᡝᠪᡨᡝᡵᡝ ᡩᡝ ᠠᡴᡠ᠉ ᡳᠨᡠ ᡝᡵᡝᠩᡤᡝ ᠠᠮᠪᠠᠨ ᠮᡠᠨᡩᡝ ᠪᡝ ᠠᠰᡠᡵᠠᠮᠪᡳ: ᠮᡠᡵᡝ ᡩᠠᠮᡠ ᠪᡠᠶᡝᡵᡝ ᠪᠠᡩᡝᠯᡝᠨ ᡩᡝ ᠰᡳᠨᡩᡝᠮᡝ ᠠᠪᡠᠮᡝ ᠰᠠᠮᡪᡳ᠉
Doitong ᡩᡝ ᠪᡠᠶᡝᠮᡝ
Doitong ᡤᡝᠮᡠᠨᡳ GPT Image 2 API ᡩᡝ ᠵᠠᠯᠠᠨ ᠪᡠᠶᡝᠮᡝ᠈ ᡳᠨᡳ ᡤᡳᠰᡠᠨ ᡝᠮᡠ ᡤᡳᠯᠠᠨ ᡩᡝ ᡩᠠᡵᠠᠮᡝ
Art style: Реалистичный кулинарный блог. Финальный кадр, средний план ведущей. Она улыбается своей самой широкой и дружелюбной улыбкой, глядя в камеру. Она делает призывающий жест руками, словно приглашая к общению. Перед ней на столе по-прежнему лежат аппетитные булочки. Освещение становится...
Grungy analog photo of Daphne Blake (from Serial scooby doo) watching her own movie on a 90s CRT TV in a dimly lit bedroom. The TV clearly shows animated scene from scooby doo, with a cartoon-style Daphne in her classic clothes on screen, smiling. Daphne Blake is sitting cross-legged on the floor...
Fotografia realistica scattata dall’interno di un appartamento situato a un piano abbastanza alto, guardando verso il basso attraverso una finestra aperta su una normale strada cittadina. In strada, una folla numerosa di manifestanti avanza compatta; alcune persone indossano passamontagna. Sul...
Art style: Disney-inspired. Золушка walking further back in the frame; Косметолог standing in the near foreground. The couch and strip of reflective floor separate them. Золушка is walking on glossy floor near the open doorway further back in the frame in the midground. Torso in three-quarter...
Art style: Реалистичный кулинарный блог. Экстремально крупный план рук ведущей, разламывающих готовую, горячую булочку. Булочка имеет аппетитную золотисто-коричневую корочку, густо посыпанную поджаренным кунжутом. В месте разлома видна пористая, воздушная и очень мягкая текстура мякиша...
Art style: Реалистичный кулинарный блог. Финальный кадр, средний план ведущей. Она улыбается своей самой широкой и дружелюбной улыбкой, глядя в камеру. Она делает призывающий жест руками, словно приглашая к общению. Перед ней на столе по-прежнему лежат аппетитные булочки. Освещение становится...
Square album cover for an energetic house dance single. A dancing crowd silhouette in a night club under warm orange and golden stage lights, flying sparks and flames rising from the dance floor, misty Scottish highland mountains faintly visible in the glowing background. Bold modern clean...
Medium shot of launch team executives in smart casual blazers over plain t-shirts, sitting in a modern conference room facing a large display showing the 'International AI Safety Report' document title from February 2026, professional lighting. Context markers: smart casual blazer, plain t-shirt,...
Art style: DreamWorks-inspired. Zolushka lying in the middle ground; kosmetolog leaning further back in the frame. Zolushka is lying on белая кушетка in the middle ground in the foreground. Head facing camera. Eyes on потолок. Руки вне фокуса вдоль тела. Усталость и бессилие. Zolushka wears образ...
Use facial feature of attached photo. A realistic portrait of a woman with black hair loosely tied back, sitting outside a whitewashed stone house with a conical roof in a quiet Italian village. She wears a soft yellow floral summer dress with puff sleeves and white strappy heels. A wicker basket...
Art style: Кинематографичный, реалистичная съемка. Узкая улочка в Мумбаи ранним утром. В воздухе висит легкий туман. Арджун, молодой человек, стоит у небольшой чайной будки. Он держит стаканчик с чаем и широко улыбается, только что угостив всех вокруг. Атмосфера теплая и дружеская....
Real photo retouching of existing room, medium warm grey walls, white rectangular panel wall mouldings in classic grid pattern, same moulding layout as original photo, warm oak hardwood plank floor, brass gold straight track lighting rail on white ceiling with multiple adjustable spotlights,...
2D flat animation character design reference sheet for an advanced AI assistant avatar, hybrid of The Simpsons and lo-fi indie cartoon. Use the attached visual reference as the primary shape guide for head construction, optics, and premium engineering vibe. Clear black outlines (not too thick),...
Art style: Реалистичный кулинарный блог. A clearly recognizable likeness of Ведущая — keep their real face shape, skin tone, hairstyle, build and any signature look (hair, kit, number). Молодая женщина лет 38-41 с темными каштановыми волосы длинные распущенные по плечам вниз легкий макияж, одета...
Art style: Реалистичная китайская дорама, кинематографичная съёмка, живые городские локации, выразительные крупные планы; драматический абсурд с комедийными паузами. Атмосфера шумного китайского рынка и старых улочек. Музыкальная подложка — китайские народные мотивы, переходящие от лёгких и...
Art style: 3d pixar. Пара идет за руки по узкой грунтовой дороге, камера спереди. На спине женщины на рюкзаке закреплен огромный слегка закругленный камень над головой на рюкзаке с четкой надписью 'РАБОТА'. Мужчина несет в руках точно такой же камень как у женщины камень с такой же надписью....
ᡤᡳᠰᡠᠨ ᠪᡠᠶᡝᠮᡝ
ᠵᠠᡴᡠᠨᡳ ᠵᡠᠯᡝ ᡩᡝᡵᡤᡳ ᡩᡝᠪᡝᠰᡠᠮᡝ ᠵᡠᠯᡤᡝ ᠪᡠᠶᡝᠮᡝ᠈ ᡳᠨᡳ ᡤᡳᠰᡠᠨ ᠪᠠᡳ ᡝᠨᡝᠩᡤᡳ ᠠᠮᠪᡳ
/run/openai/gpt-image-2/edit?wait=20
ᠵᠠᠯᡳᠨ → $0.222
# 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/openai/gpt-image-2/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",
"images": [
"https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
]
}'
# 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/openai/gpt-image-2/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",
"images": [
"https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
]
}),
});
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",
"images": [
"https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
],
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/openai/gpt-image-2/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": "openai/gpt-image-2/edit",
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
"images": [
"https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
]
},
"wait_seconds": 20
}
}
}
ᡝᠨᡳ ᠵᠠᠯᡳᠨ ᠪᡝ ᠵᠠᠯᠠᠨᠠᠮᡝ
ᡳᠨᡝ ᠵᠠᠯᠠᠨ ᡝᡵᡝ ᠪᡠᡵᡝᠪᡝᡵᡳ ᡩᡝ ᠪᡳᠮᡝ᠈ Doitong API ᡩᡝ ᠵᡝᠯᡤᡳ ᡩᠠᡵᠠᠮᡝ᠈ Remember ᠵᡠᠯᡝᠮᡝ ᡤᡳᠯᠠᠮᡝ localStorage ᡩᡝ ᠰᡠᠯᡝᠮᡝ ᠪᡳᠮᡝ API ᠵᠠᠯᠠᠨ ᠠᠪᠠᠮᡝ
GPT Image 2 API · Edit ᡠᡵᡝᠮᡝ
ᡳ ᠵᠠᠰᠠᠮᠪᡳ ᠠᠴᠠ 16 URL ᡳ `image_urls` ᡩᡝ, 32000 ᡩᡝᡵᡳ ᠵᠠᠯᠠᠨ ᡳ ᡥᡡᠯᡥᠠᠨ ᡩᡝ ᡮᡳᠨᠠᠮᠪᡳ. `mask_url` ᡳ ᠵᠠᠰᠠᠮᠪᡳ ᡩᡝ ᠵᡠᠰᡝᠨ ᡳ ᡝᠮᡤᡳᠯᡝᠨ. `image_size` ᡳ ᡝᠮᡠ ᠠᠴᠠ auto ᡩᡝ ᡳᠯᡥᠠᠮᠪᡳ. ᠰᠠᠶᠠᠨ auto ᠠᠴᠠ high, 4 ᡳᠯᡥᠠᠮᠪᡳ png, jpeg ᠠᠴᠠ webp.
ᠵᠠᡴᡠᠨ
ᠵᠠᡴᡠᠨᡳ ᡤᡳᠰᡠᠨ ᠵᡝᠯᡤᡳ ᠠᠪᠠᠮᠪᡳ᠈ ᠨᡝᠮᡝ ᠮᡠᠰᡝ ᡠᠯᠠᠮᠪᡳ ᠵᠠᡴᡠᠨᡳ ᡤᡳᠰᡠᠨ
promptᡴᠠᠷᠠᡴᡡ
image_urlsᡴᠠᠷᠠᡴᡡ
images
image_sizeᠵᡠᠯᡝ
backgroundᠵᡠᠯᡝ
qualityᠵᡠᠯᡝ
num_imagesᠵᡠᠯᡝ
num_outputs
output_formatᠵᡠᠯᡝ
enable_safety_checkerᠵᡠᠯᡝ
mask_urlᠵᡠᠯᡝ
mask
ᠪᡠᠮᠪᡳᠯᡝᠰᡝ ᡝᠮᡠ ᡤᡝᠮᡠᠨᡳ https:// URL᠈ 10 MB ᡩᡝ ᡩᡝᠷᡤᡳ data: URI ᠵᡝᡵᡤᡳ ᡝᠮᡝ᠈ ᡳᠨᡝ ᠪᡠᠮᠪᡳᠯᡝᠰᡝᠨᡳ file_url ᠠᠪᠠᠮᠪᡳ ᠪᡠᠮᠪᡳ
ᠪᡠᠶᡝᠮᡝ
{
"id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
"object": "request",
"model": "openai/gpt-image-2/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": 222,
"usd": "0.222",
"charged": 222,
"refunded": 0
},
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
"image_urls": [
"https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
]
},
"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
}
]
},
"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"
}
}
ᠪᡠᠶᡝᠮᡝᠨᡳ ᡤᡳᠰᡠᠨ
- images
- array of object {url, content_type, file_name, file_size, width, height}ᠮᠣᡩᡝᠯ ᠪᡠᠶᡝᠮᡝᠨᡳ ᠤᠯᡥᠠᠨ ᠤᠨᠠᠰᡳᠨ᠉
ᡝᠯᡤᡳ GPT Image 2 API ᡠᠯᡤᡳᠨ
ᡝᠯᡤᡳ ᡩᠠᠯᡳᠨ: ᡤᠠᠳᠠᠨ ᠵᠠᠰᡳᠨ
AI ᠠᡤᡝᠨᡨᡳ ᡠᠴᡠᠷᡳ᠈ ᡝᡵᡝ ᡩᡝᠪᡝᡵᡳ Markdown ᠰᡳᠨᡩᠠᡵᡳ https://doitong.com/mnc/developers/models/openai/gpt-image-2/edit.md. ᡝᡵᡝ ᠮᠣᡩᡝᠯ ᠵᠠᡴᡠᠨ ᠰᡠᠯᡠᠮᡝ https://doitong.com/developers/llms.txt






