Skip to content

Finish Sessions by URL

PUT
/lives/finish-by-audio_url

Terminer des Sessions Live par URL Audio

đŸ‘€ Authentification Utilisateur Requise

Description

Ce point d’accĂšs ne supprime pas une session, mais la termine proprement. Il trouve toutes les sessions pending ou active de l’utilisateur qui correspondent Ă  une audio_url spĂ©cifique et les fait passer au statut finished.

C’est l’action Ă  utiliser pour arrĂȘter une retranscription en cours et libĂ©rer les ressources serveur associĂ©es.


Actions Effectuées

L’appel Ă  cet endpoint dĂ©clenche plusieurs actions importantes sur le serveur :

  1. ArrĂȘt du Processus : Si la session avait Ă©tĂ© dĂ©marrĂ©e avec auto_start, le processus de retranscription en arriĂšre-plan est terminĂ©.
  2. Changement de Statut : Le statut de la ou des sessions passe Ă  finished.
  3. Libération des Ressources : La mémoire GPU (VRAM) qui était réservée pour la ou les sessions est libérée et redevient disponible.

Corps de la RequĂȘte (Body)

AttributTypeRequisDescription
audio_urlstringOuiL’URL exacte de la source audio des sessions que vous souhaitez arrĂȘter.

Réponses Possibles

✅ 200 OK

La requĂȘte a rĂ©ussi. L’API retourne une liste paginĂ©e de toutes les sessions qui viennent d’ĂȘtre terminĂ©es par cette action.

Exemple de réponse :

{
  "data": [
    {
      "id": 1,
      "status": "finished",
      "vram": 0,
      "audio_url": "rtsp://localhost:8554/mystream",
      "sender_token": "...",
      "listener_token": "..."
    }
  ],
  "pagination": {
    "total_items": 1,
    "total_pages": 1,
    "current_page": 1,
    "per_page": 100
  }
}

❌ 401 Unauthorized La requĂȘte Ă©choue si le jeton JWT (userJwtToken) est manquant ou invalide. ❌ 422 Unprocessable Entity La requĂȘte Ă©choue si le champ audio_url est manquant dans le corps de la requĂȘte.

object
audio_url
string
Example
{
"audio_url": ""
}

Successful response (inferred from assertions)

object
data
required
Array<object>
object
id
required

The unique numeric identifier for the live session.

integer
Example
101
status
required

The current state of the live session’s lifecycle.

string
Allowed values: pending active finished error
Example
active
live_retention
required

If true, the final transcription result for this session will be saved and can be retrieved later. This is only possible if the user has the user_retention permission.

boolean
Example
true
audio_format
required

The format of the incoming audio stream.

string
Allowed values: raw hls rtmp file rtsp
Example
raw
auto_start
required

Indicates if the session was configured to start processing automatically for URL-based audio formats.

boolean
vram
required

The total amount of Video RAM (in Megabytes) allocated for this session, including the ASR model and all requested translation models.

integer
Example
2100
audio_url

The source URL for the audio stream if the format is hls, rtmp, or rtsp. Will be null for raw format where audio is pushed via WebSocket.

string
nullable
Example
rtmp://media.example.com/live/stream1
auto_start_pid

Internal Process ID for the subprocess managing an auto-started session. Primarily used for system diagnostics.

integer
nullable
Example
12345
iframe_html

A pre-generated HTML <iframe> snippet for easily embedding a view-only display of the live transcription. This is only returned if it was specifically requested upon session creation.

string
nullable
Example
<iframe src=... ></iframe>
sender_token
required

The secret token required to authenticate and send audio data to the session’s WebSocket endpoint. This token is sensitive and must be kept secure.

string
Example
sender_abc123...
listener_token
required

The token required to connect to the WebSocket and receive transcription and translation results. This token can be shared publicly to allow others to view the live output.

string
Example
listener_xyz789...
base_url
required

The base WebSocket URL for connecting to the live session.

string
Example
ws://api.example.com
relative_path
required

