> ## Documentation Index
> Fetch the complete documentation index at: https://api-tools.memories.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Stop Audio Stream Transcription

> Stop an active audio stream transcription task.

<Info>
  **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)
</Info>

<Warning>
  **Access Required**: To use this API endpoint, please contact us at [contact@memories.ai](mailto:contact@memories.ai) to enable stream processing features for your account.
</Warning>

This endpoint stops an active audio stream transcription task. Once stopped, no further callbacks will be sent, and resources will be released.

### Code Example

<CodeGroup>
  ```python Python theme={null}
  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)
  ```

  ```javascript JavaScript theme={null}
  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));
  ```

  ```bash cURL theme={null}
  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"
    }'
  ```
</CodeGroup>

### Response

Returns the confirmation of the stopped stream.

<ResponseExample>
  ```json Response theme={null}
  {
    "code": 200,
    "message": "success",
    "data": {
      "task_id": "660e8400-e29b-41d4-a716-446655440001",
      "message": "Audio stream stopped successfully"
    }
  }
  ```

  ```json Callback Response theme={null}
  {
    "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"
  }
  ```
</ResponseExample>

### 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

<Note>
  * **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
</Note>

### Error Responses

| HTTP Code | Description                        |
| --------- | ---------------------------------- |
| 400       | Invalid task\_id or task not found |
| 401       | Unauthorized - invalid API key     |
| 500       | Internal server error              |


## OpenAPI

````yaml visual-intelligence/stream/openapi.json POST /audio-stream/stop
openapi: 3.0.0
info:
  title: Stream Processing API
  version: 2.0.0
  description: Real-time video and audio stream processing APIs
servers:
  - url: https://mavi-backend.memories.ai/serve/api/v2
    description: Production server
security: []
paths:
  /audio-stream/stop:
    post:
      tags:
        - Audio Stream
      summary: Stop Audio Stream Transcription
      description: Stop an active audio stream transcription task
      operationId: stopAudioStream
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - task_id
              properties:
                task_id:
                  type: string
                  description: The task ID returned when starting the stream
                  example: 660e8400-e29b-41d4-a716-446655440001
      responses:
        '200':
          description: Audio stream stopped successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: 200
                  message:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      task_id:
                        type: string
                        example: 660e8400-e29b-41d4-a716-446655440001
                      message:
                        type: string
                        example: Audio stream stopped successfully
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````