TopxAI

Loading...

Blog

Jev 1.14 on TopxAI: images, Box questions and what they cost

· typesafe, jev, system-one, images, api, topxai

Jev 1.14 replaces 1.13 at the same price and can look at images. Our measurements of Box accuracy, image token counts and the real size limits.

TypeSafe released Jev 1.14 on October 14, and TopxAI serves jev-1.14.0 from today in place of jev-1.13.0. The price does not change: $0.04494 per million input tokens, 107% of TypeSafe's $0.042 list price, and output is still free. The new part is that Jev can look at pictures, and a fourth question type, Box, tells you where something is in one.

TypeSafe calls images and Box "Dreamer-ready": good enough for prototypes, not yet up to its own production standard, and liable to change between releases. Everything below was measured through TopxAI against the live API on October 16, so treat the numbers as a snapshot.

What changes for existing callers

Send jev-1.14.0. jev-latest and jev-preview still work and are answered by jev-1.14.0, so the response's model field reads jev-1.14.0 whichever name you sent. That differs from TypeSafe's own API, where jev-latest still pointed at 1.13 that day; TopxAI sends the catalogue ID upstream so a request is never answered by a version it does not sell. jev-1.13.0 is retired and now gets a 403. If you tuned thresholds on 1.13, run your test set again: the same noul came back 0.95 on 1.13 and 0.96 on 1.14 in our checks, close but not identical.

Sending an image

List each image once in a top-level assets map under a reference string, then write that string wherever the image belongs: in the state, in an instruction, or in a criterion. You do not need TypeSafe's TypeSafe-Danger-Zone-Images header on TopxAI; the relay adds it for any request with an image or a Box question.

{
  "model": "jev-1.14.0",
  "state": { "photo": "8d2f4c1e-shapes" },
  "assets": {
    "8d2f4c1e-shapes": { "type": "image", "format": "png", "data_base64": "iVBORw0KGgo..." }
  },
  "questions": {
    "red": { "type": "noul", "instructions": "Is there a red rectangle in `photo`?" },
    "where": { "type": "box", "instructions": "the red rectangle in `photo`" }
  }
}

The test picture was 800 × 600 pixels with a red rectangle from x 480 to 680 and y 150 to 400, and a blue circle from x 80 to 260 and y 300 to 480. As fractions of the image, the rectangle runs from 0.60 to 0.85 across and 0.25 to 0.67 down. Jev answered left 0.59, right 0.85, top 0.25, bottom 0.69 with a confidence between 0.5 and 0.6 over several runs. For the circle (0.10 to 0.33 across, 0.50 to 0.80 down) it answered left 0.10, right 0.33, top 0.48, bottom 0.82 with confidence 0.88. The noul about the red rectangle came back 0.94; the same question with no image in the state came back 0.03.

A Box answer is always a box. Ask "the giraffe in photo" of a kitchen photo and you still get four edges, which is why the example pairs it with a noul. Ignore the box when the noul is low.

The official SDKs work unchanged

TypeSafe's Python SDK 0.7.5 and JavaScript SDK 0.7.0 send images as multipart/form-data (the JSON body in a part named request, each image in its own part) and compress larger request bodies with zstd (the Python SDK shrank our 6 KB test body to 97 bytes). Both work against TYPESAFE_BASE_URL=https://ai.topxea.com; we ran a noul, a choice and a Box question on one image with each SDK, plus that compressed text request. The JavaScript SDK needs Node.js 22 or newer.

from pathlib import Path
from typesafe_sdk import Box, Image, Noul, TypeSafeClient

with TypeSafeClient() as client:  # reads TYPESAFE_BASE_URL and TYPESAFE_API_KEY
    result = client.system_one(
        state={"photo": Image(Path("shelf.jpg"))},
        questions={
            "has_mug": Noul(instructions="Is there a coffee mug in `photo`?"),
            "mug": Box(instructions="the coffee mug in `photo`"),
        },
    )
    print(result.model, result.answers, result.usage)

What an image costs

Images have no separate price: their tokens are input tokens, included in usage.input_tokens. TypeSafe has not published how it counts them, so we sent the same question with images of different sizes and subtracted a text-only baseline:

Image (pixels) Measured tokens ceil(w/28) × ceil(h/28) × 2 Cost at $0.04494 per 1M
512 × 512 723 722 $0.000032
1000 × 300 791 792 $0.000036
300 × 1200 944 946 $0.000043
1024 × 768 2,074 2,072 $0.000093
1568 × 600 2,464 2,464 $0.000111
1568 × 1568 6,272 6,272 $0.000282

The formula matches to within two tokens; the small gaps come from the reference string, whose own tokens are swapped out for the picture. Each place a reference appears adds the image again, so an image named in three questions' instructions costs three times. Put a shared image in the state once and point at it by path. Image tokens also count against the context limits: 64k tokens per request, and 32k for the state plus any one question, so a state holds about five full-size images at most.

The size limit is 280 pixels, not 256

TypeSafe's docs allow 256 to 1568 pixels per side. In practice, any side under 280 pixels was refused with "Invalid image dimensions": 279 × 400 and 400 × 279 failed, 280 × 400 and 1568 × 280 passed, and so did 280 × 280. 1600 × 1200 failed at the top end as documented. The API never resizes for you, and one bad image fails the whole request with a 400, which TopxAI passes through with TypeSafe's message and does not charge. Scale the longest side down to 1568, keep the shortest at 280 or more, and rotate the pixels upright first, because the API drops EXIF orientation.

Where it fits

Box is useful when code needs a crop or a position and a person would otherwise draw the rectangle: the signature field on a scanned form, the product in a listing photo, the person at a door camera. The cheap pattern is a noul to check the target is there, a Box to find it, and a crop sent back with a second question when the answer needs detail. For anything that has to be right every time, keep a person or a stronger vision model behind the low-confidence cases; TypeSafe has not suggested a Box confidence threshold yet, and ours came from synthetic shapes, not your images.

The Jev documentation has the request format, multipart rules and error codes in one place.

Models: jev-1.14.0 · Models & pricing

Related

Other languages: 简体中文