Model API
SAM 3 Image
SAM 3 is a unified foundation model for promptable segmentation in images and videos. It can detect, segment, and track objects using text or visual prompts such as points, boxes, and masks.
Model id
sam-3/imageRun it
Quote the input, start the generation with the quote, then poll the job. Set RAYWAKE_API_KEY first; see Authentication.
# 1. Price the exact input (quotes are valid for up to 10 minutes)
curl -s https://api.raywake.com/v1/quotes \
-H "Authorization: Bearer $RAYWAKE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sam-3/image",
"input": {
"image_url": "https://example.com/input.png",
"prompt": "A red ceramic cup on a wooden table, soft morning light"
}
}'
# 2. Start the generation with the quote_id from step 1
curl -s https://api.raywake.com/v1/generate \
-H "Authorization: Bearer $RAYWAKE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"model": "sam-3/image", "quote_id": "QUOTE_ID", "input": {"image_url":"https://example.com/input.png","prompt":"A red ceramic cup on a wooden table, soft morning light"}}'
# 3. Poll until the status is terminal
curl -s https://api.raywake.com/v1/jobs/JOB_ID \
-H "Authorization: Bearer $RAYWAKE_API_KEY"Input
| Name | Type | Description |
|---|---|---|
image_urlrequired | string (image URL) | URL of the image to be segmented |
prompt | string | Text prompt for segmentation |
text_prompt | string | [DEPRECATED] Use 'prompt' instead. Kept for backward compatibility. |
point_prompts | array of objects | List of point prompts |
box_prompts | array of objects | 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 | Apply the mask on the image. |
sync_mode | boolean | If True, the media will be returned as a data URI. |
output_format | string (enum) | The format of the generated image. |
return_multiple_masks | boolean | If True, upload and return multiple generated masks as defined by `max_masks`. |
max_masks | number (enum) | Maximum number of masks to return when `return_multiple_masks` is enabled. |
include_scores | boolean | Whether to include mask confidence scores. |
include_boxes | boolean | Whether to include bounding boxes for each mask (when available). |
Output
A succeeded job lists its results under outputs, stored on our side. See Jobs for every field.
"outputs": [
{ "type": "image", "url": "https://…", "mime_type": "image/png", "thumbnail_url": "https://…" }
]Pricing
- 1 request$0.01/ request
The exact charge for your input comes from a quote. How charges settle