Images & Multimodal Assets
Send images to decision models: the official SDK Image asset (multipart) or raw JSON inline base64, the 50MB per-file limit, automatic TypeSafe-Danger-Zone-Images opt-in, and per-model vision constraints.
Two ways to attach an image
Official SDK (multipart, recommended)
Pass the SDK’s Image asset in assets and reference it inside state/instructions/criteria. The SDK encodes the request as multipart/form-data; EasyJev translates it to the inline form the upstream accepts and delivers the bytes intact — media never touch the database.
from typesafe_sdk import Image, Noul photo = Image("product.png") result = client.system_one( state=f"Product photo: {photo}", questions={"damaged": Noul(instructions="Is the product damaged?")}, model="typesafe/jev-latest", # use a vision-capable model assets={"photo": photo}, )
Raw JSON (inline base64)
Without the SDK, put the asset directly in the JSON body under assets as {"key": {"type": "image", "format": "png", "data_base64": "..."}} and reference the key the same way. Both forms share the same limits.
{
"model": "typesafe/jev-latest",
"state": {"photo": "<image:photo>"},
"questions": {
"damaged": {"type": "noul", "instructions": "Is the product damaged?"}
},
"assets": {
"photo": {"type": "image", "format": "png", "data_base64": "iVBORw0KGgo..."}
}
}Limits & semantics
| Item | Rule |
|---|---|
| Per media file | 50 MB max (multipart: per-part bytes; JSON: decoded base64 size). Over the limit → 413 media_too_large. |
| Total request body | multipart 60 MB / pure JSON 70 MB defaults (must hold a 50 MB media after base64 expansion). |
| Billing | Images bill as ordinary input tokens by upstream usage — no media surcharge; rate-limit estimation excludes media bytes. |
| Opt-in header | The official TypeSafe-Danger-Zone-Images: true header is added automatically when assets are present — you never need to set it by hand. |
| Privacy | Media bytes are never stored: inline bodies are redacted to <media:N bytes> placeholders before archiving, multipart archives only the JSON part (truncated ~64 KB). |
Vision support varies by model. In practice the Jev family accepts images (smallest edge ≈ 512 px; references can be embedded in long text), while some non-Jev providers only accept whole-string references as top-level state items. Unsupported combinations return an upstream 4xx unchanged and are never billed. Pick a vision-capable model such as typesafe/jev-latest when sending images.