Judge images (preview)
POST /v1/judge/visionAsk typed questions about up to 4 images (PNG or JPEG) and get answers your code can branch on: noul (yes/no probability), choice, score, and box (where something is, as edges from 0 to 1). Send POST /v1/judge/vision with the required fields images and questions and pay $0.003 per call over x402 or MPP (there is no free tier). It returns the result.
Name each image, then refer to it as `name` in a question. Preview: built on Jev features its maker labels experimental. Answers come from a model, not deterministic code.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
images | object | yes | Your own names mapped to { format: "png" | "jpeg", data_base64 }. Up to 4; each side 256 to 1568 px, 4 MiB each. Images are not resized. |
questions | object | yes | Your own ids mapped to { type: noul | choice | score | box, instructions, criteria }. Refer to an image as `name` in backticks. |
state | string | object | no | Optional text context, up to 8000 characters. |
model | string (one of: jev-latest, jev-preview) | no | jev-latest is the tested Jev version; a box question always runs on jev-preview. |
Example request
curl -i -X POST https://agent402.tools/v1/judge/vision \
-H "Content-Type: application/json" \
-d '{"images":{"picture":{"format":"png","data_base64":"iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAIAAAD2HxkiAAAC+0lEQVR42u3TwQkAMAgEQcux/3rsJfnl60eQwAxXwcHGAVaFC0CEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhYyrT3kSICEWICEUoQkQoQkQoQhEiQhEiQhGKEBGKEBGKUISIUISIUIQiRIQiRIQiFCEiFCEiFKEIEaEIEaEIRYgIRYgIRShCRChCRChCESJCESJCEYoQEYoQEYpQhIhQhIhQhCJEhCJEhCIUISIUISIUoQgRoQgRoQhFiAhFiAhFKEJEKEJEKEIRIkIRIkIRihARihARilCEiFCEiFCEIkSEIkSEIhQhIhQhIhQhiFCEiFCEIEIRIkIRgghFiAhFCCIUISIUIYhQhIhQhCBCESJCESJC7YkQEYoQEZoIEaEIEaGJEBGKEBGKUISIUISIUIQiRIQiRIQiFCEiFCEiFKEIEaEIEaEIRYgIRYgIRShCRChCRChCESJCESJCEYoQfiZCECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQaFwp5rW6Afb8QQAAAABJRU5ErkJggg=="}},"questions":{"has_red":{"type":"noul","instructions":"Does `picture` contain a red shape?"}}}'
Without payment this returns HTTP 402 Payment Required with the exact price for judge-vision; any x402 v2 or MPP client pays it and retries.
Example response
{}
From an MCP client
catalog.call {
"slug": "judge-vision",
"params": {
"images": {
"picture": {
"format": "png",
"data_base64": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAIAAAD2HxkiAAAC+0lEQVR42u3TwQkAMAgEQcux/3rsJfnl60eQwAxXwcHGAVaFC0CEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhYyrT3kSICEWICEUoQkQoQkQoQhEiQhEiQhGKEBGKEBGKUISIUISIUIQiRIQiRIQiFCEiFCEiFKEIEaEIEaEIRYgIRYgIRShCRChCRChCESJCESJCEYoQEYoQEYpQhIhQhIhQhCJEhCJEhCIUISIUISIUoQgRoQgRoQhFiAhFiAhFKEJEKEJEKEIRIkIRIkIRihARihARilCEiFCEiFCEIkSEIkSEIhQhIhQhIhQhiFCEiFCEIEIRIkIRgghFiAhFCCIUISIUIYhQhIhQhCBCESJCESJC7YkQEYoQEZoIEaEIEaGJEBGKEBGKUISIUISIUIQiRIQiRIQiFCEiFCEiFKEIEaEIEaEIRYgIRYgIRShCRChCRChCESJCESJCEYoQfiZCECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQaFwp5rW6Afb8QQAAAABJRU5ErkJggg=="
}
},
"questions": {
"has_red": {
"type": "noul",
"instructions": "Does `picture` contain a red shape?"
}
}
}
}
The hosted connector at https://agent402.tools/mcp needs a payment for judge-vision; the stdio package pays it from a wallet or from an AGENT402_CREDITS_KEY issued earlier. Local install: npx -y agent402-mcp.
Errors and behavior
imagesandquestionsare required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement is cancelled when the tool fails. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool runs a model, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - Model-backed: the answer is generated by a model, so the same input can produce a different result.
- A
GETorHEADto /v1/judge/vision returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB and a streamed response are not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.003" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/v1/judge/vision", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"images": {
"picture": {
"format": "png",
"data_base64": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAIAAAD2HxkiAAAC+0lEQVR42u3TwQkAMAgEQcux/3rsJfnl60eQwAxXwcHGAVaFC0CEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCQIQgQkCEIEJAhCBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQISBCECEgQhAhIEIQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhYyrT3kSICEWICEUoQkQoQkQoQhEiQhEiQhGKEBGKEBGKUISIUISIUIQiRIQiRIQiFCEiFCEiFKEIEaEIEaEIRYgIRYgIRShCRChCRChCESJCESJCEYoQEYoQEYpQhIhQhIhQhCJEhCJEhCIUISIUISIUoQgRoQgRoQhFiAhFiAhFKEJEKEJEKEIRIkIRIkIRihARihARilCEiFCEiFCEIkSEIkSEIhQhIhQhIhQhiFCEiFCEIEIRIkIRgghFiAhFCCIUISIUIYhQhIhQhCBCESJCESJC7YkQEYoQEZoIEaEIEaGJEBGKEBGKUISIUISIUIQiRIQiRIQiFCEiFCEiFKEIEaEIEaEIRYgIRYgIRShCRChCRChCESJCESJCEYoQfiZCECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQECGIEBAhiBAQIYgQaFwp5rW6Afb8QQAAAABJRU5ErkJggg=="
}
},
"questions": {
"has_red": {
"type": "noul",
"instructions": "Does `picture` contain a red shape?"
}
}
}),
});
Related tools
Locate in image (preview)
POST /v1/judge/locateFind up to 4 things in one image: each comes back with whether it is there (a probability) and its box, as edges from 0.
Judge long documents (preview)
POST /v1/judge/longThe typed questions of /v1/judge over a document of up to 900 KB (about 262k tokens), in one call.
Decisions (OpenAI wire)
POST /v1/decisionsOpenAI's Decisions API on its own wire: point an OpenAI SDK's base URL here and client.decisions.create works unchanged.
Typed judgment
POST /v1/judgeAsk a typed question about any content and get an answer your code can branch on, not prose to parse.
Image generation
POST /api/image-genGenerate an image from a text prompt using GPT Image 2 (low quality, 1024x1024).
Image generation (HD)
POST /api/image-gen-hdGenerate a higher-quality image from a text prompt using GPT Image 2 (medium quality, 1024x1024).