API ReferenceSearchSearch by prompt (with highlights)

Search by prompt

Search the catalog with a natural-language prompt and get back ranked tracks with highlight regions for each result. Same input as by-text, different upstream — the prompt path returns per-track highlights: [{offset, duration}] so you can surface the most relevant section of each match (great for previews, in/out points, auto-cropping clips).

GET/api/v4/search/ai/by-prompt/

This is the endpoint the Slipstream MCP search_tracks tool uses under the hood. If you’re seeing highlight fragments in MCP results and not in your own integration, switch from by-text to by-prompt.

Query parameters

ParameterRequiredDefaultDescription
textYesThe natural-language prompt.
highlightsNofalseSet to true to include highlights: [{offset, duration}] on each result.
time_offsetNo0Audio offset in seconds for the highlight analysis window.
time_limitNoAudio duration limit in seconds (1–60) for the highlight analysis window.
bpm_rangeNo5BPM tolerance when matching by tempo.
limit, offsetNoPagination.
Any filter parameterNoNarrow results by genre, mood, BPM, etc.

Example request

curl "https://api.slipstreammusic.com/api/v4/search/ai/by-prompt/?text=upbeat%20indie%20pop%20for%20a%20commercial&highlights=true&limit=5" \
  -H "Authorization: Bearer $PARTNER_API_KEY"

Example response

{
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "0328895e-af3f-4248-9173-69fed8ab25f5",
      "name": "Tonight We Dance",
      "artist": { "name": "Swami G", "slug": "swami-g" },
      "length": 87,
      "tempo": 106,
      "is_explicit": false,
      "is_free": true,
      "audio_url": "/api/v4/stream/0328895e-af3f-4248-9173-69fed8ab25f5/?type=track",
      "genre_name": "Rock",
      "subgenre_name": "Indie Rock",
      "mood_name": "Uplifting",
      "secondary_mood_name": "Uplifting",
      "vocals": "instrumental",
      "has_stems": true,
      "cover": "https://...",
      "release_date": "2025-09-12",
      "short_url": "https://slipstreammusic.com/t/...",
      "restricted": false,
      "highlights": [
        { "offset": 2.048, "duration": 15 },
        { "offset": 47.616, "duration": 38.912 }
      ]
    }
  ],
  "did_you_mean": null,
  "playlist_search": { "ids": [] }
}

See The Track object for the full field list. The highlights array is empty when highlights=true was not passed (or when AIMS couldn’t compute regions for that match).

Highlight regions

Each entry in highlights describes a contiguous region of the track:

FieldDescription
offsetStart of the region, in seconds from the beginning of the track.
durationLength of the region, in seconds.

Use these to drive automatic in/out points, preview clips, or thumbnail audio. The first entry is typically the strongest hook; subsequent entries are secondary regions of interest.

When to use by-prompt vs by-text

by-textby-prompt
InputNatural-language queryNatural-language prompt
Returns highlightsNoYes (with highlights=true)
Best forLightweight catalog browsingEditor/preview flows that need clip regions

If you don’t need highlights, by-text is cheaper. For anything where the user picks a track and you want to surface the best section, use by-prompt.