Chat about video analysis
Have a conversation about a completed video analysis. The AI has full access to the analysis data and can explain metrics, provide recommendations, and answer questions.
Requirements: The video analysis must be in completed status.
curl -X POST https://app.mavera.io/api/v1/video-analyses/YOUR_ANALYSIS_ID/chat \
-H "Authorization: Bearer mvra_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "user", "content": "What are the main strengths of this ad?" }
]
}'import requests
headers = {"Authorization": "Bearer mvra_live_your_key_here"}
analysis_id = "YOUR_ANALYSIS_ID"
# Chat about the analysis
response = requests.post(
f"https://app.mavera.io/api/v1/video-analyses/{analysis_id}/chat",
headers=headers,
json={
"messages": [
{"role": "user", "content": "What are the main strengths of this ad?"}
]
}
)
print(response.json()["choices"][0]["message"]["content"])
# Follow-up question
response = requests.post(
f"https://app.mavera.io/api/v1/video-analyses/{analysis_id}/chat",
headers=headers,
json={
"messages": [
{"role": "user", "content": "What are the main strengths of this ad?"},
{"role": "assistant", "content": response.json()["choices"][0]["message"]["content"]},
{"role": "user", "content": "How can we improve the emotional impact?"}
]
}
)
print(response.json()["choices"][0]["message"]["content"])const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [{role: 'user', content: 'What are the main strengths of this ad?'}],
stream: false
})
};
fetch('https://app.mavera.io/api/v1/video-analyses/{id}/chat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.mavera.io/api/v1/video-analyses/{id}/chat"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What are the main strengths of this ad?\"\n }\n ],\n \"stream\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "resp_abc123def456abc123def456",
"object": "response",
"created_at": 1706345678,
"status": "completed",
"model": "mavera-1",
"output": [
{
"id": "msg_abc123def456",
"type": "message",
"role": "assistant",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "Quantum computing uses qubits that can exist in multiple states simultaneously, enabling processing of many possibilities at once."
}
]
}
],
"usage": {
"input_tokens": 42,
"output_tokens": 68,
"total_tokens": 110,
"credits_used": 3
}
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"param": null
}
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"param": null
}
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"param": null
}
}Authorizations
API key prefixed with mvra_live_. Create keys at Settings > Developer > API Keys.
Path Parameters
The video analysis ID.
Body
Response
Chat completion response.
A completed response object.
Unique response ID with resp_ prefix.
"resp_abc123def456abc123def456"
Always response.
response "response"
Unix timestamp (seconds) when the response was created.
1706345678
Response status.
completed, in_progress, failed "completed"
The model used.
"mavera-1"
Ordered list of output items. Typically a single message item with text, or one or more function_call items when the model wants to call tools.
A message output item.
- Option 1
- Option 2
Show child attributes
Show child attributes
Token and credit usage.
Show child attributes
Show child attributes
Mavera's built-in server-side tools automatically executed during this request. Only present when server tools were used.
Show child attributes
Show child attributes
Structured analysis data. Present when analysis_mode is true.
Show child attributes
Show child attributes
Present when text.format.type is json_schema. Contains the parsed JSON object — a convenience field, same data is also in output[0].content[0].text.
{
"sentiment": "positive",
"score": 8.5,
"summary": "Great product"
}
curl -X POST https://app.mavera.io/api/v1/video-analyses/YOUR_ANALYSIS_ID/chat \
-H "Authorization: Bearer mvra_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "user", "content": "What are the main strengths of this ad?" }
]
}'import requests
headers = {"Authorization": "Bearer mvra_live_your_key_here"}
analysis_id = "YOUR_ANALYSIS_ID"
# Chat about the analysis
response = requests.post(
f"https://app.mavera.io/api/v1/video-analyses/{analysis_id}/chat",
headers=headers,
json={
"messages": [
{"role": "user", "content": "What are the main strengths of this ad?"}
]
}
)
print(response.json()["choices"][0]["message"]["content"])
# Follow-up question
response = requests.post(
f"https://app.mavera.io/api/v1/video-analyses/{analysis_id}/chat",
headers=headers,
json={
"messages": [
{"role": "user", "content": "What are the main strengths of this ad?"},
{"role": "assistant", "content": response.json()["choices"][0]["message"]["content"]},
{"role": "user", "content": "How can we improve the emotional impact?"}
]
}
)
print(response.json()["choices"][0]["message"]["content"])const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [{role: 'user', content: 'What are the main strengths of this ad?'}],
stream: false
})
};
fetch('https://app.mavera.io/api/v1/video-analyses/{id}/chat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.mavera.io/api/v1/video-analyses/{id}/chat"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What are the main strengths of this ad?\"\n }\n ],\n \"stream\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "resp_abc123def456abc123def456",
"object": "response",
"created_at": 1706345678,
"status": "completed",
"model": "mavera-1",
"output": [
{
"id": "msg_abc123def456",
"type": "message",
"role": "assistant",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "Quantum computing uses qubits that can exist in multiple states simultaneously, enabling processing of many possibilities at once."
}
]
}
],
"usage": {
"input_tokens": 42,
"output_tokens": 68,
"total_tokens": 110,
"credits_used": 3
}
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"param": null
}
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"param": null
}
}{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"code": "invalid_api_key",
"param": null
}
}