Sand AISand AI MAGI-2MAGI-2 is now on SandBase: 1080p video with native audioTry it now

SAM Audio Span Separate

meta/sam-audio/span-separate

SAM Audio by Meta isolates a sound using time spans that mark where it occurs, optionally guided by a text description. It returns the isolated target and the residual audio, either full length or trimmed to the spans.

Base price
$0.05USD / run
Execution
async
Model type
audio
Input fields
7
Production route

Try the model

Playground

Open playground
Input
Audio file or URL to process.
Time spans where the target sound occurs. Each item has `start` and `end` in seconds and `include` (true to isolate sounds in this span, false to exclude them).
Optional but recommended text describing the sound to isolate.
Trim the output to the span time range. If false, returns the full audio length with the target isolated throughout.
Rank reranking candidates by how well their non-silent regions match the spans. Works without a prompt; requires `reranking_candidates` > 1.
17
Number of candidates to generate and rank (1–7). Higher improves quality but adds $0.025 per 30 s per extra candidate. Range: 1 to 7.
Output audio format.
OutputReady

Your output will appear here

Complete the inputs, then click Run.

Model card

Specifications

Pricing

Base price
$0.05 / run

Context & modalities

Input
Schema-defined
Output
audio

Capabilities

Chat
Not supported
Vision
Not supported
Reasoning
Not supported
Structured output
Not supported
Function calling
Not supported
Audio input
Not supported

Access

Provider
Meta
Model ID
meta/sam-audio/span-separate
Execution
async
Base URL
https://api.sandbase.ai
API
Unified Run API
Endpoint
/v1/run

API README

SAM Audio Span Separate

SAM Audio isolates a sound from the time spans where it occurs, with an optional text hint, and returns it with the residual track.

Fields

FieldTypeDefaultNotes
audioaudio file or URL, required—Recording to separate.
spansarray of {start, end, include}, required—Time ranges in seconds; include: false marks ranges to exclude.
promptstring—Optional hint about the sound.
trim_to_spanbooleanfalseReturn only the span range instead of the full length.
use_sound_activity_rankingbooleanfalseRank candidates by match to the spans; needs more than one candidate.
reranking_candidatesinteger 1–71Extra candidates improve quality; each adds $0.025 per 30 s.
output_formatwav / mp3wavOutput file format.

Output

FieldNotes
urlIsolated target sound.
residual_urlEverything else (the input minus the target).
durationOutput length in seconds.

Billing

$0.05 per started 30 seconds of output audio (shorter with trim_to_span), plus $0.025 per 30 seconds for each extra reranking candidate. The final charge uses the measured output length; the quote uses the input length (10 minutes if it cannot be read).

AudioPrice
30 s, 1 candidate$0.05
2 min, 1 candidate$0.20
2 min, 3 candidates$0.40

Failed runs are not charged.

Prompting

  • Mark a span where the target is clearly audible; add a short prompt such as dog barking for better results.

Also on SandBase

Related: meta/sam-audio/separate, meta/sam-audio/visual-separate.

Start building

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

Production API
Unified Run API endpoint
https://api.sandbase.ai/v1/run
Model ID
meta/sam-audio/span-separate
# 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-audio/span-separate",
  "audio": "https://v3b.fal.media/files/b/0a8853d1/T7zRmsiculA6u_V6RCF2c_man.mp3",
  "spans": [
    [
      {
        "end": 10,
        "start": 6,
        "include": true
      }
    ]
  ],
  "prompt": "man singing",
  "trim_to_span": false,
  "output_format": "wav",
  "reranking_candidates": 1,
  "use_sound_activity_ranking": 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"
01

Input Schema

7 parameters · 2 required · 5 optional

ParameterTypeRequiredDescription
audiostringRequiredAudio file or URL to process.
spansobject[]RequiredTime spans where the target sound occurs. Each item has `start` and `end` in seconds and `include` (true to isolate sounds in this span, false to exclude them).
promptstringOptionalOptional but recommended text describing the sound to isolate.
trim_to_spanbooleanOptionalTrim the output to the span time range. If false, returns the full audio length with the target isolated throughout. · Default: false
output_formatstringOptionalOutput audio format. · Options: wav, mp3 · Default: "wav"
wavmp3
reranking_candidatesintegerOptionalNumber of candidates to generate and rank (1–7). Higher improves quality but adds $0.025 per 30 s per extra candidate. · Min: 1 · Max: 7 · Default: 1
use_sound_activity_rankingbooleanOptionalRank reranking candidates by how well their non-silent regions match the spans. Works without a prompt; requires `reranking_candidates` > 1. · Default: false
02

Output Schema

FieldTypeDescription
idstringUnique identifier for the generation task
statusstringTask status: pending, running, completed, failed, timeout
modelstringModel used for the generation
outputsarrayArray of output items
outputs[].urlstringURL of the generated artifact
outputs[].content_typestringMIME type (e.g. image/png, video/mp4)
errorobject | nullError details if failed, null on success
error.typestringMachine-readable error type code
error.messagestringHuman-readable error description

Async Workflow

This model runs asynchronously. Submit a request, then poll for the result.

  1. Submit: POST to /v1/run and read the returned id.
  2. Poll: GET /v1/run/{id} until status is completed, failed or timeout.
  3. Retrieve: read outputs from the completed response.

Choose your model

Compare models

All image & video models
ModelTypeDefault priceReleased
MetaAudio$0.05 / runDec 30, 2025
MetaAudio$0.05 / runDec 30, 2025
MetaAudio$0.05 / runDec 30, 2025
MetaAudio$0.04 / runOct 27, 2025

Questions

FAQ

How do I call Meta SAM Audio Span Separate through SandBase?

Create a SandBase API key, then send requests with the model ID "meta/sam-audio/span-separate" 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 Audio Span Separate and the other models in the catalog; you do not need to sign up with Meta separately.