Documentation Index
Fetch the complete documentation index at: https://api-tools.memories.ai/llms.txt
Use this file to discover all available pages before exploring further.
Product: Visual Intelligence — Live Video Understanding
Use case: Apply a custom AI prompt continuously to a live RTMP stream (e.g. captioning, activity recognition, custom monitoring), results to your callback every 5s
Mode: Server-Pull (you give us an RTMP URL → we pull → results to your callback)
Host: https://stream.memories.ai
Auth: Authorization: sk-mavi-... (no Bearer prefix)
Start a real-time analysis session on a live RTMP video stream. The server pulls the stream, runs an AI model against each frame window using your custom user_prompt, and pushes results to your callback URL every few seconds.
Each API key supports a maximum of 4 concurrent streaming tasks. Billing occurs every 5 seconds per active stream. If a credit deduction fails, the stream is automatically terminated.
Request Example
import requests
url = "https://stream.memories.ai/v1/understand/streamConnect"
headers = {
"Authorization": "sk-mavi-...",
"Content-Type": "application/json"
}
payload = {
"url": "rtmp://your.server/live/stream",
"user_prompt": "What stage is the food preparation at? Is it ready to eat?",
"system_prompt": "Track the current cooking progress.",
"callback": "https://your.app/callback",
"thinking": False
}
response = requests.post(url, headers=headers, json=payload)
print(response.json()) # {"status": 0, "task_id": "..."}
Parameters
RTMP stream URL for live video input (e.g. rtmp://your.server:1935/live/stream).
The analysis instruction applied to each frame window — e.g. "What is happening right now?".
Role or context for the AI — e.g. "You are a real-time video monitoring system.".
Public URL to receive continuous analysis results. Called repeatedly throughout the stream lifetime.
Enable reasoning mode for deeper analysis.
Start Stream Response
{
"status": 0,
"task_id": "5347085a-1747-4731-bdde-3856d09502c4",
"text": ""
}
Use the returned task_id to stop the stream via Stop Stream Video Understanding.
Callback Payload
Results are pushed to your callback URL continuously while the stream is active:
{
"status": 0,
"task_id": "5347085a-1747-4731-bdde-3856d09502c4",
"data": {
"text": "The chef is frying vegetables. The dish appears to be halfway done.",
"timestamp": "2025-10-22T12:00:45Z"
}
}
0 = success, -1 = failure.
Identifies which stream this callback belongs to. Use this to stop the stream.
AI-generated analysis for the current frame window.
UTC timestamp of the analysis frame.
Error Codes
| Code | Meaning |
|---|
-1 | Invalid request or parameters |
1001 | Maximum concurrent streams reached (4 per key) |
2001 | Credit deduction failed — stream auto-terminated |
5000 | Internal server error |
Billing
- Charged every 5 seconds per active stream
- If credit deduction fails, the stream stops automatically — recharge and call this endpoint again to resume
- This API does not support video file uploads or historical playback — live RTMP only
RTMP stream URL for live video input
Example:"rtmp://your.server:1935/live/stream"
Analysis instruction applied to each frame window
Example:"What is happening right now?"
Role or context for the AI
Example:"You are a real-time video monitoring system."
Public URL to receive continuous analysis results
Example:"https://your.app/callback"
Enable reasoning mode for deeper analysis
Stream started successfully
Example:"5347085a-1747-4731-bdde-3856d09502c4"