Decisions

Create typed decisions with a decision model

Changed on

Evaluates application state with one or more typed Choice, Score, or Noul (yes/no) questions. Decision models return typed answers with calibrated probabilities instead of generated text, and only input tokens are billed. Supported models: TypeSafe Jev (typesafe/jev-1.13, typesafe/jev-latest), Liquid AI's D1 (liquid/d1), Perplexity's PPLX Decider v1.2 (perplexity/pplx-decider-v1.2), and Cloudflare's Clef (cloudflare/clef) and Clef Flash (cloudflare/clef-flash). PPLX Decider v1.2 accepts only the zdr and data_collection routing controls in provider. Clef and Clef Flash support NanoGPT provider selection and reject zdr true. PPLX Decider v1.2, Clef and Clef Flash also accept up to four inline images in the state array; Clef and Clef Flash limit text input to 1,800 tokens. By default the response returns before billing settles and reports usage.estimated_cost; set include_usage to true for the exact usage.cost. Check GET /api/v1/decision-models on your chosen host for model availability, supported_endpoints and decision_input capabilities. The retired perplexity/pplx-decider-v1.1-27b ID remains accepted as an alias for v1.2; the native Decisions response model field identifies the version that answered.

post/v1/decisions

Request

  • Base URL
    https://api.nano-gpt.com/api
  • URL
    https://api.nano-gpt.com/api/v1/decisions
  • Auth
    • HTTP bearer
    • or API key in header x-api-key

Request body

model'typesafe/jev-1.13' | '~typesafe/jev-latest' | 'typesafe/jev-latest' | 'liquid/d1' | 'cloudflare/clef' | 'clef' | 'cloudflare/clef-flash' | 'perplexity/pplx-decider-v1.2' | 'perplexity/pplx-decider-v1.1-27b' required

Decision model ID. clef is an alias of the prefixed IDs. Use perplexity/pplx-decider-v1.2 for PPLX; perplexity/pplx-decider-v1.1-27b remains accepted as a compatibility alias for v1.2.

questionsobject required
providerobject nullable

Optional model-specific routing controls. Jev 1.13, Jev Latest and Liquid D1 use native Decisions endpoint names. PPLX Decider v1.2 accepts only zdr and data_collection. Clef and Clef Flash support NanoGPT provider selection and reject zdr true.

session_idstring
traceobject
userstring
include_usageboolean

Wait for billing to settle and report the exact charge as usage.cost. By default the response returns without waiting and reports usage.estimated_cost.

Response

Typed decisions response

idstring
modelstring required
answersobject required

Changes