Turn on Jev images before you send a box
Images and box questions are off until the request carries TypeSafe-Danger-Zone-Images. The box type is only on jev-1.14.0. The curl below is the docs' multipart example, not a call this directory made.
Turn on Jev images before you send a box
The switch
Jev 1.14 can take an image. It will not, until the request says so.
The images docs say images and box questions are off by default. Each request that contains an image or a box question needs the header TypeSafe-Danger-Zone-Images: true. The models page still lists Jev 1.14 input as text. Both sentences are on official pages. The header is how you leave the text default.
The October 14 blog says the box type, one bounding box, is enabled only for jev-1.14.0. A 1.13 client that copies a box question is not on the path the blog turned on.
This guide did not upload a photo. The curl is the docs' example.
Send the image as its own part
The recommended upload is multipart. The first part is named request, content type application/json. Each image is its own file part. The image's part field inside assets must match that file part's name.
Rules from the same page:
- Part names are unique and not empty.
requestis reserved for the JSON body. - An image part may be
image/png,image/jpeg,image/jpg,application/octet-stream, or have no content type. - Any other content type returns 400.
The blog says you can put images in state, instructions, or criteria. The curl below puts one image in state. That is the example I fetched, not a claim that the other two slots were exercised.
The curl
You need a TypeSafe API key in TYPESAFE_API_KEY, a JPEG named door-camera.jpg in the working directory, and curl. The model in the example is jev-latest, not a pinned jev-1.14.0. If you need the 1.14 box behavior, pin jev-1.14.0. The blog said jev-latest would move to 1.14.0 a week after October 14. This guide did not check whether that alias move has happened.
curl https://api.typesafe.ai/v1/systemone \
-H "Authorization: Bearer $TYPESAFE_API_KEY" \
-H "TypeSafe-Danger-Zone-Images: true" \
-F 'request={
"model": "jev-1.14.0",
"state": {"door": "a3f1c2e8-door"},
"assets": {"a3f1c2e8-door": {"type": "image", "part": "door-photo"}},
"questions": {
"person_present": {"type": "noul", "instructions": "Is there a person in `door`?"}
}
};type=application/json' \
-F 'door-photo=@door-camera.jpg;type=image/jpeg'
The docs' sample model string is jev-latest. The curl above pins jev-1.14.0 because that is the id the blog names for the box type, and because an unpinned alias is a moving target on the day the blog said the alias would move. Everything else in the body and headers is the docs' example: the asset id, the noul question, the part name door-photo, and the JPEG content type.
The question in that example is not a box question. It asks whether a person is present. A box question is a different type. The box docs page I opened did not return a request body, only a heading. Don't invent the box schema from the word "bounding box." Use the images header, pin 1.14.0, and read https://docs.typesafe.ai/go/box before you add "type": "box".
Don't confuse this header with long context
Long context is a different header: TypeSafe-Danger-Zone-Long-Context: true. The models page says it raises both the per-request and per-question limits to 262k tokens, on 1.14 and on 1.13. Default without it is 64k per request and 32k per question. It costs the same per token and the page says it is slower and less accurate.
An image request does not need the long-context header unless the state plus the question no longer fits. Sending both headers because they share a prefix is how you pay for a slower request you didn't need.
Input price on the models table is $0.042 per million tokens. Output tokens are free. An image still counts as input. The page I read did not print a separate image-token rate, so this guide doesn't invent one.
Sources
- Images, including the multipart curl: https://docs.typesafe.ai/go/images
- Release notes for the box type and the danger-zone framing: https://typesafe.ai/blog/jev-1-14
- Context limits and the text-input row: https://docs.typesafe.ai/models