Decision Models is in beta. Choose between Flash and Pro using the
model field.POST https://api.telnyx.com/v2/ai/typesafe/v1/systemone evaluates shared context against
named questions and returns structured answers. Use choice to select a
category, noul to evaluate a yes/no condition, and score to rate an ordered
rubric. A request can combine all three question types.
The endpoint supports a subset of the
TypeSafe System One API
request format and preserves its typed answer shapes. It returns one complete
JSON response. See the API reference
for the full request and response schemas.
Choose a model
Set
model once per request; every question uses that model. If omitted, it
defaults to telnyx/decision-flash. Other model values are rejected. Telnyx
manages the underlying models behind these public aliases.
Compare both aliases using the same state and questions on representative
examples. Measure answer quality and response time for the application;
confidence scores alone do not establish which model is more accurate.
Use Pro for decisions over long context
Choosetelnyx/decision-pro when the decision depends on more context than Jev
can accept in one question. Examples include routing a case using its complete
support history, checking an exception against a policy and its amendments, or
rating an incident from a long transcript and operational records.
Jev 1.13 documents a 32k-token limit for state plus the longest question,
with a separate 64k limit for state plus all questions. Pro’s larger context
capacity lets an application keep relevant evidence together when a decision
would otherwise require splitting or summarizing the input to fit Jev.
Include the question, criteria, and formatting when sizing requests. More context
does not guarantee a more accurate answer: keep the evidence relevant and test
against labeled examples from the application. Use Flash when cost and latency
matter most and the decision fits its supported context.
Classify a support incident
SetTELNYX_API_KEY to a Telnyx API key. Send the incident as state, then
use named questions to select the team, identify a production incident, and
rate urgency in one request.
model, answers, and usage directly, with no data
wrapper. The model value identifies the public alias used for the request.
Each key in answers matches a key in
questions. The following example rounds values for readability; results and token counts can vary.
answers.team.choice to choose a destination. Interpret
answers.production_incident.noul as a numeric yes-score, and
answers.urgency.score on the requested 0–3 rubric. Token usage includes
shared-context preparation and question evaluation, so it can exceed the
size of the unique input text.
Choose question types
Every question requirestype and instructions. Instructions and state
can be strings, JSON objects, or arrays. Text-only conversation histories
are supported; image and audio inputs are not supported.
A
choice question selects one option. Use separate noul questions when
several independent conditions can be true at once. For example, a support
message can both request a refund and report a service fault.
A score answer can be fractional. For criteria ["Low", "Normal", "High", "Critical"], the range is 0–3. Compute the expected score as
sum(index * probability); do not treat it as a 0–1 probability or an array
index without an application-specific decision rule.
Use scores in application logic
Option scores are normalized relative preferences across the supplied choices. Changing the choices or their wording can change the distribution. They are not calibrated probabilities that a decision is correct. Forchoice and score, confidence is normalized entropy:
1 - H(p) / ln(N), where H(p) = -sum(p * ln(p)) and N is the number of
options. It approaches 0 for a uniform distribution and 1 when the score is
concentrated on one option. It is different from the winning option’s
probability.
Choose review thresholds using representative examples from the application.
The following Python example uses direct HTTP, selects a team, and falls back
to manual review when the winning option has a low relative score. The 0.8
threshold is illustrative and must be evaluated for the application’s data.
Migrate a TypeSafe request
Point HTTP requests tohttps://api.telnyx.com/v2/ai/typesafe/v1/systemone and authenticate
with a Telnyx Bearer API key. Set model to a supported Telnyx alias and send
state and questions, keeping the question IDs used by the application.
Compatibility applies to the supported JSON request subset and typed answer
shapes. It does not imply identical model predictions, confidence calibration,
pricing, or token accounting.
The official TypeSafe Python SDK
appends
/v1/systemone to the configured base URL. The route preserves that
behavior. Its client.models.list() method uses a separate TypeSafe route and
is outside this endpoint’s compatibility scope. The SDK automatically sends a
model value, so changing only the base URL is not sufficient: replace its
default or existing model with a supported Telnyx alias.
Use the TypeSafe Python SDK
Install the official SDK:system_one()
calls using the supported question subset keep the same method and answer
accessors. This example uses the SDK’s Choice, Noul, and Score types.
api_key. Use a Telnyx key
for Telnyx requests. Keep /v1/systemone out of base_url; the SDK adds it.
Limits and failures
Use up to 64 named questions against one sharedstate. Split larger workloads
into separate requests and bound client concurrency. Responses arrive after
the complete evaluation; there is no streaming or per-question partial-success
envelope. Request-body and token limits also apply, so question count alone
does not guarantee that a request fits.
The public request fields are model, state, and questions. model is
optional and defaults to telnyx/decision-flash; state and questions are
required. Unsupported model values and unknown fields are rejected.
Do not send input, labels, tier, stream,
temperature, or max_tokens to this endpoint.
Check the HTTP status before parsing an answer. Honor
Retry-After when
present. Correct validation failures before retrying; retries repeat evaluation
work. A decision model service error uses this shape, with a message describing
the failure: