Judge long documents (preview)

$0.02 per callUSDC via x402POST /v1/judge/long

The typed questions of /v1/judge over a document of up to 900 KB (about 262k tokens), in one call. Send POST /v1/judge/long with the required fields state and questions and pay $0.02 per call over x402 or MPP (there is no free tier). It returns the result.

Preview: built on Jev features its maker labels experimental. Answers come from a model, not deterministic code.

Category: AI & computeTags: ai judgment long-context document classify preview

Try in playground →

Parameters

NameTypeRequiredDescription
statestring | objectyesThe document, up to 900000 bytes.
questionsobjectyesYour own ids mapped to { type: noul | choice | score, instructions, criteria }, as on /v1/judge.
modelstring (one of: jev-latest, jev-preview)no

Example request

curl -i -X POST https://agent402.tools/v1/judge/long \
  -H "Content-Type: application/json" \
  -d '{"state":"Section 1. The tenant pays rent on the first of each month. Section 2. Either party may end this lease with 60 days written notice.","questions":{"has_notice":{"type":"noul","instructions":"Does the document set a notice period for ending the agreement?"}}}'

Without payment this returns HTTP 402 Payment Required with the exact price for judge-long; any x402 v2 or MPP client pays it and retries.

Example response

{}

From an MCP client

catalog.call {
  "slug": "judge-long",
  "params": {
    "state": "Section 1. The tenant pays rent on the first of each month. Section 2. Either party may end this lease with 60 days written notice.",
    "questions": {
      "has_notice": {
        "type": "noul",
        "instructions": "Does the document set a notice period for ending the agreement?"
      }
    }
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for judge-long; 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

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.02" }); // 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/long", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "state": "Section 1. The tenant pays rent on the first of each month. Section 2. Either party may end this lease with 60 days written notice.",
    "questions": {
      "has_notice": {
        "type": "noul",
        "instructions": "Does the document set a notice period for ending the agreement?"
      }
    }
  }),
});

Related tools

Judge images (preview)

$0.003 · POST /v1/judge/vision

Ask typed questions about up to 4 images (PNG or JPEG) and get answers your code can branch on: noul (yes/no.

Decisions (OpenAI wire)

$0.001 · POST /v1/decisions

OpenAI's Decisions API on its own wire: point an OpenAI SDK's base URL here and client.decisions.create works unchanged.

Typed judgment

$0.001 · POST /v1/judge

Ask a typed question about any content and get an answer your code can branch on, not prose to parse.

Locate in image (preview)

$0.002 · POST /v1/judge/locate

Find up to 4 things in one image: each comes back with whether it is there (a probability) and its box, as edges from 0.

Image generation

$0.03 · POST /api/image-gen

Generate an image from a text prompt using GPT Image 2 (low quality, 1024x1024).

Image generation (HD)

$0.10 · POST /api/image-gen-hd

Generate a higher-quality image from a text prompt using GPT Image 2 (medium quality, 1024x1024).