Skip to content

Sam Audio · Span Separate

Integrate

Model id sam-audio/span-separate
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/sam-audio/span-separate?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
    "spans": [
      {
        "end": 10,
        "include": true,
        "start": 6
      }
    ]
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Files like the example: $0.05 50 API credits · ≈ ₽5.27 your files are measured before the run Run it on this page

Get API key
Meta Audio 10–60 s #audio-to-audio#sam-audio

Isolates a sound from audio using time spans you provide, with an optional text hint

Meta · Data (JSON)

Your first result goes here

Build a request below and run it with your API key. Outputs are copied to our storage, kept forever or 7 days for free.

Build a request

Controls are generated from the model schema. The code and the price update as you change them.

Sound-identification aid for extracting audio from the span. A text description of the sound to isolate is recommended, though not required.

•required audio_url
Drop a file, or

Audio file URL for processing.

default 1

Candidate count used only with a text prompt: that many candidates are generated and ranked. Span-only separation ignores this setting.

•required

Time intervals containing the target sound to isolate.

Advanced acceleration · output_format · max_chunk_duration · chunk_overlap · use_sound_activity_ranking · trim_to_span
acceleration default balanced

Acceleration level applied to processing.

output_format default wav

Format for the generated audio.

default 60

Per-pass audio limit, measured in seconds, beyond which processing uses overlapping chunks that are blended together.

default 5

Length of the overlap between chunks, measured in seconds, used for crossfade blending.

POST /run/sam-audio/span-separate?wait=20 quote → $0.05
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/sam-audio/span-separate?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "audio": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
    "spans": [
      {
        "end": 10,
        "include": true,
        "start": 6
      }
    ]
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Run this request

Your key stays in this browser: it is sent only to the Doitong API and saved (localStorage) only if you tick Remember. Get an API key

About Sam Audio · Span Separate

Instead of relying on text alone, you pass `spans` marking when the target sound occurs in the `audio_url`. A `prompt` is optional but helps identify the sound type. `trim_to_span` can cut the output to the span range, and `use_sound_activity_ranking` allows reranking without a prompt. Returns `target` and `residual` audio in wav or mp3.

Parameters

Send either the canonical name or the native name, not both. Canonical names

NameType DefaultAllowed Description
audio_urlrequired audio
Typeurl · audio
Audio file URL for processing.
promptoptional
Typestring | null
Sound-identification aid for extracting audio from the span. A text description of the sound to isolate is recommended, though not required.
spansrequired
Typeobject[]
Time intervals containing the target sound to isolate.
spans[].startrequired
Typenumber
≥ 0
Span start timestamp, measured in seconds.
spans[].endrequired
Typenumber
≥ 0
Span end timestamp, measured in seconds.
spans[].includeoptional
Typeboolean
Defaulttrue
Inclusion of sounds within the span: True includes them, while False excludes them.
reranking_candidatesoptional
Typeinteger
Default1
1 – 7
Candidate count used only with a text prompt: that many candidates are generated and ranked. Span-only separation ignores this setting.
accelerationoptional
Typeenum
Defaultbalanced
fastbalancedquality
Acceleration level applied to processing.
max_chunk_durationoptional
Typenumber
Default60
10 – 60
Per-pass audio limit, measured in seconds, beyond which processing uses overlapping chunks that are blended together.
chunk_overlapoptional
Typenumber
Default5
0 – 30
Length of the overlap between chunks, measured in seconds, used for crossfade blending.
use_sound_activity_rankingoptional
Typeboolean
Defaultfalse
Sound-activity ranking option requiring reranking_candidates > 1, enabling effective reranking for span-only separation without a text prompt. Candidates are scored by how closely their detected nonsilent regions align with the supplied spans.
trim_to_spanoptional
Typeboolean
Defaultfalse
Output-length choice between the specified span alone and the complete audio. Enabling it trims to the span's time range; False retains full length and isolates the target sound throughout.
output_formatoptional
Typeenum
Defaultwav
wavmp3
Format for the generated audio.
required Canonical name, also accepted

File parameters take a public https:// URL, a data: URI up to 10 MB, or the file_url of an upload. Files

Output

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "sam-audio/span-separate",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 50,
    "usd": "0.05",
    "charged": 50,
    "refunded": 0
  },
  "input": {
    "audio_url": "https://content.doitong.com/audio/showcase/v3/tools/dub_es.mp3",
    "spans": [
      {
        "end": 10,
        "include": true,
        "start": 6
      }
    ]
  },
  "output": {
    "target": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200
    },
    "residual": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200
    },
    "duration": 5,
    "sample_rate": 48000
  },
  "outputs": [
    {
      "type": "file",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Your files, your choiceEvery outputs[].url is a copy on our storage: kept forever (paid per GB-month) or 7 days for free, by your account setting or ?storage=.
Same shape on every modeltype, url, content_type, width, height and duration, for images, video and audio alike. output is the model’s own result object.
Fields of output
target
object {url, content_type, file_name, file_size}Target sound extracted in isolation.
residual
object {url, content_type, file_name, file_size}Audio remaining apart from the target sound.
duration
numberOutput audio length, measured in seconds.
sample_rate
integerSampling frequency in Hz for the output audio.

More models: Audio

For AI agents: this page as Markdown is at https://doitong.com/en-US/developers/models/sam-audio/span-separate.md. All models and guides: https://doitong.com/developers/llms.txt