Video Searching API
Managed token-authenticated endpoint for agentic video search via SSE.
https://mavi-backend.memories.ai/serve/api/v2
Auth: Authorization: sk-mavi-... (no Bearer prefix)SSE Streaming
17 Built-in Tools
Pay-per-use
Code Examples
SSE Event Types
The stream emits named events using the standardevent: / data: SSE format. Each data payload is JSON.
started
Emitted once when the agent session begins.
progress
Emitted at each agent step to indicate progress.
clarification
Emitted when enable_clarification is true and the query is ambiguous. The stream ends after this event.
tool_call
Emitted when the agent invokes a tool.
tool_result
Emitted after a tool finishes execution.
error
Emitted when a step or the entire run encounters a non-fatal error.
complete
Final event containing the full structured response. The stream closes after this event.
Response Fields
Top-level
VideoRef
Available Tools
The agent autonomously selects from these tools during the agentic loop:Billing & Cost Breakdown
Each API call may trigger multiple billable events depending on which tools the agent selects. All charges are deducted automatically after successful execution — there is no upfront reservation per tool call.Gemini Model (Token-based)
The agent currently uses Gemini 3.1 Pro (gemini-3.1-pro-preview). Gemini is called at two stages, both billed by token count using the same MODEL billing type as the Gemini VLM API.
usage_metrics.token_usage.
Social Platform Search Tools
These tools call third-party scraping APIs (Apify or RapidAPI). The agent picks the available channel automatically.Creator / Profile Tools
Exa.ai Tools
exa_get_content is the only tool billed per item rather than per call. If the agent extracts content from 5 URLs in a single invocation, 5 × $0.001 = $0.005 is charged.YouTube Tools — Free
Video Analysis Tools — Billed by Underlying Service
These tools call existing Memories.ai internal services that have their own billing. No additional agent-level charge is applied. See the corresponding API docs for pricing:Cost Example
A typical discovery query like “Find trending AI videos on TikTok this week” may incur:complete event’s usage_metrics.tool_invocations and tools_used fields.
Error Handling
If the request body is invalid, the endpoint returns a standard JSON error (not SSE):error SSE event is emitted and the stream may still complete with partial results.
Rate Limits
This endpoint uses the Lite rate-limit tier. Check your plan for specific limits.Authorizations
Body
Natural-language search query
"Find trending AI coding tool videos on TikTok from the past week"
Restrict to specific platforms. If omitted, all platforms are searched.
youtube, tiktok, instagram, twitter Maximum number of video results to return
Recency filter for video results
past_24h, past_week, past_month, past_year Maximum agent iteration steps
When true, the agent may return a clarification event instead of searching if the query is ambiguous
Response
SSE stream of agent events (started → progress → tool_call → tool_result → complete)
Unique session identifier
Original user query
Natural-language answer summarizing findings
Structured list of discovered videos
