from PIL import Image
from vlmrun.client import VLMRun
client = VLMRun(api_key="<VLMRUN_API_KEY>")
response = client.image.generate(
images=[Image.open("<path>.jpg")],
domain="<domain>"
)
from PIL import Image
from vlmrun.client import VLMRun
from vlmrun.client.types import GenerationConfig, AgentSkill
client = VLMRun(api_key="<VLMRUN_API_KEY>")
response = client.image.generate(
images=[Image.open("<path>.jpg")],
domain="<domain>",
config=GenerationConfig(
skills=[AgentSkill(skill_name="<skill-name>")]
)
)
import { VlmRun } from "vlmrun";
const client = new VlmRun({apiKey: "<VLMRUN_API_KEY>"});
const fileResponse = await client.files.upload(
filePath: "<path>.jpg"
);
const response = await client.image.generate({
fileId: fileResponse.id,
domain: "<domain>",
});
import { VlmRun } from "vlmrun";
const client = new VlmRun({apiKey: "<VLMRUN_API_KEY>"});
const fileResponse = await client.files.upload(
filePath: "<path>.jpg"
);
const response = await client.image.generate({
fileId: fileResponse.id,
config: {
skills: [{ skillName: "<skill-name>" }],
},
});
{
"usage": {
"elements_processed": 123,
"element_type": "image",
"credits_used": 123,
"steps": 123,
"message": "<string>",
"duration_seconds": 0,
"service_tier": "<string>",
"mode_multiplier": 123,
"standard_cost_dollars": 123,
"cost_dollars": 123,
"savings_dollars": 123
},
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"response": "<unknown>",
"status": "pending",
"domain": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Image → JSON
Generate structured prediction for the given image.
from PIL import Image
from vlmrun.client import VLMRun
client = VLMRun(api_key="<VLMRUN_API_KEY>")
response = client.image.generate(
images=[Image.open("<path>.jpg")],
domain="<domain>"
)
from PIL import Image
from vlmrun.client import VLMRun
from vlmrun.client.types import GenerationConfig, AgentSkill
client = VLMRun(api_key="<VLMRUN_API_KEY>")
response = client.image.generate(
images=[Image.open("<path>.jpg")],
domain="<domain>",
config=GenerationConfig(
skills=[AgentSkill(skill_name="<skill-name>")]
)
)
import { VlmRun } from "vlmrun";
const client = new VlmRun({apiKey: "<VLMRUN_API_KEY>"});
const fileResponse = await client.files.upload(
filePath: "<path>.jpg"
);
const response = await client.image.generate({
fileId: fileResponse.id,
domain: "<domain>",
});
import { VlmRun } from "vlmrun";
const client = new VlmRun({apiKey: "<VLMRUN_API_KEY>"});
const fileResponse = await client.files.upload(
filePath: "<path>.jpg"
);
const response = await client.image.generate({
fileId: fileResponse.id,
config: {
skills: [{ skillName: "<skill-name>" }],
},
});
{
"usage": {
"elements_processed": 123,
"element_type": "image",
"credits_used": 123,
"steps": 123,
"message": "<string>",
"duration_seconds": 0,
"service_tier": "<string>",
"mode_multiplier": 123,
"standard_cost_dollars": 123,
"cost_dollars": 123,
"savings_dollars": 123
},
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"response": "<unknown>",
"status": "pending",
"domain": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}image domains, see the Hub Catalog.
from PIL import Image
from vlmrun.client import VLMRun
client = VLMRun(api_key="<VLMRUN_API_KEY>")
response = client.image.generate(
images=[Image.open("<path>.jpg")],
domain="<domain>"
)
from PIL import Image
from vlmrun.client import VLMRun
from vlmrun.client.types import GenerationConfig, AgentSkill
client = VLMRun(api_key="<VLMRUN_API_KEY>")
response = client.image.generate(
images=[Image.open("<path>.jpg")],
domain="<domain>",
config=GenerationConfig(
skills=[AgentSkill(skill_name="<skill-name>")]
)
)
import { VlmRun } from "vlmrun";
const client = new VlmRun({apiKey: "<VLMRUN_API_KEY>"});
const fileResponse = await client.files.upload(
filePath: "<path>.jpg"
);
const response = await client.image.generate({
fileId: fileResponse.id,
domain: "<domain>",
});
import { VlmRun } from "vlmrun";
const client = new VlmRun({apiKey: "<VLMRUN_API_KEY>"});
const fileResponse = await client.files.upload(
filePath: "<path>.jpg"
);
const response = await client.image.generate({
fileId: fileResponse.id,
config: {
skills: [{ skillName: "<skill-name>" }],
},
});
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request to the VLM API (i.e. structured prediction).
List of base64 encoded images or URLs to the images.
Optional metadata to pass to the model.
Hide child attributes
Hide child attributes
The environment where the request was made.
dev, staging, prod The session ID of the request
Whether to enable logs for this request.
Whether the file can be used for training
Whether to allow retention of the data
Extra metadata for the request (e.g. dataset_id, subset_id).
The VLM generation config to be used for //generate.
Hide child attributes
Hide child attributes
Additional user instructions appended to the application or skill prompt for this request.
The detail level to use for processing multimodal data.
auto, hi, lo The overridden JSON schema to use for the model. To be used instead of the response model.
List of agent skills to enable for this generation request.
Hide child attributes
Hide child attributes
The type of the skill. Use 'skill_reference' for DB-stored skills referenced by id/name. Use 'inline' to provide the skill as a base64-encoded zip bundle.
The unique identifier of the skill — a UUID or a name string (e.g., 'pillow', 'batch-processing').
Human-readable skill name for lookup (e.g., 'invoice-extraction'). Alternative to skill_id. Deprecated in favour of skill_id.
The version of the skill — an integer (e.g. 2) or 'latest'.
DEPRECATED: Use 'skill_version' instead. The version of the skill.
Human-readable name for the inline skill (used for discovery and logging).
Short description of what the inline skill does.
Source payload for inline skills. Contains the base64-encoded zip bundle with type, media_type, and data fields.
Hide child attributes
Hide child attributes
Base64-encoded zip bundle containing the skill files.
Encoding type for the inline skill data. Currently only 'base64' is supported.
"base64"MIME type of the skill bundle. Must be 'application/zip'.
DEPRECATED: Use 'source.data' instead. Base64-encoded zip bundle containing the skill files (inline skills only).
The GraphQL statement to use for the application. If provided, the response model will be generated from the GraphQL statement.
The maximum number of retries to use for the application.
The maximum number of tokens to use for the application.
The temperature to use for the application.
Include confidence scores in the response (included in the _metadata field).
Include grounding in the response (included in the _metadata field).
Include keyframes in the video transcription response.
Duration in seconds for each video segment when chunking a video for transcription. Defaults to 150.0s.
x >= 1Number of frames to sample per video segment for captioning. Defaults to 8.
x >= 1Model ID to use for video segment captioning (e.g. 'vlmrun-orion-1:fast'). When omitted, the server default is used.
How to pass video to the captioning model: 'frames' extracts N JPEG frames per segment, 'native_video' sends the mp4 clip directly via video_url for models with native video understanding. Defaults to 'native_video' for Qwen deployment models, 'frames' for others.
frames, native_video When True, transcribe the audio track to align segment boundaries. When False (default), skip ASR and use fixed-duration video segments only (visual-only captioning).
Plain-text chat transcript (prior turns + current request) used to ground video captioning / transcription on what the user wants extracted.
0-indexed page indices to process for document files. If None, all pages are processed.
Reuse cached representations of document/video content across calls. When True (default), the file is cached after the first call so repeated queries against the same file skip re-transmitting its contents. Set to False to always send the full content.
Delivery tier for the request. 'standard'/'default' uses baseline rates, 'flex' applies a 50% discount with higher latency, 'priority' applies a 1.8x premium. When omitted (or 'auto'), the server default ('standard') applies. The chosen tier drives both billing and the latency/availability SLO.
auto, default, standard, flex, priority Unique identifier of the request.
Date and time when the request was created (in UTC timezone)
The URL to call when the request is completed.
1The model to use for generating the response.
vlm-1, vlm-1:auto, vlm-1:fast, vlm-1:pro The domain identifier (e.g. image.caption). Optional when a skill is provided via config.skills.
aerospace.remote-sensing, document.invoice, document.markdown, document.receipt, document.resume, image.caption, image.object-detection, image.person-detection, retail.product-catalog Whether to process the image in batch mode (async).
Response
Successful Response
Base prediction response for all API responses.
The usage metrics for the request.
Hide child attributes
Hide child attributes
Number of elements processed.
The type of element processed (e.g. image, page, video, audio).
image, page, video, audio Amount of total credits used.
Number of steps processed, in case of agentic execution.
The message from the credit usage job.
Duration of the request in seconds.
Delivery tier (standard, priority, flex).
Pricing multiplier applied to standard cost.
Pre-multiplier customer cost in USD, derived from tokens and unit rates.
Effective customer cost in USD after the service-tier multiplier.
Discount in USD when using flex (standard_cost_dollars - cost_dollars).
Unique identifier of the response.
Date and time when the request was created (in UTC timezone)
Date and time when the response was completed (in UTC timezone)
The response from the model. May be an empty dict/list when the model found no extractable content (valid for status=completed).
The status of the job.
pending, enqueued, running, completed, failed, paused The domain of the prediction (e.g. document.invoice, image.caption).