Image upload¶
POST /v1/generate/image¶
Fill a schema from an uploaded image file. Body: multipart/form-data.
Requires a deployment with a vision model (see Images).
| Form field | Type | Default | Description |
|---|---|---|---|
image |
file | required | JPEG, PNG or another common image format. |
schema |
string | required | The schema as a JSON string. |
context |
string | "Read this image carefully." |
A note about the image. |
system |
string | – | Shared instructions. |
max_new_tokens |
integer | 32 |
Answer budget per field (1–512). |
review_threshold |
number | 0.5 |
See /v1/typed. |
secrets |
string | – | JSON string of an object, for tool calls. |
model, dtype, thinking, thinking_budget |
– | – | As in /v1/typed. |
curl https://api.trusttyped.com/v1/generate/image \
-F image=@receipt.jpg \
-F 'schema={"merchant": {"type": "string"}, "total": {"type": "number", "max_digits": 9}}' \
-F 'review_threshold=0.7'
The response is a response object without mode;
provenance.image_hash is the SHA-256 of the uploaded bytes.
POST /v1/generate/image/stream¶
Same form fields; returns NDJSON like /v1/typed/stream.