The relative path for the WebSocket endpoint.

string
Example
/ws/live
config
required
object
vad

Enable or disable Voice Activity Detection (VAD). If true, the engine will only process audio segments that contain speech, which can reduce processing load and improve accuracy by filtering out silence or noise.

boolean
Example
true
mode

The transcription mode, controlling how results are sent. Typically ‘partial’ for faster, intermediate results or ‘final’ for more accurate, completed segments.

string
Allowed values: partial final
Example
partial
min_buffer

The minimum amount of audio (in seconds) to buffer before sending it to the ASR model. Higher values can improve accuracy on short phrases but increase initial latency.

number format: float
Example
2
max_buffer

The maximum amount of audio (in seconds) to buffer before forcing a transcription. This acts as an upper bound on latency.

number format: float
Example
4
buffer_timeout

The maximum duration of silence (in seconds) to wait before considering a phrase complete and finalizing the transcription for the current buffer.

number format: float
Example
4
max_delay

The maximum allowed delay (in seconds) between the incoming audio and the returned transcription. The system may adjust buffer sizes to stay within this limit.

number format: float
Example
4
max_chars

The maximum number of characters to include in a single line of the returned transcription. Used for formatting the output for display.

integer
Example
40
max_lines

The maximum number of lines to display in the transcription output. When this limit is reached, older lines may be removed.

integer
Example
2
punctuate

Enable or disable punctuation. If true, the engine will add punctuation.

boolean
Example
true
model
required
object
id
required

The unique numeric identifier for the model. Use this ID when creating new resources that depend on a specific model, such as a live session.

integer
Example
1
name
required

The unique, human-readable name of the transcription model (e.g., ‘tiny’, ‘large-v1’, ‘large-v2’). This name is used to select a model when creating a new live session via the API.

string
Example
tiny
active
required

Indicates whether the model is currently available for use. An inactive model (false) cannot be used to create new transcription sessions.

boolean
Example
true
vram
required

The estimated amount of VRAM (in Megabytes) required to load and run this model. This value is used to calculate resource allocation and prevent overloading the system.

integer
Example
1250
language
required
object
id
required

The unique numeric identifier for the language. This is the internal primary key.

integer
Example
10
iso_639_1
required

The standard two-letter ISO 639-1 code for the language. This is the primary field you should use when specifying a language for a new transcription session.

string
Example
en
name
required

The full, human-readable name of the language in English.

string
Example
English
active
required

Indicates whether the language is currently available for transcription. An inactive language (false) cannot be selected when creating a new live session.

boolean
Example
true
translations
required
Array<object>

Represents an available translation capability from a specific source language to a target language.

object
id
required

The unique numeric identifier for this specific translation path (e.g., English to French).

integer
Example
5
model
required

The name of the underlying machine translation model used for this language pair.

string
Example
nllb-200-distilled-600M
active
required

Indicates whether this translation path is available for use. An inactive translation (false) cannot be requested when creating a live session.

boolean
Example
true
vram
required

The additional amount of Video RAM (in Megabytes) required to load this translation model. This is added to the VRAM of the base transcription model.

integer
Example
850
lang_from
required

The source language that can be translated from.

object
id
required

The unique numeric identifier for the language. This is the internal primary key.

integer
Example
10
iso_639_1
required

The standard two-letter ISO 639-1 code for the language. This is the primary field you should use when specifying a language for a new transcription session.

string
Example
en
name
required

The full, human-readable name of the language in English.

string
Example
English
active
required

Indicates whether the language is currently available for transcription. An inactive language (false) cannot be selected when creating a new live session.

boolean
Example
true
lang_to
required

The target language that the source can be translated into.

object
id
required

The unique numeric identifier for the language. This is the internal primary key.

integer
Example
10
iso_639_1
required

The standard two-letter ISO 639-1 code for the language. This is the primary field you should use when specifying a language for a new transcription session.

string
Example
en
name
required

The full, human-readable name of the language in English.

string
Example
English
active
required

