---
title: "Create typed decisions with a decision model"
method: POST
path: "/v1/decisions"
tags: ["Decisions"]
---

# Create typed decisions with a decision model

`POST /v1/decisions`

## Request

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

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.

## Request body

- DecisionsRequest
  - `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.
  - `state` union, required: Application state to evaluate. PPLX Decider v1.2, Clef and Clef Flash also accept an array that mixes plain strings with up to four image_url parts holding static PNG, JPEG or WebP base64 data URLs, each at most 512x512 pixels (240,000 base64 characters in total). Remote image URLs are not fetched.
    - string
    - object
    - unknown[]
      - unknown
  - `questions` object, required
  - `provider` object, 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_id` string
  - `trace` object
  - `user` string
  - `include_usage` boolean: 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 `200`

Typed decisions response

- DecisionsResponse
  - `id` string
  - `model` string, required
  - `answers` object, required
  - `usage` object, required
    - `input_tokens` integer, required
    - `output_tokens` integer, required
    - `cost` number: Exact charge in USD. Returned when the request sets include_usage to true.
    - `estimated_cost` number: Estimated charge in USD at the model's published input price for the reported input tokens, before account discounts and payment-currency conversion. Returned when include_usage is not set; billing settles right after the response.

## Other responses

- `400`: Invalid state, questions, model, or unsupported parameter
- `401`: Missing or invalid API key
- `429`: Rate limit exceeded

## Changes

- **2026-11-03** `cc8b07d75689`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/nano-gpt/apis/nanogpt-api/changes/v1/decisions/post.md)

---

[API](https://skmtc.dev/nano-gpt/apis/nanogpt-api.md) - [All operations](https://skmtc.dev/nano-gpt/apis/nanogpt-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nano-gpt/apis/nanogpt-api/revisions/cc8b07d75689?raw)
