POST
/
v1
/
document
/
generate
from pathlib import Path
from vlmrun.client import VLMRun

client = VLMRun(api_key="<VLMRUN_API_KEY>")
response = client.document.generate(
    file=Path("<path>.pdf"),
    domain="<domain>"
)
{
  "usage": {
    "elements_processed": 123,
    "element_type": "image",
    "credits_used": 123,
    "steps": 123,
    "message": "<string>"
  },
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "completed_at": "2023-11-07T05:31:56Z",
  "response": "<any>",
  "status": "pending"
}

For all supported document domains, see the Hub Catalog.

from pathlib import Path
from vlmrun.client import VLMRun

client = VLMRun(api_key="<VLMRUN_API_KEY>")
response = client.document.generate(
    file=Path("<path>.pdf"),
    domain="<domain>"
)

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).

Response

201
application/json

Successful Response

Base prediction response for all API responses.