POST https://api.krotex.sh/v1/reason

# Call KROTEX

Unlimited Krotex on Solana. Sign in, copy a key, send state plus questions. Question types, state, and confidence live in Advanced.

SVM execution

High-speed Solana-native settlement.

Micropayments

Stream Solana Pay payments in lamports.

Verification

Anchor deterministic token-level inference receipts on Solana.

01 / Request

## Endpoint

POSThttps://api.krotex.sh/v1/reason
Header
Authorization: Bearer <key>
02 / Input contract

## Body

statestring · object · array

The only world the model sees.

questionsmap of id → question

Choice, Score, or Noul. Mix types freely. Every question sees the same state and runs in parallel.

modelkrotex

The default model.

Interactive example

Pick a preset, then a client.

curl https://api.krotex.sh/v1/reason \
  -H "Authorization: Bearer $KROTEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "krotex",
  "state": {
    "ticket": {
      "subject": "Production export failed",
      "messages": [
        {
          "text": "Payroll closes today. The export failed twice."
        }
      ]
    }
  },
  "questions": {
    "urgent": {
      "noul": "Does this need immediate attention?"
    },
    "team": {
      "choice": [
        "billing",
        "platform",
        "success"
      ],
      "criteria": "Best owner"
    },
    "frustration": {
      "score": [
        "calm",
        "concerned",
        "angry"
      ],
      "criteria": "Customer frustration"
    }
  }
}'
03 / Output contract

## Response

One answer per question, under the same ids. Choice and Score also return confidence.

200 OK / application/json
{
  "answers": {
    "urgent": { "noul": 0.92 },
    "team": {
      "choice": "platform",
      "probabilities": { "billing": 0.03, "platform": 0.94, "success": 0.03 },
      "confidence": 0.94
    },
    "frustration": {
      "score": 2,
      "legend": "angry",
      "probabilities": { "calm": 0.01, "concerned": 0.11, "angry": 0.88 },
      "confidence": 0.88
    }
  },
  "usage": { "input_tokens": 34, "output_tokens": 18, "total_tokens": 52 }
}

Noul

A yes/no judgment on a 0 to 1 scale. Probability is the signal.

Schema
"urgent": {
  "noul": "Does this need action now?"
}
Response
"urgent": { "noul": 0.92 }

Choice

A set of options plus criteria. Returns choice, probabilities, and confidence.

Schema
"team": {
  "choice": ["billing", "platform"],
  "criteria": "Best owner"
}
Response
"team": {
  "choice": "platform",
  "probabilities": { "billing": 0.04, "platform": 0.96 },
  "confidence": 0.96
}

Score

Ordered levels. Returns score, legend, probabilities, and confidence.

Schema
"risk": {
  "score": ["low", "medium", "high"],
  "criteria": "Operational risk"
}
Response
"risk": {
  "score": 2, "legend": "high",
  "probabilities": { "low": 0.01, "medium": 0.08, "high": 0.91 },
  "confidence": 0.91
}
Advanced / Shared context

## State

State may be a string, object, or array. It is the complete world visible to every question. Nested values support dotted path evaluation such as ticket.messages[0].text.

STRING
"Customer cannot export."
OBJECT
{ "ticket": { "priority": "high" } }
ARRAY
[{ "role": "user", "text": "Help" }]
Advanced / Decision policy

## Confidence

HIGH≥ 0.80

Act automatically

MEDIUM0.50–0.79

Confirm or flag

LOW< 0.50

Route to a human

Practical policy / TypeScript
const action = result.answers.action;

if (action.confidence < 0.5) {
  routeToHuman(state);
} else {
  execute(action.choice);
}
Advanced / Failure modes

## Errors

401Missing or invalid key
422Bad body or unknown model
503Temporarily unavailable