Great Work Labs
Models / Vision

Prism

Image tagging and image embeddings
prism-1

Tag images with any labels, or embed them for search.

Price$0.10 per 1,000 images
Speed (our servers)212 to 268 ms
LanguagesLabels and text queries in English
InputImage, up to 10 MB
Built onopenai/clip-vit-base-patch32 (MIT)

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"
  ]
}'

Set 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.

NameTypeDefaultWhat it does
labelsstring[]2 to 50 labels to score. Plain nouns work best ("a dog", "a cat").
templatestring"a photo of {label}"Sentence each label is placed in.
embedbooleanfalseReturn the image's 512-number embedding.
textsstring[]Text queries to embed into the same space (for image search), up to 100.

Output

FieldTypeMeaning
labelstringBest label (when labels is sent).
scorenumberIts probability among your labels.
labelsobject[]Every label with score and raw similarity.
embeddingnumber[]512 floats, normalized (with embed: true).
text_embeddingsnumber[][]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.