POST
/
transcriptions
/
sync-generate-speaker
Sync Generate Speaker
curl --request POST \
  --url https://mavi-backend.memories.ai/serve/api/v2/transcriptions/sync-generate-speaker \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "asset_id": "re_657929111888723968"
}
'
{
  "code": "0000",
  "msg": "success",
  "data": {
    "model": "pyannote",
    "items": [
      {
        "start": 0.03096875,
        "end": 0.13221875,
        "speaker": "SPEAKER_01"
      },
      {
        "start": 0.13221875,
        "end": 13.395968750000002,
        "speaker": "SPEAKER_00"
      }
    ]
  },
  "failed": false,
  "success": true
}
This endpoint allows you to identify speakers synchronously.

Code Example

import requests

BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2/transcriptions"
API_KEY = "sk-5f8843b8c0641efd5a3a6478b7679caa"
HEADERS = {
    "Authorization": f"{API_KEY}"
}

def sync_generate_speaker(asset_id: str):
    url = f"{BASE_URL}/sync-generate-speaker"
    data = {"asset_id": asset_id}
    resp = requests.post(url, json=data, headers=HEADERS)
    return resp.json()

# Usage example
result = sync_generate_speaker("re_657929111888723968")
print(result)

Response

Returns the speaker identification result directly. The response contains speaker segments with timing information organized in an array. Response Structure:
  • Returns a standard response format with code, msg, data, success, and failed fields
  • The data object contains:
    • model: The model used for speaker identification (e.g., “pyannote”)
    • items: Array of speaker segments, each containing:
      • start: Start time of the speaker segment in seconds
      • end: End time of the speaker segment in seconds
      • speaker: Speaker identifier (e.g., “SPEAKER_00”, “SPEAKER_01”)
{
  "code": "0000",
  "msg": "success",
  "data": {
    "model": "pyannote",
    "items": [
      {
        "start": 0.03096875,
        "end": 0.13221875,
        "speaker": "SPEAKER_01"
      },
      {
        "start": 0.13221875,
        "end": 13.395968750000002,
        "speaker": "SPEAKER_00"
      }
    ]
  },
  "failed": false,
  "success": true
}

Response Parameters

ParameterTypeDescription
codestringResponse code indicating the result status
msgstringResponse message describing the operation result
dataobjectResponse data object containing speaker identification results
data.modelstringThe model used for speaker identification (e.g., “pyannote”)
data.itemsarray[object]Array of speaker segments with timing information
data.items[].startnumberStart time of the speaker segment in seconds
data.items[].endnumberEnd time of the speaker segment in seconds
data.items[].speakerstringSpeaker identifier (e.g., “SPEAKER_00”, “SPEAKER_01”)
successbooleanIndicates whether the operation was successful
failedbooleanIndicates whether the operation failed

Authorizations

Authorization
string
header
required

Body

application/json
asset_id
string
required

The asset ID to identify speakers for

Example:

"re_657929111888723968"

Response

200 - application/json

Speaker identification result

code
string

Response code indicating the result status

Example:

"0000"

msg
string

Response message describing the operation result

Example:

"success"

data
object

Response data object containing speaker identification results

success
boolean

Indicates whether the operation was successful

Example:

true

failed
boolean

Indicates whether the operation failed

Example:

false