Prism scores an image against labels you choose ("invoice", "receipt", "selfie", "screenshot") with no training. It can also return an image embedding, and embed text queries into the same space, so "red sneakers on a beach" finds the right photo.
It's a good first filter in an upload flow: is this a document, a product photo, a meme or a person?
Use it
curl https://labs.greatwork.company/v1/run \
-H "Authorization: Bearer $GWL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "prism-1",
"input": "https://labs.greatwork.company/examples/receipt.png",
"labels": [
"a receipt",
"a selfie",
"a screenshot",
"a landscape photo",
"a pet"
]
}'const res = await fetch("https://labs.greatwork.company/v1/run", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.GWL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "prism-1",
"input": "https://labs.greatwork.company/examples/receipt.png",
"labels": [
"a receipt",
"a selfie",
"a screenshot",
"a landscape photo",
"a pet"
]
}),
});
const { output, usage } = await res.json();import os, requests
res = requests.post(
"https://labs.greatwork.company/v1/run",
headers={"Authorization": f"Bearer {os.environ['GWL_API_KEY']}"},
json={
"model": "prism-1",
"input": "https://labs.greatwork.company/examples/receipt.png",
"labels": [
"a receipt",
"a selfie",
"a screenshot",
"a landscape photo",
"a pet"
]
},
)
output = res.json()["output"]# Send a local file instead of a URL
curl https://labs.greatwork.company/v1/run \
-H "Authorization: Bearer $GWL_API_KEY" \
-F model=prism-1 \
-F input=@photo.jpgSet GWL_API_KEY to a key from your dashboard. The bare name prism works too and follows new versions.
Options
input: An image: an https URL, a data URL (`data:image/png;base64,...`), or a file in a multipart upload. JPEG, PNG, WebP, GIF, AVIF or TIFF, up to 10 MB.
| Name | Type | Default | What it does |
|---|---|---|---|
labels | string[] | 2 to 50 labels to score. Plain nouns work best ("a dog", "a cat"). | |
template | string | "a photo of {label}" | Sentence each label is placed in. |
embed | boolean | false | Return the image's 512-number embedding. |
texts | string[] | Text queries to embed into the same space (for image search), up to 100. |
Output
| Field | Type | Meaning |
|---|---|---|
label | string | Best label (when labels is sent). |
score | number | Its probability among your labels. |
labels | object[] | Every label with score and raw similarity. |
embedding | number[] | 512 floats, normalized (with embed: true). |
text_embeddings | number[][] | One vector per entry in texts. |
Every response wraps this in {"id", "model", "output", "usage": {"units", "unit", "cost_usd"}, "latency_ms"}.
Examples
Upload type
{
"model": "prism-1",
"input": "/examples/receipt.png",
"labels": [
"a receipt",
"a selfie",
"a screenshot",
"a landscape photo",
"a pet"
]
}{
"label": "a receipt",
"score": 0.8389,
"labels": [
{
"label": "a receipt",
"score": 0.8389,
"similarity": 0.2391
},
{
"label": "a screenshot",
"score": 0.129,
"similarity": 0.2203
},
{
"label": "a pet",
"score": 0.0256,
"similarity": 0.2042
},
{
"label": "a landscape photo",
"score": 0.0037,
"similarity": 0.1848
},
{
"label": "a selfie",
"score": 0.0029,
"similarity": 0.1822
}
],
"width": 560,
"height": 760
}Captured on our production servers: 268 ms, 1 image, $0.0001.
Scene
{
"model": "prism-1",
"input": "/examples/street.jpg",
"labels": [
"a city street",
"a beach",
"a forest",
"an office"
]
}{
"label": "a city street",
"score": 0.9765,
"labels": [
{
"label": "a city street",
"score": 0.9765,
"similarity": 0.2746
},
{
"label": "an office",
"score": 0.0138,
"similarity": 0.2321
},
{
"label": "a forest",
"score": 0.0053,
"similarity": 0.2224
},
{
"label": "a beach",
"score": 0.0043,
"similarity": 0.2205
}
],
"width": 1024,
"height": 1024
}Captured on our production servers: 212 ms, 1 image, $0.0001.
Good for
- Sort uploads into documents, photos and screenshots
- Text-to-image search over a photo library
- Find near-duplicate images
- Tag product photos by style
Limits and caveats
- Scores are relative to the labels you send: always include a catch-all like "something else".
- Not reliable for counting or reading text in images (use Scout and Ink).
Pricing
$0.10 per 1,000 images. One unit per image; every 10 `texts` add one unit. Failed calls aren't charged, and a call never costs more than its estimate (POST /v1/estimate tells you before you run it).
Built on
openai/clip-vit-base-patch32, 151M parameters. License: MIT. We run it on our servers.