Images¶
Send a photo or scan instead of text, and use the same schema as for text.
Requires a vision model
Image input works only when the deployment runs a vision-language model. Otherwise the API answers HTTP 400 ("tidak mendukung gambar"). Check with your administrator.
JSON (base64)¶
Put the image in image as base64, with or without a data-URI prefix.
context becomes an optional note about the image.
{
"image": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ…",
"context": "Read this receipt carefully.",
"schema": {
"merchant": {"type": "string"},
"total": {"type": "number", "max_digits": 9},
"paid": {"type": "bool"}
}
}
Send it to POST /v1/typed or POST /v1/typed/stream. The response has
"mode": "image".
Multipart upload¶
For files, use POST /v1/generate/image (or /v1/generate/image/stream)
with multipart/form-data:
curl https://api.trusttyped.com/v1/generate/image \
-F image=@invoice.jpg \
-F 'schema={"total": {"type": "number", "max_digits": 9}, "paid": {"type": "bool"}}' \
-F 'context=Read this receipt carefully.'
schema (and secrets, if used) are JSON strings in form fields. Other
form fields: system, model, max_new_tokens, thinking,
thinking_budget, review_threshold. See
Image upload.
Differences from text¶
extract: trueis not available (there is no text to copy from).messagescannot be combined with an image yet.provenance.image_hashis the SHA-256 of the image bytes.- The image is read once per request, also for multi-stage schemas.