TELNYX DECISION MODELS (BETA)

Decision Models for AI agents

Send shared context and up to 64 typed questions in one request. Get back a choice, a yes/no score, or a rating for each one, and branch in code on the answer. Works with the TypeSafe SDK.

Decision Models API request with choice, noul, and score questions and the typed JSON answers

$0.035per 1M input tokens on Flash

$0for output tokens on Flash and Pro

64typed questions per request

USE CASES

Built for the decisions agents make on every run.

WHERE DECISION MODELS FIT

Keep your LLM for work that produces text. Send the bounded judgment calls to a decision model and branch in code on a typed answer.

Keep on your LLM

Open-ended work

  • Writing replies, summaries, and reports
  • Tool calls with open-ended parameters
  • Multi-step reasoning and planning
  • Choices you can't list in advance

Send to Decision Models

Bounded decisions

  • Routing to a known team, queue, or agent
  • Yes/no gates such as refund or incident checks
  • Urgency and quality ratings on a fixed scale
  • Intent classification across up to 64 options
QUESTION TYPES

Three question types, one shared state.

Every question needs a type and instructions. State and instructions accept strings, JSON objects, or arrays. Inputs are text only.

  • state: one shared context

    Send the transcript, the message, or the incident report once. Every question in the request evaluates against the same state.

  • choice: pick from options

    Route a ticket, classify intent, select a category. 2 to 64 options, with probabilities on every option and a confidence score on the answer.

  • noul: answer yes or no

    Is this a refund request? Is this an active production incident? Returns a 0 to 1 score for the positive outcome. Ask separate noul questions when several conditions can be true at once.

  • score: rate on a scale

    Rate urgency on an ordered rubric of 2 to 64 levels. The score is the expected zero-based index, fractional values included, with a legend and per-level probabilities.

HOW IT WORKS

One request. Typed answers back.

Pick a model, send shared state and named questions, and read typed answers from the response. Existing TypeSafe SDK code needs the Telnyx base URL and a Telnyx model alias.

Try it with cURL

curl --fail-with-body --max-time 100 \
  'https://api.telnyx.com/v2/ai/typesafe/v1/systemone' \
  -H "Authorization: Bearer ${TELNYX_API_KEY}" \
  -H 'Content-Type: application/json' \
  --data '{
    "model": "telnyx/decision-flash",
    "state": "Our production calls are failing. Every customer is affected.",
    "questions": {
      "team": {
        "type": "choice",
        "instructions": "Choose the team that should handle this incident.",
        "criteria": {
          "billing": "Payments and refunds",
          "technical_support": "Service faults and technical problems",
          "sales": "New purchases"
        }
      },
      "production_incident": {
        "type": "noul",
        "instructions": "Does the message describe an active production incident?"
      },
      "urgency": {
        "type": "score",
        "instructions": "Rate operational urgency.",
        "criteria": ["Low", "Normal", "High", "Critical"]
      }
    }
  }'

Port an existing TypeSafe integration

import os
from typesafe_sdk import Choice, Noul, Score, TypeSafeClient

with TypeSafeClient(
    api_key=os.environ["TELNYX_API_KEY"],
    base_url="https://api.telnyx.com/v2/ai/typesafe",
    timeout=100,
) as client:
    result = client.system_one(
        model="telnyx/decision-flash",
        state="Our production calls are failing. Every customer is affected.",
        questions={
            "team": Choice(
                instructions="Choose the team that should handle this incident.",
                criteria={
                    "billing": "Payments and refunds",
                    "technical_support": "Service faults and technical problems",
                    "sales": "New purchases",
                },
            ),
            "production_incident": Noul(
                instructions="Does the message describe an active production incident?",
            ),
            "urgency": Score(
                instructions="Rate operational urgency.",
                criteria=["Low", "Normal", "High", "Critical"],
            ),
        },
    )
    print(result.choices["team"].choice)
    print(result.nouls["production_incident"].noul)
    print(result.scores["urgency"].score)
PRICING

Two models, priced per input token.

Set model to telnyx/decision-flash or telnyx/decision-pro on each request. Requests without a model use Flash. Beta pricing can change.

  • Flash: $0.035 per 1M input tokens

    The default model. Lowest cost and latency for high-volume routing, triage, and intent classification. Output tokens are free, and cached input is billed at the same rate.

  • Pro: $0.20 per 1M input tokens

    For decisions that need long context. Keep a full support history, a policy and its amendments, or a long transcript in one request, past Jev's 32k-token per-decision limit. Output tokens are free.

PRODUCTS

One API key. Every primitive your agent needs.

Get a Telnyx API key and send your first decision.

Sign up, grab your key, and run the cURL example above. Decision Models is in beta.

FAQ

A decision model answers typed questions about a piece of context instead of generating text. Telnyx Decision Models evaluates shared state against choice, noul, and score questions and returns every answer in one JSON response, with probabilities for each option.