Indicates whether the language is currently available for transcription. An inactive language (false) cannot be selected when creating a new live session.

boolean
Example
true
created_at
string
updated_at
string
pagination
required
object
total_items
required

The total number of items available in the entire dataset that match the query, across all pages.

integer
total_pages
required

The total number of pages calculated from total_items and per_page. A client can use this to build page navigation UI.

integer
current_page
required

The page number for the current set of items being returned. This is typically controlled by skip and limit or page and size query parameters.

integer
per_page
required

The maximum number of items configured to be returned on a single page. This is typically controlled by a limit query parameter.

integer
Example
{
"data": [
{
"created_at": "2025-11-18T17:13:25.370815+01:00",
"updated_at": "2025-11-18T17:13:26.023881+01:00",
"live_retention": false,
"config": {
"vad": true,
"mode": "partial",
"max_chars": 40,
"max_delay": 4,
"max_lines": 2,
"max_buffer": 5,
"min_buffer": 1,
"buffer_timeout": 3
},
"id": 12,
"status": "active",
"vram": 1425,
"iframe_html": null,
"audio_format": "rtsp",
"audio_url": "rtsp://localhost:8554/mystream",
"auto_start": true,
"auto_start_pid": 103410,
"base_url": "",
"sender_token": "_VtvMv3mYKtVs4sbjJC5lGMS-eSOQnnheT6Li30fmr8",
"listener_token": "aSPhiwbTbHkCQItRpl9s9HZhbKYPrUv00A3aVCTzwRE",
"relative_path": "/ws/live",
"model": {
"created_at": "2025-11-13T16:29:53.934766+01:00",
"updated_at": null,
"name": "tiny",
"active": true,
"vram": 625,
"id": 1
},
"language": {
"created_at": "2025-11-13T16:29:53.954832+01:00",
"updated_at": null,
"iso_639_1": "fr",
"name": "French",
"id": 7,
"active": true
},
"translations": [
{
"created_at": "2025-11-13T16:29:53.978144+01:00",
"updated_at": null,
"model": "opus-mt-fr-en",
"active": false,
"vram": 800,
"id": 589,
"lang_from": {
"created_at": "2025-11-13T16:29:53.954832+01:00",
"updated_at": null,
"iso_639_1": "fr",
"name": "French",
"id": 7,
"active": true
},
"lang_to": {
"created_at": "2025-11-13T16:29:53.954832+01:00",
"updated_at": null,
"iso_639_1": "en",
"name": "English",
"id": 1,
"active": true
}
}
]
},
{
"created_at": "2025-11-18T16:20:59.891001+01:00",
"updated_at": "2025-11-18T16:21:00.487815+01:00",
"live_retention": false,
"config": {
"vad": true,
"mode": "partial",
"max_chars": 40,
"max_delay": 4,
"max_lines": 2,
"max_buffer": 5,
"min_buffer": 1,
"buffer_timeout": 3
},
"id": 11,
"status": "active",
"vram": 625,
"iframe_html": null,
"audio_format": "rtsp",
"audio_url": "rtsp://localhost:8554/mystream",
"auto_start": true,
"auto_start_pid": 90750,
"base_url": "",
"sender_token": "X_XTIVrMZ9NyRHmW_KRVjLPwuyFVf-ghHpHZJpEDBmI",
"listener_token": "ImpQhaNaA_uvekKS-2beURiPdU3p-Cc_rAAOnPAZW84",
"relative_path": "/ws/live",
"model": {
"created_at": "2025-11-13T16:29:53.934766+01:00",
"updated_at": null,
"name": "tiny",
"active": true,
"vram": 625,
"id": 1
},
"language": {
"created_at": "2025-11-13T16:29:53.954832+01:00",
"updated_at": null,
"iso_639_1": "fr",
"name": "French",
"id": 7,
"active": true
},
"translations": []
}
],
"pagination": {
"total_items": 2,
"total_pages": 1,
"current_page": 1,
"per_page": 100
}
}