Stop Audio Stream Transcription
curl --request POST \
--url https://mavi-backend.memories.ai/serve/api/v2/audio-stream/stop \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"task_id": "660e8400-e29b-41d4-a716-446655440001"
}
'import requests
url = "https://mavi-backend.memories.ai/serve/api/v2/audio-stream/stop"
payload = { "task_id": "660e8400-e29b-41d4-a716-446655440001" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({task_id: '660e8400-e29b-41d4-a716-446655440001'})
};
fetch('https://mavi-backend.memories.ai/serve/api/v2/audio-stream/stop', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mavi-backend.memories.ai/serve/api/v2/audio-stream/stop",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'task_id' => '660e8400-e29b-41d4-a716-446655440001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mavi-backend.memories.ai/serve/api/v2/audio-stream/stop"
payload := strings.NewReader("{\n \"task_id\": \"660e8400-e29b-41d4-a716-446655440001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mavi-backend.memories.ai/serve/api/v2/audio-stream/stop")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"task_id\": \"660e8400-e29b-41d4-a716-446655440001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mavi-backend.memories.ai/serve/api/v2/audio-stream/stop")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"task_id\": \"660e8400-e29b-41d4-a716-446655440001\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "success",
"data": {
"task_id": "660e8400-e29b-41d4-a716-446655440001",
"message": "Audio stream stopped successfully"
}
}
{
"code": 200,
"message": "SUCCESS",
"data": {
"segment_index": 0,
"segment_start_time": "0",
"segment_end_time": "5",
"status": 14,
"message": "Stream stopped by user",
"transcript": null
},
"task_id": "660e8400-e29b-41d4-a716-446655440001"
}
Server-Pull Mode (callback)
Stop Audio Stream Transcription
Stop an active audio stream transcription task.
POST
/
audio-stream
/
stop
Stop Audio Stream Transcription
curl --request POST \
--url https://mavi-backend.memories.ai/serve/api/v2/audio-stream/stop \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"task_id": "660e8400-e29b-41d4-a716-446655440001"
}
'import requests
url = "https://mavi-backend.memories.ai/serve/api/v2/audio-stream/stop"
payload = { "task_id": "660e8400-e29b-41d4-a716-446655440001" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({task_id: '660e8400-e29b-41d4-a716-446655440001'})
};
fetch('https://mavi-backend.memories.ai/serve/api/v2/audio-stream/stop', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mavi-backend.memories.ai/serve/api/v2/audio-stream/stop",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'task_id' => '660e8400-e29b-41d4-a716-446655440001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mavi-backend.memories.ai/serve/api/v2/audio-stream/stop"
payload := strings.NewReader("{\n \"task_id\": \"660e8400-e29b-41d4-a716-446655440001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mavi-backend.memories.ai/serve/api/v2/audio-stream/stop")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"task_id\": \"660e8400-e29b-41d4-a716-446655440001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mavi-backend.memories.ai/serve/api/v2/audio-stream/stop")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"task_id\": \"660e8400-e29b-41d4-a716-446655440001\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "success",
"data": {
"task_id": "660e8400-e29b-41d4-a716-446655440001",
"message": "Audio stream stopped successfully"
}
}
{
"code": 200,
"message": "SUCCESS",
"data": {
"segment_index": 0,
"segment_start_time": "0",
"segment_end_time": "5",
"status": 14,
"message": "Stream stopped by user",
"transcript": null
},
"task_id": "660e8400-e29b-41d4-a716-446655440001"
}
Product: Visual Intelligence — Live Audio Transcription
Use case: Real-time speech-to-text on a live audio stream. For one-off file transcription, see Audio File Transcription.
Mode: Server-Pull (you give us an RTMP/RTSP stream URL → we pull → results to your callback). For client-controlled streaming, see the WebSocket variant.
Host:
https://mavi-backend.memories.ai/serve/api/v2
Auth: Authorization: sk-mavi-... (no Bearer prefix)Access Required: To use this API endpoint, please contact us at contact@memories.ai to enable stream processing features for your account.
Code Example
import requests
BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2"
API_KEY = "sk-mavi-..."
HEADERS = {
"Authorization": f"{API_KEY}",
"Content-Type": "application/json"
}
def stop_audio_stream(task_id: str):
url = f"{BASE_URL}/audio-stream/stop"
data = {"task_id": task_id}
resp = requests.post(url, json=data, headers=HEADERS)
return resp.json()
# Usage example
result = stop_audio_stream("660e8400-e29b-41d4-a716-446655440001")
print(result)
const axios = require('axios');
const BASE_URL = 'https://mavi-backend.memories.ai/serve/api/v2';
const API_KEY = 'sk-mavi-...';
const headers = {
'Authorization': API_KEY,
'Content-Type': 'application/json'
};
async function stopAudioStream(taskId) {
const response = await axios.post(
`${BASE_URL}/audio-stream/stop`,
{ task_id: taskId },
{ headers }
);
return response.data;
}
// Usage example
stopAudioStream('660e8400-e29b-41d4-a716-446655440001')
.then(result => console.log(result));
curl -X POST "https://mavi-backend.memories.ai/serve/api/v2/audio-stream/stop" \
-H "Authorization: sk-mavi-..." \
-H "Content-Type: application/json" \
-d '{
"task_id": "660e8400-e29b-41d4-a716-446655440001"
}'
Response
Returns the confirmation of the stopped stream.{
"code": 200,
"message": "success",
"data": {
"task_id": "660e8400-e29b-41d4-a716-446655440001",
"message": "Audio stream stopped successfully"
}
}
{
"code": 200,
"message": "SUCCESS",
"data": {
"segment_index": 0,
"segment_start_time": "0",
"segment_end_time": "5",
"status": 14,
"message": "Stream stopped by user",
"transcript": null
},
"task_id": "660e8400-e29b-41d4-a716-446655440001"
}
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| task_id | string | Yes | The task ID returned when starting the stream |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | string | Response code (200 indicates success) |
| message | string | Response message describing the operation result |
| data | object | Response data object |
| data.task_id | string | The task ID of the stopped stream |
| data.message | string | Confirmation message |
Callback Response Parameters
A final callback is sent to your webhook URL after the stream is stopped.| Parameter | Type | Description |
|---|---|---|
| code | string | Response code (200) |
| message | string | Response message (“SUCCESS”) |
| task_id | string | The task ID of the stopped stream |
| data | object | Wrapper object |
| data.segment_index | integer | Last segment index |
| data.segment_start_time | string | Last segment start time |
| data.segment_end_time | string | Last segment end time |
| data.status | integer | Status code (14 indicates user stopped) |
| data.message | string | ”Stream stopped by user” |
| data.transcript | null | No transcript for stop callbacks |
Important Notes
- Immediate stop: The stream stops immediately after this call
- Final callback: A callback with status 14 is sent after stopping
- Resource cleanup: All resources are automatically released
- No further charges: No charges occur after the stream is stopped
- Safe to call: Safe to call even if the stream has already ended
Error Responses
| HTTP Code | Description |
|---|---|
| 400 | Invalid task_id or task not found |
| 401 | Unauthorized - invalid API key |
| 500 | Internal server error |
Authorizations
Body
application/json
The task ID returned when starting the stream
Example:
"660e8400-e29b-41d4-a716-446655440001"
