Evaluate decision models (TypeSafe-compatible)
Beta API. Choose telnyx/decision-flash for the lowest cost and latency, or telnyx/decision-pro for decisions that require long context, including inputs beyond Jev’s 32k per-decision limit. Omitted model defaults to telnyx/decision-flash.
Evaluate shared context using named choice, noul (yes/no), and score questions. Returns TypeSafe System One-compatible answer shapes, the selected public model alias, and token usage. See the decision model guide for examples and compatibility limits.
The supported request subset requires instructions for every question, string descriptions for criteria (or null for choice descriptions), 1–64 questions, and 2–64 options for choice and score questions. The model field accepts only telnyx/decision-flash or telnyx/decision-pro. Unsupported model values and unknown fields are rejected. The endpoint is synchronous and does not stream.
Use the TypeSafe Python SDK with base_url set to https://api.telnyx.com/v2/ai/typesafe and a Telnyx API key. The SDK appends /v1/systemone; explicitly set model to a supported Telnyx alias because its own default model is not supported. Compatibility covers this operation and the documented request subset; it does not include TypeSafe model listing. Scores describe relative preference, not calibrated correctness.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.ai.typesafe.v1.systemone({
questions: {},
state: 'Our production calls are failing. Every customer is affected.',
});
console.log(response.model);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.ai.typesafe.v1.systemone(
questions={},
state="Our production calls are failing. Every customer is affected.",
)
print(response.model)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.AI.Typesafe.V1.Systemone(
context.TODO(),
telnyx.AITypesafeV1SystemoneParams{
Questions: "questions",
State: "Our production calls are failing. Every customer is affected.",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.typesafe.v1.V1SystemoneParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
V1SystemoneParams params = V1SystemoneParams.builder()
.questions(null)
.state("Our production calls are failing. Every customer is affected.")
.build();
var response = client.ai().typesafe().v1().systemone(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.ai.typesafe.v1.systemone(questions: {}, state: "Our production calls are failing. Every customer is affected.")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->ai->typesafe->v1->systemone(
questions: [],
state: 'Our production calls are failing. Every customer is affected.',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:typesafe:v1 systemone \
--api-key 'My API Key' \
--state 'Our production calls are failing. Every customer is affected.' \
--questions '{}'curl --request POST \
--url https://api.telnyx.com/v2/ai/typesafe/v1/systemone \
--header 'Authorization: Bearer <token>' \
--header '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"
]
}
}
}
'{
"model": "telnyx/decision-flash",
"answers": {
"team": {
"type": "choice",
"choice": "technical_support",
"probabilities": {
"billing": 0.0024719786572585446,
"technical_support": 0.9972674768333701,
"sales": 0.00026054450937119613
},
"confidence": 0.9820522416354122
},
"production_incident": {
"type": "noul",
"noul": 0.9991959141264766
},
"urgency": {
"type": "score",
"score": 2.9974242859177265,
"legend": {
"0": "Low",
"1": "Normal",
"2": "High",
"3": "Critical"
},
"probabilities": {
"0": 0.0003348349100603869,
"1": 0.00003529133987660637,
"2": 0.0015006266723396524,
"3": 0.9981292470777234
},
"confidence": 0.9894200002646713
}
},
"usage": {
"input_tokens": 267,
"output_tokens": 4
}
}{
"error": {
"message": "Authentication required."
}
}{
"error": {
"message": "Request body too large."
}
}{
"error": {
"message": "Question \"team\" requires instructions."
}
}{
"error": {
"message": "Too many requests."
}
}{
"error": {
"message": "Scoring service failed."
}
}{
"error": {
"message": "Decision model service unavailable."
}
}{
"error": {
"message": "Evaluation deadline exceeded."
}
}{
"error": {
"message": "Decision model service at capacity."
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Decision Models beta request. Choose a public model alias; omitted model defaults to telnyx/decision-flash. Telnyx manages the underlying models behind these aliases.
Shared context evaluated by every question.
"Our production calls are failing. Every customer is affected."
Between 1 and 64 named questions. Each key identifies the corresponding answer.
Show child attributes
Show child attributes
Public model alias. telnyx/decision-flash offers the lowest cost and latency; telnyx/decision-pro supports decisions that require long context, including inputs beyond Jev’s 32k per-decision limit. Applies to every question in the request. Other values are rejected.
telnyx/decision-flash, telnyx/decision-pro "telnyx/decision-flash"
Response
All questions evaluated successfully. The response is a complete JSON object, not a stream.
A complete synchronous evaluation. Answers are returned directly without a data wrapper.
Public model alias used to evaluate the request. Returns telnyx/decision-flash when model was omitted. The underlying model is managed by Telnyx.
telnyx/decision-flash, telnyx/decision-pro "telnyx/decision-flash"
Answers keyed by exactly the question IDs in the request. Each answer type matches its question.
Show child attributes
Show child attributes
Token usage for the completed evaluation.
Show child attributes
Show child attributes
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.ai.typesafe.v1.systemone({
questions: {},
state: 'Our production calls are failing. Every customer is affected.',
});
console.log(response.model);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.ai.typesafe.v1.systemone(
questions={},
state="Our production calls are failing. Every customer is affected.",
)
print(response.model)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.AI.Typesafe.V1.Systemone(
context.TODO(),
telnyx.AITypesafeV1SystemoneParams{
Questions: "questions",
State: "Our production calls are failing. Every customer is affected.",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.typesafe.v1.V1SystemoneParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
V1SystemoneParams params = V1SystemoneParams.builder()
.questions(null)
.state("Our production calls are failing. Every customer is affected.")
.build();
var response = client.ai().typesafe().v1().systemone(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.ai.typesafe.v1.systemone(questions: {}, state: "Our production calls are failing. Every customer is affected.")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->ai->typesafe->v1->systemone(
questions: [],
state: 'Our production calls are failing. Every customer is affected.',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:typesafe:v1 systemone \
--api-key 'My API Key' \
--state 'Our production calls are failing. Every customer is affected.' \
--questions '{}'curl --request POST \
--url https://api.telnyx.com/v2/ai/typesafe/v1/systemone \
--header 'Authorization: Bearer <token>' \
--header '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"
]
}
}
}
'{
"model": "telnyx/decision-flash",
"answers": {
"team": {
"type": "choice",
"choice": "technical_support",
"probabilities": {
"billing": 0.0024719786572585446,
"technical_support": 0.9972674768333701,
"sales": 0.00026054450937119613
},
"confidence": 0.9820522416354122
},
"production_incident": {
"type": "noul",
"noul": 0.9991959141264766
},
"urgency": {
"type": "score",
"score": 2.9974242859177265,
"legend": {
"0": "Low",
"1": "Normal",
"2": "High",
"3": "Critical"
},
"probabilities": {
"0": 0.0003348349100603869,
"1": 0.00003529133987660637,
"2": 0.0015006266723396524,
"3": 0.9981292470777234
},
"confidence": 0.9894200002646713
}
},
"usage": {
"input_tokens": 267,
"output_tokens": 4
}
}{
"error": {
"message": "Authentication required."
}
}{
"error": {
"message": "Request body too large."
}
}{
"error": {
"message": "Question \"team\" requires instructions."
}
}{
"error": {
"message": "Too many requests."
}
}{
"error": {
"message": "Scoring service failed."
}
}{
"error": {
"message": "Decision model service unavailable."
}
}{
"error": {
"message": "Evaluation deadline exceeded."
}
}{
"error": {
"message": "Decision model service at capacity."
}
}