# SAM 3 > SAM 3 is a unified foundation model for promptable segmentation in images and videos. ## Overview - **Endpoint**: `https://api.runflow.io/v1/run/meta/sam-3/image` - **Model ID**: `meta/sam-3/image` - **Provider**: Meta - **License**: commercial - **Last Updated**: 2026-04-05 ## Pricing - **Base price**: $0.005/image - **Note**: Usage-based, per image ## Input Schema ### `prompt` (string, optional) Text prompt for segmentation - **Default**: `wheel` ### `include_boxes` (boolean, optional) Whether to include bounding boxes for each mask (when available). - **Default**: `false` ### `include_scores` (boolean, optional) Whether to include mask confidence scores. - **Default**: `false` ### `return_multiple_masks` (boolean, optional) If True, upload and return multiple generated masks as defined by `max_masks`. - **Default**: `false` ### `image_url` (image, required) URL of the image to be segmented ### `sync_mode` (boolean, optional) If True, the media will be returned as a data URI. - **Default**: `false` ### `point_prompts` (string, optional) List of point prompts ### `output_format` (string, optional) The format of the generated image. - **Default**: `png` - **Options**: `jpeg`, `png`, `webp` ### `max_masks` (integer, optional) Maximum number of masks to return when `return_multiple_masks` is enabled. - **Default**: `3` - **Min**: 1 - **Max**: 32 ### `box_prompts` (string, optional) Box 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. ### `apply_mask` (boolean, optional) Apply the mask on the image. - **Default**: `true` ### `text_prompt` (string, optional) [DEPRECATED] Use 'prompt' instead. Kept for backward compatibility. ## Usage Examples ### cURL ```bash curl -X POST https://api.runflow.io/v1/run/meta/sam-3/image \ -H "Authorization: Bearer $RUNFLOW_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A professional headshot, soft studio lighting", "image_url": "https://example.com/input.jpg", "output_format": "png" }' ``` ### Python ```python import requests response = requests.post( "https://api.runflow.io/v1/run/meta/sam-3/image", headers={"Authorization": "Bearer RUNFLOW_API_KEY"}, json={ "prompt": "A professional headshot, soft studio lighting", "image_url": "https://example.com/input.jpg", "output_format": "png", }, ) data = response.json() print(data["image"]["url"]) ``` ### JavaScript ```javascript const response = await fetch( "https://api.runflow.io/v1/run/meta/sam-3/image", { method: "POST", headers: { "Authorization": "Bearer RUNFLOW_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ prompt: "A professional headshot, soft studio lighting", image_url: "https://example.com/input.jpg", output_format: "png", }), } ); const data = await response.json(); console.log(data.image.url); ``` ## Additional Resources - [Playground](https://www.runflow.io/models/meta/sam-3/image) - [API Reference](https://www.runflow.io/models/meta/sam-3/image/api) - [Documentation](https://www.runflow.io/docs)