# Stop a Real-time STT task (/en/api-reference/api-ref/speech-to-text/rest-api-v5/stop)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

<CalloutContainer type="warning">
  <CalloutDescription>
    Real-Time STT API versions v5.x and v6.x are deprecated since June 2025 and will reach end-of-life on June 11, 2026. Use the v7 REST API for new projects.
  </CalloutDescription>
</CalloutContainer>

## Endpoint [#endpoint]

* Method: `DELETE`

* Endpoint: `https://api.agora.io/v1/projects/{appId}/rtsc/speech-to-text/tasks/{taskId}`

Use this endpoint to leave the channel and stop Real-Time STT. To restart transcription, [`acquire`](acquire) a new one `buildToken` and call [`start`](start) again.

## Request [#request]

### Path parameters [#path-parameters]

**`appId`** Type: `string` Required

The App ID of the project

**`taskId`** Type: `string` Required

The unique identifier of the Real-Time STT task you received in the response body of the [`start`](start) method.

### Query parameters [#query-parameters]

**`builderToken`** Type: `string` Required

The `tokenName` value you obtained in the response body of the [`acquire`](acquire) method. To stop a task, use the same `builderToken` you used to start the task.

## Response [#response]

* If the returned status code is `200`, the request was successful.
* If the returned status code is not `200`, the request failed.

## Authorization [#authorization]

This endpoint requires [Basic Auth](../authentication).

## Request example [#request-example]

<CodeBlockTabs defaultValue="curl">
  <CodeBlockTabsList>
    <CodeBlockTabsTrigger value="curl">
      curl
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="python">
      Python
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="nodejs">
      Node.js
    </CodeBlockTabsTrigger>
  </CodeBlockTabsList>

  <CodeBlockTab value="curl">
    ```bash
          curl --request DELETE \
          --url 'https://api.agora.io/v1/projects/:appId/rtsc/speech-to-text/tasks/:taskId?builderToken=your_builder_token' \
          --header 'Authorization: Basic <credentials>'
    ```
  </CodeBlockTab>

  <CodeBlockTab value="python">
    ```python
        import requests

        url = "https://api.agora.io/v1/projects/:appId/rtsc/speech-to-text/tasks/:taskId?builderToken=your_builder_token"

        headers = {"Authorization": "Basic <credentials>"}

        response = requests.request("DELETE", url, headers=headers)

        print(response.text)
    ```
  </CodeBlockTab>

  <CodeBlockTab value="nodejs">
    ```js
        const url = 'https://api.agora.io/v1/projects/:appId/rtsc/speech-to-text/tasks/:taskId?builderToken=your_builder_token';
        const options = {method: 'DELETE', headers: {Authorization: 'Basic <credentials>'}};

        fetch(url, options)
          .then(res => res.json())
          .then(json => console.log(json))
          .catch(err => console.error(err));
    ```
  </CodeBlockTab>
</CodeBlockTabs>
