Skip to main content
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"
}
'
{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "660e8400-e29b-41d4-a716-446655440001",
    "message": "Audio stream stopped successfully"
  }
}
Access Required: To use this API endpoint, please contact us at contact@memories.ai to enable stream processing features for your account.
This endpoint stops an active audio stream transcription task. Once stopped, no further callbacks will be sent, and resources will be released.

Code Example

import requests

BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2"
API_KEY = "sk-mai-this_a_test_string_please_use_your_generated_key_during_testing"
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)

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"
  }
}

Request Parameters

ParameterTypeRequiredDescription
task_idstringYesThe task ID returned when starting the stream

Response Parameters

ParameterTypeDescription
codestringResponse code (200 indicates success)
messagestringResponse message describing the operation result
dataobjectResponse data object
data.task_idstringThe task ID of the stopped stream
data.messagestringConfirmation message

Callback Response Parameters

A final callback is sent to your webhook URL after the stream is stopped.
ParameterTypeDescription
codestringResponse code (200)
messagestringResponse message (“SUCCESS”)
task_idstringThe task ID of the stopped stream
dataobjectWrapper object
data.segment_indexintegerLast segment index
data.segment_start_timestringLast segment start time
data.segment_end_timestringLast segment end time
data.statusintegerStatus code (14 indicates user stopped)
data.messagestring”Stream stopped by user”
data.transcriptnullNo 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 CodeDescription
400Invalid task_id or task not found
401Unauthorized - invalid API key
500Internal server error

Authorizations

Authorization
string
header
required

Body

application/json
task_id
string
required

The task ID returned when starting the stream

Example:

"660e8400-e29b-41d4-a716-446655440001"

Response

200 - application/json

Audio stream stopped successfully

code
string
Example:

200

message
string
Example:

"success"

data
object