Python SDK
montek on PyPI, sync and async, typed with pydantic.
pip install montekfrom montek import Montek
montek = Montek(api_key=os.environ["MONTEK_API_KEY"]) # api_key defaults to MONTEK_API_KEY
r = montek.extract(file="order.pdf", model="langbiang-extract-1.0", lang="ja", fields=["order_number"])
r.fields; r.line_items; r.usage.count
job = montek.cad.create(file="sketch.jpg", model="fansipan-cad-1.0")
done = job.wait() # polls with backoff; or use a webhook
dxf = montek.cad.get_part(done.id, 1) # the first part, as DXF text
montek.usage.get(from_="2026-10-01", to="2026-10-31")
montek.models.list()
montek.me() # the key, its project and organization, webhook secret and plansThe async client has the same methods:
from montek import AsyncMontek
async with AsyncMontek() as montek:
r = await montek.extract(file="order.pdf", model="langbiang-extract-1.0")Errors and retries
AuthError (401, 403), NoPlanError (402), RateLimitError (429), ValidationError (other 4xx) and ServerError (5xx). 429 and 5xx are retried with backoff, following Retry-After; every POST carries an Idempotency-Key.
Webhooks
from montek import verify_webhook
event = verify_webhook(raw_body, headers["Montek-Signature"], os.environ["MONTEK_WEBHOOK_SECRET"])The source and changelog are public, in the montek-sdk-python repository.