Moondream3 Preview [Segment]
統合
moondream3-preview/segment
# 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/moondream3-preview/segment?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
"object": "fox"
}'
# 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/moondream3-preview/segment?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
"object": "fox"
}),
});
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 = {
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
"object": "fox",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/moondream3-preview/segment", 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/ja/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": "moondream3-preview/segment",
"input": {
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
"object": "fox"
}
}
Doitong APIを通じてMoondream3 Preview [Segment]モデル(moondream3-preview/segment)を呼び出します。エージェント向けドキュメント: https://doitong.com/ja/developers/models/moondream3-preview/segment.md
POST https://api.doitong.ru/v1/run/moondream3-preview/segment?wait=20
Authorization: Bearer $DOITONG_API_KEY
Content-Type: application/json
{
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
"object": "fox"
}
レスポンスのステータスが"queued"または"running"の場合、"succeeded"になるまでGET https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20をポーリングしてください。ファイルはoutputs[].urlにあります。同じボディでPOST https://api.doitong.ru/v1/quote/moondream3-preview/segmentを実行すると、実行前の正確な価格が返されます。
このリクエスト: ≈$0.003 3 APIクレジット · ≈ ₽0.32 このページで実行
新しいAPIキーです。 これは今だけ表示され、コードと下記のAPIキー欄にすでに入力されています。秘密にしてください。ブラウザで実行されるコードに決して含めないでください。
最初の結果がここに表示されます
以下でリクエストを作成し、APIキーで実行してください。出力はストレージにコピーされ、永久保存または無料で7日保存されます。
リクエストを作成
コントロールはモデルスキーマから生成されます。値を変更するとコードと価格が更新されます。
/run/moondream3-preview/segment?wait=20
見積もり → $0.003
# 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/moondream3-preview/segment?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
"object": "fox"
}'
# 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/moondream3-preview/segment?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
"object": "fox"
}),
});
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 = {
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
"object": "fox",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/moondream3-preview/segment", 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": "moondream3-preview/segment",
"input": {
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
"object": "fox"
},
"wait_seconds": 20
}
}
}
Moondream3 Preview [Segment]について
`image_url`の画像内で、`object`に指定した対象をセグメント化します。結果にはマスク画像、バウンディングボックス、SVGパスデータを含められ、何も検出されない場合はnullです。`spatial_references`でセグメンテーションの指針となるポイントを指定でき、`settings`でサンプリングを調整します。`preview`を設定するとバイナリマスクを取得できます。
パラメータ
正式名称またはネイティブ名のいずれか一方を送信してください。両方は送信しないでください。 正式名称
image_url必須
image
object必須
spatial_references任意
settings任意
settings.temperature任意
settings.top_p任意
settings.max_tokens任意
preview任意
ファイルパラメータには、公開されたhttps:// URL、10 MBまでのdata: URI、またはアップロードしたファイルのfile_urlを指定します。 ファイル
出力
{
"id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
"object": "request",
"model": "moondream3-preview/segment",
"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": 3,
"usd": "0.003",
"charged": 3,
"refunded": 0
},
"input": {
"image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
"object": "fox"
},
"output": {
"finish_reason": "stop",
"usage_info": {
"input_tokens": 1,
"output_tokens": 1,
"prefill_time_ms": 1.0,
"decode_time_ms": 1.0,
"ttft_ms": 1.0
},
"image": {
"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
},
"path": "M.657,.996C.610,.984,.529,.938,.447,.875C.411,.848,.363,.815,.341,.802C.188,.714,.093,.623,.038,.511C.011,.455,.000,.406,.000,.340C.000,.269,.006,.234,.025,.186C.051,.123,.092,.079,.161,.042C.240,-0.000,.355,-0.011,.433,.017C.462,.027,.535,.066,.571,.091C.701,.180,.807,.265,.850,.311C.911,.379,.962,.468,.984,.545C.995,.585,.997,.601,.997,.664C.997,.765,.984,.811,.935,.879C.878,.958,.796,1.001,.705,1.000C.685,.999,.664,.998,.657,.996z",
"bbox": {
"x_min": 1.0,
"y_min": 1.0,
"x_max": 1.0,
"y_max": 1.0
}
},
"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"
}
}
出力フィールド
- finish_reason
- string出力生成が終了した理由。
- usage_info
- object {input_tokens, output_tokens, prefill_time_ms, decode_time_ms, ttft_ms}リクエストの使用状況の詳細。
- image
- object {url, content_type, file_name, file_size, width, height} | nullセグメンテーションのプレビュー結果。プレビュー生成がリクエストされていない場合、または物体検出で何も見つからなかった場合は null、それ以外の場合はマスクを含む画像です。
- path
- string | nullセグメンテーションマスクが検出された場合に返されるSVGパスデータ。それ以外の場合は null。
- bbox
- object {x_min, y_min, x_max, y_max} | null検出・セグメンテーションされたオブジェクトのバウンディングボックス。それ以外の場合は null。
その他のMoondream3 Previewバリアント
その他のモデル: 画像編集
AIエージェント向け:このページのMarkdown版はこちらです: https://doitong.com/ja/developers/models/moondream3-preview/segment.md. すべてのモデルとガイド: https://doitong.com/developers/llms.txt






