#/v1/listen Request Cancellation
1 messages · Page 1 of 1 (latest)
Hey there! This channel allows you to ask Kapa.ai for assistance. But it looks like you haven't connected your Discord profile to your Deepgram account yet. You can do so at https://community.deepgram.com - by doing so, you'll be able to ask questions in #1115960287183511643 if you need human assistance!
Deepgram’s community offers tons of resources to support you on your voice AI journey
Hi @slate solstice. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Based on the knowledge sources, the behavior differs depending on whether you're using the pre-recorded (REST) or streaming (WebSocket) version of /v1/listen:
Pre-Recorded (REST) /v1/listen
There is no way to cancel a pre-recorded transcription request once it has been submitted. As stated in the knowledge sources, "all requests that [Deepgram] receives will eventually either complete or fail" and "there is no ability or need to delete or cancel a request once it has been submitted." [Cancel Request discussion]
Streaming (WebSocket) /v1/listen
For the streaming endpoint, you have two relevant control messages:
-
CloseStream— Signals to Deepgram that you won't be sending any more audio. Deepgram will transcribe any buffered audio, return the final transcript, and then close the WebSocket. This is the recommended way to gracefully end a streaming session:{ "type": "CloseStream" } -
Finalize— Flushes any messages that might be in the queue without closing the connection entirely:{ "type": "Finalize" }
In the Python SDK, these are exposed as connection.send_close_stream() and connection.send_finalize() respectively. [Python SDK reference]