POST
/
transcriptions
/
async-summary
Async Generate Summary
curl --request POST \
  --url https://mavi-backend.memories.ai/serve/api/v2/transcriptions/async-summary \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "asset_id": "re_657929111888723968"
}
'
{
  "code": "0000",
  "msg": "success",
  "data": {
    "task_id": "ec2449885ba84c4f943a80ff0633158e"
  },
  "failed": false,
  "success": true
}
This endpoint allows you to generate a summary of the transcription asynchronously.

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 async_generate_summary(transcription_id: str):
    url = f"{BASE_URL}/async-summary"
    data = {"asset_id": transcription_id}
    resp = requests.post(url, json=data, headers=HEADERS)
    return resp.json()

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

Response

Returns the summary generation task information.
{
  "code": "0000",
  "msg": "success",
  "data": {
    "task_id": "ec2449885ba84c4f943a80ff0633158e"
  },
  "failed": false,
  "success": true
}

Response Parameters

ParameterTypeDescription
codestringResponse code indicating the result status
msgstringResponse message describing the operation result
dataobjectResponse data object containing task information
data.task_idstringUnique identifier of the summary generation task
successbooleanIndicates whether the operation was successful
failedbooleanIndicates whether the operation failed

Callback Response Parameters

When the summary generation is complete, a callback will be sent to your configured webhook URL.
ParameterTypeDescription
codestringResponse code (“0000” indicates success)
messagestringStatus message (e.g., “SUCCESS”)
dataobjectResponse data object containing the summary result and metadata
data.dataobjectInner data object containing summary and usage information
data.data.summarystringThe generated summary text of the video content
data.data.usageobjectUsage statistics for the API call
data.data.usage.durationnumberProcessing duration in seconds
data.data.usage.modelstringThe AI model used for summary generation (e.g., “gemini-2.5-flash”)
data.data.usage.output_tokensintegerNumber of tokens in the generated summary
data.data.usage.prompt_tokensintegerNumber of tokens in the input prompt
data.msgstringDetailed message about the operation result
data.successbooleanIndicates whether the summary generation was successful
task_idstringThe task ID associated with this summary generation request

Understanding the Callback Response

The callback response has a nested structure with the summary and usage information inside data.data. Response Structure:
callback_response
├── code: "0000"
├── message: "SUCCESS"
├── data
│   ├── data
│   │   ├── summary: "The generated summary text..."
│   │   └── usage
│   │       ├── duration: 0.0
│   │       ├── model: "gemini-2.5-flash"
│   │       ├── output_tokens: 264
│   │       └── prompt_tokens: 215102
│   ├── msg: "Video summary completed successfully"
│   └── success: true
└── task_id: "67d848a979ae40ce927cfccf862e5e96"
How to access the data:
  • Summary text: callback_response.data.data.summary
  • Usage statistics: callback_response.data.data.usage
  • Model used: callback_response.data.data.usage.model
  • Token counts: callback_response.data.data.usage.output_tokens and callback_response.data.data.usage.prompt_tokens
  • Success status: callback_response.data.success
  • Task ID: callback_response.task_id

Authorizations

Authorization
string
header
required

Body

application/json
asset_id
string
required

The transcription asset ID

Example:

"re_657929111888723968"

Response

200 - application/json

Summary generation task information

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 task information

success
boolean

Indicates whether the operation was successful

Example:

true

failed
boolean

Indicates whether the operation failed

Example:

false