Try the playground
API reference · v1

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.

Endpoint
POST /api/v1/analyze
Authentication
Bearer API key
Default model
general-v2
Media
Image · Video · Audio · Text
01

Introduction

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 playground
02

Authentication

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.

03

Core analysis

The primary endpoint handles image, video, audio, and text analysis. Only POST is accepted.

POST/api/v1/analyze

Request structure

Send a JSON body with the media content and configuration.

Required parameters

ParameterTypeDescription
mediastringThe content to analyze: an HTTP(S) URL, a Base64 data URI (image, video, or audio), or raw text. See Media types.

Optional parameters

ParameterTypeDefaultDescription
categoriesarray[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_promptstringnullA custom analysis instruction, maximum 2,000 characters. The result appears under the key custom_analysis.
contextstringnullAdditional context appended to the user prompt sent to the model, maximum 100,000 characters. Applied to every requested category. See Additional context.
modelstringnullForce a specific agent. Must be the model UUID listed in Models. The model must be enabled and support the media type.
agent_strategystring"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.
detailstring"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 typeRuleNotes
videoStarts with data:video, or ends with .mp4, .mov, .webmMP4, MOV, WebM.
audioStarts with data:audio, or ends with .mp3, .wav, .ogg, .mpegSend audio as a Base64 data URI. Remote audio URLs are passed to the model as a text reference only.
imageStarts with data:image, any other data: URI, or any other http(s):// URLURLs with query strings after a video or audio extension are treated as images.
textAnything elseAnalyzed 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

FieldTypeDescription
timestampstringISO 8601 time the report was assembled.
model_idstringThe UUID of the model that processed the request.
model_namestringThe display name of the model.
execution_timefloatTotal processing time in seconds.
successful_categoriesintegerNumber of categories that returned a result.
failed_categoriesintegerNumber of categories that failed or timed out.
total_tokens_inintegerTotal input (prompt) tokens consumed by the agents.
total_tokens_outintegerTotal output (completion) tokens generated.
total_tokens_reasoningintegerReasoning tokens included in the output tokens, when reported by the provider.
total_tokens_cachedintegerInput tokens served from the provider prompt cache, when reported.
costfloatCost of the request in USD, as reported by the provider usage accounting.
04

Analysis categories

Categories define specific analysis tasks. Pass their IDs in categories; each result is returned under the listed output key.

Loading categories…
05

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.

Loading models…
06

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.

RuleDetail
Maximum length100,000 characters. Longer values are rejected with invalid_request (HTTP 400).
ScopeThe same context is sent with every requested category and with custom_prompt.
Empty valuesEmpty or whitespace-only strings are ignored, and the prompt is sent unchanged.
Token usageContext 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 typePer-call timeout
Image2 min
Audio5 min
Video15 min
Text90 s
Performance note. Video and audio analysis are significantly more computationally expensive than images. Allow for longer execution times and set client timeouts accordingly.
07

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.

  • cost is 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.
08

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

StatusCodeDescription
400invalid_requestMalformed JSON, missing media, invalid model UUID, custom_prompt over 2,000 characters, or context over 100,000 characters.
400invalid_categoriesRequested categories do not exist or are disabled, and no custom prompt was given.
401invalid_api_keyMissing or incorrect Authorization header.
403account_disabledThe user account has been disabled by an admin.
405invalid_requestA method other than POST was used.
413payload_too_largeMedia exceeds the maximum allowed size (10 MB).
500internal_errorUnexpected server or upstream provider error, or no active agent for the media type.
09

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"])