Skip to content

Sam 3

POST/v1/run

Sam 3 Image Rle is Meta's intelligent image editing model. Transform, retouch, and reimagine existing images using text prompts - from background replacement to artistic style conversion.

Request body

Submit an async generation request. The model field selects the model; other fields are model-specific input parameters.

stringmodelrequired

Model identifier. Set to meta/sam-3/image-rle.

Default: meta/sam-3/image-rle

stringpromptrequired

Text prompt for segmentation

Default: wheel

stringimagerequired

URL of the image to be segmented

Optional<string>output_format

The format of the generated image.

Allowed values: jpeg, png

Default: png

Optional<boolean>apply_mask

Apply the mask on the image.

Default: true

Optional<integer>max_masks

Maximum number of masks to return when `return_multiple_masks` is enabled.

Range: 1 to 32

Default: 3

Optional<boolean>include_scores

Whether to include mask confidence scores.

Default: false

Optional<array<object>>box_prompts

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.

Default:

Optional<boolean>return_multiple_masks

If True, upload and return multiple generated masks as defined by `max_masks`.

Default: false

Optional<string>text_prompt

[DEPRECATED] Use 'prompt' instead. Kept for backward compatibility.

Optional<array<object>>point_prompts

List of point prompts

Default:

Optional<boolean>include_boxes

Whether to include bounding boxes for each mask (when available).

Default: false

Response Schema

The submit endpoint returns an accepted generation task. Poll the result endpoint with the returned id for terminal outputs or errors.

Optional<string>error

Error message if the task failed. Empty on success.

stringidrequired

Unique identifier for the generation task.

Optional<string>model

Model ID used for the prediction.

Optional<array>outputs

Array of generated content. Empty when status is not completed.

stringstatusrequired

Status of the task: pending, running, completed, failed, or timeout.

Allowed values: pending, running, completed, failed, timeout

Model capabilities

array<string>capability_tagsrequired

Capabilities declared by the model registry.

Default: image-to-image

stringexecution_moderequired

Execution mode declared by the model registry.

Default: async