Skip to navigation

Ask for a judgment (hosted DecisionProvider)

The runtime-family judgment contract consumed by @runtypelabs/runtime’s HostedDecisionProvider, so a self-hosted runtime on platform or hybrid keys judges through Runtype with a Self-hosted Runtime key (RUNTIME:EXECUTE). Answers like builtin:decision_judge: with questionSetId the published question set supplies the questions (configured mode, and questions is refused); without it the call supplies questions (ad hoc mode). Billed and recorded like a decision tool call. Requires an Enterprise plan: ineligible accounts receive 403 (code BYOC_PLAN_REQUIRED).

Authentication

AuthorizationBearer
API key or Clerk session token

Request

This endpoint expects an object.
statestring or map from strings to any or list of anyRequired
The text, JSON object or JSON array to judge. Never echoed in errors or logs.
executionIdstringOptional>=1 character

The self-hosted execution asking, recorded on the judgment telemetry.

modelstringOptional>=1 character
Decision model id. In configured mode it outranks the question set version model.
questionSetIdstringOptional>=1 character

A question set owned by the caller; its published version supplies the questions.

questionsmap from strings to anyOptional

Ad hoc questions keyed by question id, each { type: "boolean" | "choice" | "score", instructions, criteria }. Refused with JUDGMENT_CONFIGURED_QUESTIONS_REJECTED when questionSetId is set.

versionintegerOptional>=1

Published question set version to use; omit for the current version. Without questionSetId the call is refused with 400 JUDGMENT_VERSION_WITHOUT_QUESTION_SET.

Response

The answers and the judgment metadata
answersmap from strings to any
One answer per question id, exactly as the decision model returned it.
judgmentobject

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error