Developer API

ZeroTrain API – Structural Contract

This section defines the exact structure of ZeroTrain requests and responses. The API contract is deterministic and explicit.

→ Request Structure

A ZeroTrain request is composed of:

HTTP Header

  • APIKey – Required authentication key

JSON Payload

  • ModelSource – Required tabular rule definition data
  • InputSource – Required observed runtime state
  • Options – Execution settings (100% optional)

Required Components (JSON Payload)

ModelSource

  • Must contain tabular data (JSON resultsets, CSV, or supported format)
  • Each row represents a decision candidate
  • Must include an Action column (name configurable)

The Action column defines the deterministic outcome returned when a row is selected.

InputSource

  • Contains observed runtime values
  • Keys correspond to columns in ModelSource
  • Values may be string, number, boolean, or null

The engine compares InputSource values against each row in the ModelSource and selects the best structural match.

Options

  • Options.DataSettings
  • Options.ContextOptions
  • Options.OutputSettings
  • Weight columns
  • Priority columns
  • DecisionId columns
  • Row filters

If Options are not supplied, default deterministic behavior is applied.

← Response Structure

Every request produces a structured response containing:

  • header – Execution metadata
  • results – Selected deterministic outcome(s)
  • errors – Execution failures (if any)
  • warnings – Non-fatal notices (if any)

The response fully describes what was evaluated and the outcome selected.

Identical ModelSource and InputSource payloads will always produce identical results.