POST
/
v1
/
document
/
generate
curl --request POST \
  --url https://api.vlm.run/v1/document/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "metadata": {
    "environment": "dev",
    "session_id": "<string>",
    "allow_training": true
  },
  "config": {
    "prompt": "<string>",
    "detail": "auto",
    "response_model": "<any>",
    "json_schema": {},
    "max_retries": 3,
    "max_tokens": 4096,
    "temperature": 0,
    "confidence": true,
    "grounding": true
  },
  "url": "<string>",
  "file_id": "<string>",
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "callback_url": "<string>",
  "model": "vlm-1",
  "domain": "document.ocr",
  "batch": true
}'
{
  "usage": {
    "elements_processed": 123,
    "element_type": "image",
    "credits_used": 123
  },
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "completed_at": "2023-11-07T05:31:56Z",
  "response": "<any>",
  "status": "pending"
}

Authorizations

Authorization
string
header
required

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

Body

application/json

Request to the VLM API using a document (doc, docx, pptx, pdf).

metadata
object

Optional metadata to pass to the model.

config
object

The VLM generation config to be used for /<dtype>/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 and time when the request was created (in UTC timezone)

callback_url
string | null

The URL to call when the request is completed.

Minimum length: 1
model
string
default:
vlm-1

The model to use for generating the response.

Allowed value: "vlm-1"
domain
enum<string> | null

The domain identifier (e.g. document.invoice).

Available options:
document.ocr,
document.generative,
document.invoice,
document.markdown,
document.presentation,
document.receipt,
document.resume,
document.utility-bill,
document.bank-statement,
document.us-drivers-license,
healthcare.patient-referral,
healthcare.patient-medical-history,
healthcare.patient-consent,
healthcare.patient-intake,
healthcare.patient-insurance-card,
healthcare.patient-identification
batch
boolean
default:
true

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

Response

201
application/json
Successful Response

Base prediction response for all API responses.

usage
object

The usage metrics for the request.

id
string

Unique identifier of the response.

created_at
string

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

completed_at
string | 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:
enqueued,
pending,
running,
completed,
failed,
paused