Skip to main content
POST
/
v1
/
document
/
execute
from pathlib import Path
from vlmrun.client import VLMRun

client = VLMRun(api_key="<VLMRUN_API_KEY>")
response = client.document.execute(
    name="<agent-name>", version="<agent-version>",
    file=Path("<path>.pdf"),
    batch=True,
    config=GenerationConfig(json_schema="<json-schema>", detail="<auto|lo|hi>", grounding="<True|False>"),
)
{
  "usage": {
    "elements_processed": 123,
    "element_type": "image",
    "credits_used": 123,
    "steps": 123,
    "message": "<string>",
    "duration_seconds": 0
  },
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "completed_at": "2023-11-07T05:31:56Z",
  "response": "<unknown>",
  "status": "pending",
  "domain": "<string>"
}
This feature is currently only available for our enterprise-tier customers. If you are interested in using this feature, please contact us.
from pathlib import Path
from vlmrun.client import VLMRun

client = VLMRun(api_key="<VLMRUN_API_KEY>")
response = client.document.execute(
    name="<agent-name>", version="<agent-version>",
    file=Path("<path>.pdf"),
    batch=True,
    config=GenerationConfig(json_schema="<json-schema>", detail="<auto|lo|hi>", grounding="<True|False>"),
)

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request to execute an agent.

name
string
required

Name of the agent

metadata
RequestMetadata · object

Optional metadata to pass to the model.

config
GenerationConfig · object

The VLM generation config to be used for //generate.

url
string | null

The URL of the file (provide either file_id or url).

file_id
string | null

The ID of the uploaded file (provide either file_id or url).

id
string

Unique identifier of the request.

created_at
string<date-time>

Date and time when the request was created (in UTC timezone)

callback_url
string<uri> | null

The URL to call when the request is completed.

Minimum string length: 1
version
string | null
default:latest

Version of the agent, defaults to latest.

batch
boolean
default:true

Whether to process the document in batch mode (async).

Response

Successful Response

Base prediction response for all API responses.

usage
CreditUsageResponse · object

The usage metrics for the request.

id
string

Unique identifier of the response.

created_at
string<date-time>

Date and time when the request was created (in UTC timezone)

completed_at
string<date-time> | null

Date and time when the response was completed (in UTC timezone)

response
any | null

The response from the model.

status
enum<string>
default:pending

The status of the job.

Available options:
pending,
enqueued,
running,
completed,
failed,
paused
domain
string | null

The domain of the prediction (e.g. document.invoice, image.caption).