imagestringrequired
URL of the image to be segmented
meta/sam-3/imageSAM 3 Image is Meta's segmentation model. It finds objects in an image from a text, point, or box prompt and returns masks and the masked image, with optional confidence scores.
Try the model
PNG, JPEG, WebP, or GIF · 20 MiB maximum
Customize your input with more control.
Your output will appear here
Complete the inputs, then click Run.
SAM 3 segments objects in an image from a text, point, or box prompt and returns masks.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | wheel | What to segment, e.g. “the red car”. |
image | image URL, required | — | Image to segment. JPEG, PNG, or WebP URL. |
output_format | jpeg / png | png | Output file format. |
box_prompts | item[] | [] | Optional boxes. |
text_prompt | string | — | [DEPRECATED] Use 'prompt' instead. |
include_scores | boolean | false | Whether to include mask confidence scores. |
apply_mask | boolean | true | Return the masked image. |
point_prompts | item[] | [] | Optional points. |
return_multiple_masks | boolean | false | If True, upload and return multiple generated masks as defined by max_masks. |
max_masks | integer 1–32 | 3 | Maximum masks to return. |
include_boxes | boolean | false | Whether to include bounding boxes for each mask (when available). |
$0.005 per image.
| Request | Price |
|---|---|
| One image | $0.005 |
Failed runs are not charged.
Related: meta/sam-3/3d-objects.
Start building
Submit this model through the SandBase Unified Run API.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "meta/sam-3/image",
"image": "https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/notebooks/images/truck.jpg",
"prompt": "wheel",
"max_masks": 3,
"apply_mask": true,
"box_prompts": [],
"include_boxes": false,
"output_format": "png",
"point_prompts": [],
"include_scores": false,
"return_multiple_masks": false
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Create a SandBase API key and set it in your server environment. All requests use Bearer authentication.
export SANDBASE_API_KEY="YOUR_API_KEY"Keep the key on your server. Do not expose it in browser code or commit it to a repository.
POST to /v1/run with this model ID and its inputs. The request example above includes submission and polling.
Use the returned run ID to poll until the status is completed, failed or timeout. Read output only after completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Pass a publicly accessible file URL in the model’s image, video or audio field. Supported formats and limits are shown beside each Playground input.
Use the upload or replace control on supported image fields in the Playground. Video URL fields accept a hosted driving video; they do not imply video-upload support.
imagestringrequiredURL of the image to be segmented
promptstringrequiredText prompt for segmentation
Default: "wheel"
max_masksintegerMaximum number of masks to return when `return_multiple_masks` is enabled.
Default: 3
Minimum: 1
Maximum: 32
apply_maskbooleanApply the mask on the image.
Default: true
box_promptsarrayBox prompt coordinates (x_min, y_min, x_max, y_max). Multiple boxes supported - use object_id to group boxes for the same object or leave empty for separate objects.
Default: []
text_promptstring[DEPRECATED] Use 'prompt' instead. Kept for backward compatibility.
include_boxesbooleanWhether to include bounding boxes for each mask (when available).
Default: false
output_formatstringThe format of the generated image.
Default: "png"
Possible values: "jpeg", "png"
point_promptsarrayList of point prompts
Default: []
include_scoresbooleanWhether to include mask confidence scores.
Default: false
return_multiple_masksbooleanIf True, upload and return multiple generated masks as defined by `max_masks`.
Default: false
{
"model": "meta/sam-3/image",
"image": "https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/notebooks/images/truck.jpg",
"prompt": "wheel",
"max_masks": 3,
"apply_mask": true,
"box_prompts": [],
"include_boxes": false,
"output_format": "png",
"point_prompts": [],
"include_scores": false,
"return_multiple_masks": false
}A completed run exposes its result in output. The following is the model’s saved example, not a new generation.
No example output has been published yet. Use Playground → Result → JSON after a completed run to inspect your response.