MetaVision Insight API
A multi-modal analysis engine for images, video, audio, and text. Define reusable analysis categories or send custom prompts, and receive structured JSON with usage and cost accounting.
POST /api/v1/analyzeIntroduction
MetaVision is a high-performance multi-modal AI analysis engine.
Unlike traditional computer vision APIs that return static labels, MetaVision lets you define flexible analysis categories or use custom prompts to extract structured intelligence from media: images, videos, audio, and raw text.
Open the interactive playgroundAuthentication
Every analysis request requires an API key sent as a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEY
The public category and model listings used on this page do not require authentication.
Core analysis
The primary endpoint handles image, video, audio, and text analysis. Only POST is accepted.
Request structure
Send a JSON body with the media content and configuration.
Required parameters
| Parameter | Type | Description |
|---|---|---|
media | string | The content to analyze: an HTTP(S) URL, a Base64 data URI (image, video, or audio), or raw text. See Media types. |
Optional parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
categories | array[string] | ["title", "description"] | Category IDs to execute, for example ["title", "objects"]. When omitted or empty and no custom_prompt is given, title and description run. |
custom_prompt | string | null | A custom analysis instruction, maximum 2,000 characters. The result appears under the key custom_analysis. |
context | string | null | Additional context appended to the user prompt sent to the model, maximum 100,000 characters. Applied to every requested category. See Additional context. |
model | string | null | Force a specific agent. Must be the model UUID listed in Models. The model must be enabled and support the media type. |
agent_strategy | string | "default" | Used when no model is forced. default uses the recommended default model (general-v2); best uses the highest reliability score. If the default model cannot handle the media type, the highest-scoring capable agent is used. random is accepted and currently routes the same way as default. |
detail | string | "high" | Accepted values: low or high. Reserved for analysis depth; it does not currently change model behaviour. |
Media types
The media type is detected from the media value in the following order. It determines which agents are capable and which timeout applies.
| Detected type | Rule | Notes |
|---|---|---|
| video | Starts with data:video, or ends with .mp4, .mov, .webm | MP4, MOV, WebM. |
| audio | Starts with data:audio, or ends with .mp3, .wav, .ogg, .mpeg | Send audio as a Base64 data URI. Remote audio URLs are passed to the model as a text reference only. |
| image | Starts with data:image, any other data: URI, or any other http(s):// URL | URLs with query strings after a video or audio extension are treated as images. |
| text | Anything else | Analyzed as raw text. Supported by every enabled agent. |
Response structure
The API returns a JSON object divided into metadata and per-category results.
{
"meta": {
"timestamp": "2024-03-20T10:00:00.000Z",
"model_id": "8f32e9...",
"model_name": "general-v2",
"execution_time": 2.45,
"successful_categories": 2,
"failed_categories": 0,
"total_tokens_in": 1500,
"total_tokens_out": 300,
"total_tokens_reasoning": 0,
"total_tokens_cached": 0,
"cost": 0.0045
},
"data": {
"title": {
"result": "Sunset over a mountain range"
},
"custom_analysis": {
"result": "The mood is serene and peaceful."
}
}
}
A category that fails or times out is still present under its output key, as { "error": "..." }, and is counted in failed_categories.
Meta object
| Field | Type | Description |
|---|---|---|
timestamp | string | ISO 8601 time the report was assembled. |
model_id | string | The UUID of the model that processed the request. |
model_name | string | The display name of the model. |
execution_time | float | Total processing time in seconds. |
successful_categories | integer | Number of categories that returned a result. |
failed_categories | integer | Number of categories that failed or timed out. |
total_tokens_in | integer | Total input (prompt) tokens consumed by the agents. |
total_tokens_out | integer | Total output (completion) tokens generated. |
total_tokens_reasoning | integer | Reasoning tokens included in the output tokens, when reported by the provider. |
total_tokens_cached | integer | Input tokens served from the provider prompt cache, when reported. |
cost | float | Cost of the request in USD, as reported by the provider usage accounting. |
Analysis categories
Categories define specific analysis tasks. Pass their IDs in categories; each result is returned under the listed output key.
Available models
Use the UUID below in the model parameter to force a specific agent. If no model is forced, the default strategy selects general-v2 automatically.
Advanced options
Additional context
The optional context parameter lets you supply supporting information, such as metadata, transcripts, prior moderation notes, or business rules, that the model should take into account while analyzing the media.
| Rule | Detail |
|---|---|
| Maximum length | 100,000 characters. Longer values are rejected with invalid_request (HTTP 400). |
| Scope | The same context is sent with every requested category and with custom_prompt. |
| Empty values | Empty or whitespace-only strings are ignored, and the prompt is sent unchanged. |
| Token usage | Context counts toward input tokens and therefore toward the request cost. |
{
"media": "https://example.com/image.jpg",
"categories": ["description"],
"context": "Uploaded by user #4213 in the 'fitness' channel. Previous uploads were flagged for nudity."
}
Agent selection
By default (agent_strategy: "default"), MetaVision routes requests to the recommended default model, general-v2. Use best to always select the highest reliability score, or force a specific model UUID.
Agent consistency
A single agent handles every category within a request. This prevents conflicting interpretations of the media across different analysis tasks.
Audio analysis
MetaVision supports MP3, WAV, and OGG audio. The engine listens to speech, tone, and background audio. Send audio as a Base64 data URI; maximum file size is 10 MB.
Video analysis
MetaVision supports MP4, MOV, and WebM video. The engine samples frames from the video to perform the analysis.
Timeouts
Each category runs as its own model call, in parallel. Each call has the following time limit; a call that exceeds it is reported as Timeout.
| Media type | Per-call timeout |
|---|---|
| Image | 2 min |
| Audio | 5 min |
| Video | 15 min |
| Text | 90 s |
Usage & cost
MetaVision enables provider usage accounting on every upstream call, so token counts and the cost returned in meta come directly from the provider that served the request.
costis expressed in USD and is the sum of the per-category costs reported for the request.- When a request runs through a bring-your-own-key route, the upstream inference cost reported by the provider is included in the total.
- Requests are billed per category: selecting three categories performs three model calls, each with its own token usage.
- If a provider does not return usage accounting for a call, MetaVision falls back to the per-million-token rates configured for the agent.
- Failed or timed-out categories report zero tokens and zero cost.
Error handling
Errors can occur at the request level (4xx/5xx status codes) or at the individual category level. Request-level errors return this body:
{
"error": true,
"message": "Invalid API key.",
"code": "invalid_api_key"
}
API errors
| Status | Code | Description |
|---|---|---|
| 400 | invalid_request | Malformed JSON, missing media, invalid model UUID, custom_prompt over 2,000 characters, or context over 100,000 characters. |
| 400 | invalid_categories | Requested categories do not exist or are disabled, and no custom prompt was given. |
| 401 | invalid_api_key | Missing or incorrect Authorization header. |
| 403 | account_disabled | The user account has been disabled by an admin. |
| 405 | invalid_request | A method other than POST was used. |
| 413 | payload_too_large | Media exceeds the maximum allowed size (10 MB). |
| 500 | internal_error | Unexpected server or upstream provider error, or no active agent for the media type. |
Code examples
import requests
API_KEY = "your_api_key"
API_URL = "https://metavision-insight.api.efficientstack.com/api/v1/analyze"
payload = {
"media": "https://example.com/image.jpg",
"categories": ["title", "description"],
"custom_prompt": "Describe the emotion.",
"context": "Uploaded by user #4213. Channel: fitness. Locale: fr-CA.",
# "model": "8f32e9...", # Optional UUID override
"agent_strategy": "default"
}
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
response = requests.post(API_URL, json=payload, headers=headers)
data = response.json()
print(data["meta"]["cost"], data["data"])
const API_KEY = 'your_api_key';
const API_URL = 'https://metavision-insight.api.efficientstack.com/api/v1/analyze';
async function analyzeMedia() {
const response = await fetch(API_URL, {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
media: "data:audio/mp3;base64,SUQzBAAAAAAA...", // Audio as Base64 data URI
categories: ["title"],
custom_prompt: "Transcribe the speech and describe tone.",
context: "Podcast episode 42. Speakers: host (male), guest (female).",
agent_strategy: "default" // Uses the recommended default model
})
});
const result = await response.json();
console.log(result.meta.cost, result.data);
}
analyzeMedia();
curl -X POST "https://metavision-insight.api.efficientstack.com/api/v1/analyze" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"media": "https://example.com/image.jpg",
"custom_prompt": "List all colors present.",
"context": "Product photo for SKU 88213, studio lighting.",
"agent_strategy": "default"
}'