Skip to main content
StrikeStrike

STRIKE / BLOG

Images, a box, and the request window

Send a PNG or JPEG on strike-1 and ask a question, including one bounding box.

strike-1 answers yes/no, choice, and score questions. It also answers questions about a PNG or JPEG, including one box on the picture. Same model. No extra header.

The request shape is in the Images docs.

Only yes/no probabilities are calibrated during beta; box and choice probabilities are not. A box answer is a location on the image, not a promise you should automate on.

The window

A request is limited to 8,192 estimated tokens. That is about 32,000 characters of state plus the question text. An image counts as 256 tokens. Past that the API returns 400 with max_tokens_exceeded.

Text-only calls use the same window.

Images

Send each picture once, under assets, and mention that reference in state, instructions, or criteria. PNG or JPEG, still images only. Each side must be between 280 and 1024 pixels. At most four images, and 4 MiB each. Strike does not resize a file that is outside those limits. It rejects it.

{
  "model": "strike-1",
  "state": { "photo": "6e1d0b7c-door" },
  "assets": {
    "6e1d0b7c-door": { "type": "image", "format": "jpg", "data_base64": "..." }
  },
  "questions": {
    "person": {
      "type": "noul",
      "instructions": "Is there a person in `photo`?"
    }
  }
}

A file that is not a still PNG or JPEG returns invalid_image.

You can also post multipart: a request part with the JSON, and a file part named by assets.*.part.

import json
import os

import httpx

request = {
    "model": "strike-1",
    "state": {"door": "door"},
    "assets": {"door": {"type": "image", "format": "jpg", "part": "door"}},
    "questions": {
        "person": {"type": "noul", "instructions": "Is there a person in `door`?"},
        "where": {"type": "box", "instructions": "the person in `door`"},
    },
}
with open("door.jpg", "rb") as image:
    response = httpx.post(
        "https://strike-ai.eu/v1/systemone",
        headers={"Authorization": f"Bearer {os.environ['STRIKE_API_KEY']}"},
        data={"request": json.dumps(request)},
        files={"door": ("door.jpg", image, "image/jpeg")},
        timeout=60.0,
    )
response.raise_for_status()
print(response.json())

Use httpx for the file upload. strike-ai does not upload images.

One box

A box question returns one rectangle. The edges are fractions of the image width and height, measured from the top-left. left is less than right, and top is less than bottom.

"where": { "type": "box", "instructions": "the person in `photo`" }
{
  "type": "box",
  "box": { "top": 0.25, "bottom": 0.82, "left": 0.44, "right": 0.84 },
  "confidence": 0.92
}

There is no "not found". The answer is always a box, including when the thing you named is absent. If absence matters, ask a yes/no question in the same request and ignore the box when that probability is low. The example above does both: person says whether anyone is there, and where says which region the model picked.

Strike does not emit four free numbers. It splits the current crop into a 4 by 4 grid of tiles, picks one tile, and repeats that three times. confidence is the product of those three picks. Small targets get missed. Crop the image first if the object is only a few dozen pixels wide.

Try it

The playground has an Image question type. Pick it, attach a file, and write the question.

See also

← All posts · Home

Strike AI | Images, a box, and the request window