Video Analysis
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.
POST
/
video-analyses
/
{id}
/
chat
cURL
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
Body
application/json
Response
Chat completion response.
A completed response object.
⌘I
cURL
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
}
}