!pip install vlmrun
from vlmrun.client import VLMRun
client = VLMRun(api_key="<VLMRUN_API_KEY>")
# Create a skill from a prompt
skill = client.agent.skills.create(
prompt="Extract invoice_id, date, and total_amount from invoices.",
json_schema={
"type": "object",
"properties": {
"invoice_id": {"type": "string"},
"invoice_date": {"type": "string", "format": "date"},
"total_amount": {"type": "number"}
},
"required": ["invoice_id", "invoice_date", "total_amount"]
}
)
print(f"Created skill: {skill.id} ({skill.name})")
# Create a skill from a pre-uploaded file
skill = client.agent.skills.create(
name="invoice-extraction",
description="Extract structured data from invoices",
file_id="<file-id>" # Uploaded skill zip containing SKILL.md
)
# Create a skill from a chat session
skill = client.agent.skills.create(
session_id="<session-id>"
)
import { VlmRun } from "vlmrun";
const client = new VlmRun({
baseURL: "https://api.vlm.run/v1",
apiKey: "<VLMRUN_API_KEY>"
});
// Create a skill from a prompt
const skill = await client.agent.skills.create({
prompt: "Extract invoice_id, date, and total_amount from invoices.",
jsonSchema: {
type: "object",
properties: {
invoice_id: { type: "string" },
invoice_date: { type: "string", format: "date" },
total_amount: { type: "number" }
},
required: ["invoice_id", "invoice_date", "total_amount"]
}
});
console.log(skill);
# Create from prompt
curl -X POST "https://api.vlm.run/v1/skills/create" \
-H "Authorization: Bearer <VLMRUN_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Extract invoice_id, date, and total_amount from invoices.",
"json_schema": {
"type": "object",
"properties": {
"invoice_id": {"type": "string"},
"invoice_date": {"type": "string", "format": "date"},
"total_amount": {"type": "number"}
},
"required": ["invoice_id", "invoice_date", "total_amount"]
}
}'
# Create from pre-uploaded file
curl -X POST "https://api.vlm.run/v1/skills/create" \
-H "Authorization: Bearer <VLMRUN_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "invoice-extraction",
"description": "Extract structured data from invoices",
"file_id": "<file-id>"
}'
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"skill_version": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "completed"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create Skill
Create a skill from a file, prompt, or chat session.
Three creation modes (provide exactly one source): A. file_id: Use an already-uploaded skill zip (must contain SKILL.md). B. prompt (+ optional json_schema): Auto-generate SKILL.md and schema.json, package and upload. C. session_id: Retrieve chat history as the prompt, auto-generate SKILL.md.
All modes produce a skill zip stored in GCS and deduplicate by content hash.
!pip install vlmrun
from vlmrun.client import VLMRun
client = VLMRun(api_key="<VLMRUN_API_KEY>")
# Create a skill from a prompt
skill = client.agent.skills.create(
prompt="Extract invoice_id, date, and total_amount from invoices.",
json_schema={
"type": "object",
"properties": {
"invoice_id": {"type": "string"},
"invoice_date": {"type": "string", "format": "date"},
"total_amount": {"type": "number"}
},
"required": ["invoice_id", "invoice_date", "total_amount"]
}
)
print(f"Created skill: {skill.id} ({skill.name})")
# Create a skill from a pre-uploaded file
skill = client.agent.skills.create(
name="invoice-extraction",
description="Extract structured data from invoices",
file_id="<file-id>" # Uploaded skill zip containing SKILL.md
)
# Create a skill from a chat session
skill = client.agent.skills.create(
session_id="<session-id>"
)
import { VlmRun } from "vlmrun";
const client = new VlmRun({
baseURL: "https://api.vlm.run/v1",
apiKey: "<VLMRUN_API_KEY>"
});
// Create a skill from a prompt
const skill = await client.agent.skills.create({
prompt: "Extract invoice_id, date, and total_amount from invoices.",
jsonSchema: {
type: "object",
properties: {
invoice_id: { type: "string" },
invoice_date: { type: "string", format: "date" },
total_amount: { type: "number" }
},
required: ["invoice_id", "invoice_date", "total_amount"]
}
});
console.log(skill);
# Create from prompt
curl -X POST "https://api.vlm.run/v1/skills/create" \
-H "Authorization: Bearer <VLMRUN_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Extract invoice_id, date, and total_amount from invoices.",
"json_schema": {
"type": "object",
"properties": {
"invoice_id": {"type": "string"},
"invoice_date": {"type": "string", "format": "date"},
"total_amount": {"type": "number"}
},
"required": ["invoice_id", "invoice_date", "total_amount"]
}
}'
# Create from pre-uploaded file
curl -X POST "https://api.vlm.run/v1/skills/create" \
-H "Authorization: Bearer <VLMRUN_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "invoice-extraction",
"description": "Extract structured data from invoices",
"file_id": "<file-id>"
}'
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"skill_version": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"status": "completed"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}!pip install vlmrun
from vlmrun.client import VLMRun
client = VLMRun(api_key="<VLMRUN_API_KEY>")
# Create a skill from a prompt
skill = client.agent.skills.create(
prompt="Extract invoice_id, date, and total_amount from invoices.",
json_schema={
"type": "object",
"properties": {
"invoice_id": {"type": "string"},
"invoice_date": {"type": "string", "format": "date"},
"total_amount": {"type": "number"}
},
"required": ["invoice_id", "invoice_date", "total_amount"]
}
)
print(f"Created skill: {skill.id} ({skill.name})")
# Create a skill from a pre-uploaded file
skill = client.agent.skills.create(
name="invoice-extraction",
description="Extract structured data from invoices",
file_id="<file-id>" # Uploaded skill zip containing SKILL.md
)
# Create a skill from a chat session
skill = client.agent.skills.create(
session_id="<session-id>"
)
import { VlmRun } from "vlmrun";
const client = new VlmRun({
baseURL: "https://api.vlm.run/v1",
apiKey: "<VLMRUN_API_KEY>"
});
// Create a skill from a prompt
const skill = await client.agent.skills.create({
prompt: "Extract invoice_id, date, and total_amount from invoices.",
jsonSchema: {
type: "object",
properties: {
invoice_id: { type: "string" },
invoice_date: { type: "string", format: "date" },
total_amount: { type: "number" }
},
required: ["invoice_id", "invoice_date", "total_amount"]
}
});
console.log(skill);
# Create from prompt
curl -X POST "https://api.vlm.run/v1/skills/create" \
-H "Authorization: Bearer <VLMRUN_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Extract invoice_id, date, and total_amount from invoices.",
"json_schema": {
"type": "object",
"properties": {
"invoice_id": {"type": "string"},
"invoice_date": {"type": "string", "format": "date"},
"total_amount": {"type": "number"}
},
"required": ["invoice_id", "invoice_date", "total_amount"]
}
}'
# Create from pre-uploaded file
curl -X POST "https://api.vlm.run/v1/skills/create" \
-H "Authorization: Bearer <VLMRUN_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "invoice-extraction",
"description": "Extract structured data from invoices",
"file_id": "<file-id>"
}'
Authorizations
Body
Request to create a skill.
Three creation modes (provide exactly one): A. file_id: Create from a pre-built skill zip uploaded via POST /v1/files. B. prompt (+ optional json_schema): Auto-generate SKILL.md and schema.json. C. session_id: Retrieve chat history and auto-generate SKILL.md from messages.
For mode A (file_id), name and description are required. For modes B (prompt) and C (session_id), name and description are optional — if omitted, they are auto-generated by the LLM from the content.
Response
Successful Response
Response for skill creation.