Skip to main content
This guide walks you through using a skill to extract structured data from a document in a single API call.

Prerequisites

pip install vlmrun
Set your API key:
export VLMRUN_API_KEY="your-api-key"

Extract Data with a Skill

Pass a skill by name in the config.skills parameter to extract structured JSON from a document:
from pathlib import Path
from vlmrun.client import VLMRun
from vlmrun.client.types import GenerationConfig, AgentSkill

client = VLMRun(api_key="<VLMRUN_API_KEY>")

response = client.document.generate(
    file=Path("invoice.pdf"),
    model="vlm-1",
    config=GenerationConfig(
        skills=[AgentSkill(skill_name="invoice-extraction", version="latest")]
    ),
)

print(response.response)
The platform automatically applies the skill’s prompt and JSON schema — no need to specify a domain or write a custom prompt.

Next Steps

Using Skills

Use skills across all generation endpoints

Create a Skill

Build your own custom skills

Skill Spec

Understand how skills are structured

Version Pinning

Pin skill versions for reproducibility