# Meta SAM 3 Image API

> SAM 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.

Source: https://www.sandbase.ai/model/meta/sam-3/image
API reference: https://www.sandbase.ai/model/meta/sam-3/image/docs

## Facts

- Provider: Meta
- Type: Image model
- Model ID: `meta/sam-3/image`
- Price: $0.005 per run
- Capabilities: image to image
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

- Unified Run API: `POST https://api.sandbase.ai/v1/run`

```bash
curl -X POST https://api.sandbase.ai/v1/run \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "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
}'
```

The response returns a run id; poll `GET https://api.sandbase.ai/v1/run/{id}` until the status is `completed` or `failed`.

## FAQ

### How do I call Meta SAM 3 Image through SandBase?

Create a SandBase API key, then send requests with the model ID "meta/sam-3/image" to Unified Run API (/v1/run) at https://api.sandbase.ai. The request examples on this page show the exact payload.

### Do I need a separate Meta account?

No. One SandBase API key and balance gives you access to Meta SAM 3 Image and the other models in the catalog; you do not need to sign up with Meta separately.

## README

### SAM 3 Image

SAM 3 segments objects in an image from a text, point, or box prompt and returns masks.

#### Fields

| 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). |

#### Billing

$0.005 per image.

| Request | Price |
|---|---|
| One image | $0.005 |

Failed runs are not charged.

#### Also on SandBase

Related: `meta/sam-3/3d-objects`.
