Create decision
curl --request POST \
--url https://ai.{environment}.corti.app/typesafe/v1/systemone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "mammoth-1",
"state": "58-year-old with chest pain on exertion for two weeks, relieved by rest. No pain at rest.",
"questions": {
"department": {
"type": "choice",
"instructions": "Which department should see this patient?",
"criteria": {
"cardiology": "heart and circulation",
"dermatology": "skin",
"orthopedics": "bones and joints"
}
},
"urgent": {
"type": "noul",
"instructions": "Does the patient need to be seen today?",
"criteria": {
"true": "symptoms could be life-threatening"
}
},
"severity": {
"type": "score",
"instructions": "How severe are the symptoms?",
"criteria": [
"mild",
"moderate",
"severe"
]
}
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'mammoth-1',
state: '58-year-old with chest pain on exertion for two weeks, relieved by rest. No pain at rest.',
questions: {
department: {
type: 'choice',
instructions: 'Which department should see this patient?',
criteria: {
cardiology: 'heart and circulation',
dermatology: 'skin',
orthopedics: 'bones and joints'
}
},
urgent: {
type: 'noul',
instructions: 'Does the patient need to be seen today?',
criteria: {true: 'symptoms could be life-threatening'}
},
severity: {
type: 'score',
instructions: 'How severe are the symptoms?',
criteria: ['mild', 'moderate', 'severe']
}
}
})
};
fetch('https://ai.{environment}.corti.app/typesafe/v1/systemone', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));using RestSharp;
var options = new RestClientOptions("https://ai.{environment}.corti.app/typesafe/v1/systemone");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"model\": \"mammoth-1\",\n \"state\": \"58-year-old with chest pain on exertion for two weeks, relieved by rest. No pain at rest.\",\n \"questions\": {\n \"department\": {\n \"type\": \"choice\",\n \"instructions\": \"Which department should see this patient?\",\n \"criteria\": {\n \"cardiology\": \"heart and circulation\",\n \"dermatology\": \"skin\",\n \"orthopedics\": \"bones and joints\"\n }\n },\n \"urgent\": {\n \"type\": \"noul\",\n \"instructions\": \"Does the patient need to be seen today?\",\n \"criteria\": {\n \"true\": \"symptoms could be life-threatening\"\n }\n },\n \"severity\": {\n \"type\": \"score\",\n \"instructions\": \"How severe are the symptoms?\",\n \"criteria\": [\n \"mild\",\n \"moderate\",\n \"severe\"\n ]\n }\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
import requests
url = "https://ai.{environment}.corti.app/typesafe/v1/systemone"
payload = {
"model": "mammoth-1",
"state": "58-year-old with chest pain on exertion for two weeks, relieved by rest. No pain at rest.",
"questions": {
"department": {
"type": "choice",
"instructions": "Which department should see this patient?",
"criteria": {
"cardiology": "heart and circulation",
"dermatology": "skin",
"orthopedics": "bones and joints"
}
},
"urgent": {
"type": "noul",
"instructions": "Does the patient need to be seen today?",
"criteria": { "true": "symptoms could be life-threatening" }
},
"severity": {
"type": "score",
"instructions": "How severe are the symptoms?",
"criteria": ["mild", "moderate", "severe"]
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ai.{environment}.corti.app/typesafe/v1/systemone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'mammoth-1',
'state' => '58-year-old with chest pain on exertion for two weeks, relieved by rest. No pain at rest.',
'questions' => [
'department' => [
'type' => 'choice',
'instructions' => 'Which department should see this patient?',
'criteria' => [
'cardiology' => 'heart and circulation',
'dermatology' => 'skin',
'orthopedics' => 'bones and joints'
]
],
'urgent' => [
'type' => 'noul',
'instructions' => 'Does the patient need to be seen today?',
'criteria' => [
'true' => 'symptoms could be life-threatening'
]
],
'severity' => [
'type' => 'score',
'instructions' => 'How severe are the symptoms?',
'criteria' => [
'mild',
'moderate',
'severe'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ai.{environment}.corti.app/typesafe/v1/systemone"
payload := strings.NewReader("{\n \"model\": \"mammoth-1\",\n \"state\": \"58-year-old with chest pain on exertion for two weeks, relieved by rest. No pain at rest.\",\n \"questions\": {\n \"department\": {\n \"type\": \"choice\",\n \"instructions\": \"Which department should see this patient?\",\n \"criteria\": {\n \"cardiology\": \"heart and circulation\",\n \"dermatology\": \"skin\",\n \"orthopedics\": \"bones and joints\"\n }\n },\n \"urgent\": {\n \"type\": \"noul\",\n \"instructions\": \"Does the patient need to be seen today?\",\n \"criteria\": {\n \"true\": \"symptoms could be life-threatening\"\n }\n },\n \"severity\": {\n \"type\": \"score\",\n \"instructions\": \"How severe are the symptoms?\",\n \"criteria\": [\n \"mild\",\n \"moderate\",\n \"severe\"\n ]\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ai.{environment}.corti.app/typesafe/v1/systemone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"mammoth-1\",\n \"state\": \"58-year-old with chest pain on exertion for two weeks, relieved by rest. No pain at rest.\",\n \"questions\": {\n \"department\": {\n \"type\": \"choice\",\n \"instructions\": \"Which department should see this patient?\",\n \"criteria\": {\n \"cardiology\": \"heart and circulation\",\n \"dermatology\": \"skin\",\n \"orthopedics\": \"bones and joints\"\n }\n },\n \"urgent\": {\n \"type\": \"noul\",\n \"instructions\": \"Does the patient need to be seen today?\",\n \"criteria\": {\n \"true\": \"symptoms could be life-threatening\"\n }\n },\n \"severity\": {\n \"type\": \"score\",\n \"instructions\": \"How severe are the symptoms?\",\n \"criteria\": [\n \"mild\",\n \"moderate\",\n \"severe\"\n ]\n }\n }\n}")
.asString();{
"id": "decision-82d4140c-b151-4fcf-be91-a4661be068e9",
"object": "structured_decision",
"created": 1796196928,
"model": "mammoth-1",
"answers": {
"department": {
"type": "choice",
"choice": "cardiology",
"probabilities": {
"cardiology": 0.9969,
"dermatology": 0.001,
"orthopedics": 0.0021
},
"confidence": 0.8328
},
"urgent": {
"type": "noul",
"noul": 0.5388,
"probabilities": {
"yes": 0.5388,
"no": 0.4612
},
"confidence": 0.0513
},
"severity": {
"type": "score",
"score": 0.8546,
"legend": {
"0": "mild",
"1": "moderate",
"2": "severe"
},
"probabilities": {
"0": 0.3086,
"1": 0.5281,
"2": 0.1633
},
"confidence": 0.0749
}
},
"usage": {
"input_tokens": 378,
"output_tokens": 3
},
"diagnostics": {
"department": {
"label_mass": 0.8354,
"argmax_is_label": true
},
"urgent": {
"label_mass": 0.0951,
"argmax_is_label": true
},
"severity": {
"label_mass": 0.1418,
"argmax_is_label": true
}
},
"joint": null
}Decisions
Create decision
Answers typed questions about a state with a probability for every allowed answer, instead of generated text. Use it with decision models such as mammoth-1; other models return 422 on this endpoint.
Each question is read on its own against the state, so the state and one question together must fit in 16,384 tokens. A request takes up to 64 questions; split larger sets across requests. Requests that don’t fit are rejected with 400, never truncated.
POST
/
typesafe
/
v1
/
systemone
Create decision
curl --request POST \
--url https://ai.{environment}.corti.app/typesafe/v1/systemone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "mammoth-1",
"state": "58-year-old with chest pain on exertion for two weeks, relieved by rest. No pain at rest.",
"questions": {
"department": {
"type": "choice",
"instructions": "Which department should see this patient?",
"criteria": {
"cardiology": "heart and circulation",
"dermatology": "skin",
"orthopedics": "bones and joints"
}
},
"urgent": {
"type": "noul",
"instructions": "Does the patient need to be seen today?",
"criteria": {
"true": "symptoms could be life-threatening"
}
},
"severity": {
"type": "score",
"instructions": "How severe are the symptoms?",
"criteria": [
"mild",
"moderate",
"severe"
]
}
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'mammoth-1',
state: '58-year-old with chest pain on exertion for two weeks, relieved by rest. No pain at rest.',
questions: {
department: {
type: 'choice',
instructions: 'Which department should see this patient?',
criteria: {
cardiology: 'heart and circulation',
dermatology: 'skin',
orthopedics: 'bones and joints'
}
},
urgent: {
type: 'noul',
instructions: 'Does the patient need to be seen today?',
criteria: {true: 'symptoms could be life-threatening'}
},
severity: {
type: 'score',
instructions: 'How severe are the symptoms?',
criteria: ['mild', 'moderate', 'severe']
}
}
})
};
fetch('https://ai.{environment}.corti.app/typesafe/v1/systemone', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));using RestSharp;
var options = new RestClientOptions("https://ai.{environment}.corti.app/typesafe/v1/systemone");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"model\": \"mammoth-1\",\n \"state\": \"58-year-old with chest pain on exertion for two weeks, relieved by rest. No pain at rest.\",\n \"questions\": {\n \"department\": {\n \"type\": \"choice\",\n \"instructions\": \"Which department should see this patient?\",\n \"criteria\": {\n \"cardiology\": \"heart and circulation\",\n \"dermatology\": \"skin\",\n \"orthopedics\": \"bones and joints\"\n }\n },\n \"urgent\": {\n \"type\": \"noul\",\n \"instructions\": \"Does the patient need to be seen today?\",\n \"criteria\": {\n \"true\": \"symptoms could be life-threatening\"\n }\n },\n \"severity\": {\n \"type\": \"score\",\n \"instructions\": \"How severe are the symptoms?\",\n \"criteria\": [\n \"mild\",\n \"moderate\",\n \"severe\"\n ]\n }\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
import requests
url = "https://ai.{environment}.corti.app/typesafe/v1/systemone"
payload = {
"model": "mammoth-1",
"state": "58-year-old with chest pain on exertion for two weeks, relieved by rest. No pain at rest.",
"questions": {
"department": {
"type": "choice",
"instructions": "Which department should see this patient?",
"criteria": {
"cardiology": "heart and circulation",
"dermatology": "skin",
"orthopedics": "bones and joints"
}
},
"urgent": {
"type": "noul",
"instructions": "Does the patient need to be seen today?",
"criteria": { "true": "symptoms could be life-threatening" }
},
"severity": {
"type": "score",
"instructions": "How severe are the symptoms?",
"criteria": ["mild", "moderate", "severe"]
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ai.{environment}.corti.app/typesafe/v1/systemone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'mammoth-1',
'state' => '58-year-old with chest pain on exertion for two weeks, relieved by rest. No pain at rest.',
'questions' => [
'department' => [
'type' => 'choice',
'instructions' => 'Which department should see this patient?',
'criteria' => [
'cardiology' => 'heart and circulation',
'dermatology' => 'skin',
'orthopedics' => 'bones and joints'
]
],
'urgent' => [
'type' => 'noul',
'instructions' => 'Does the patient need to be seen today?',
'criteria' => [
'true' => 'symptoms could be life-threatening'
]
],
'severity' => [
'type' => 'score',
'instructions' => 'How severe are the symptoms?',
'criteria' => [
'mild',
'moderate',
'severe'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ai.{environment}.corti.app/typesafe/v1/systemone"
payload := strings.NewReader("{\n \"model\": \"mammoth-1\",\n \"state\": \"58-year-old with chest pain on exertion for two weeks, relieved by rest. No pain at rest.\",\n \"questions\": {\n \"department\": {\n \"type\": \"choice\",\n \"instructions\": \"Which department should see this patient?\",\n \"criteria\": {\n \"cardiology\": \"heart and circulation\",\n \"dermatology\": \"skin\",\n \"orthopedics\": \"bones and joints\"\n }\n },\n \"urgent\": {\n \"type\": \"noul\",\n \"instructions\": \"Does the patient need to be seen today?\",\n \"criteria\": {\n \"true\": \"symptoms could be life-threatening\"\n }\n },\n \"severity\": {\n \"type\": \"score\",\n \"instructions\": \"How severe are the symptoms?\",\n \"criteria\": [\n \"mild\",\n \"moderate\",\n \"severe\"\n ]\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ai.{environment}.corti.app/typesafe/v1/systemone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"mammoth-1\",\n \"state\": \"58-year-old with chest pain on exertion for two weeks, relieved by rest. No pain at rest.\",\n \"questions\": {\n \"department\": {\n \"type\": \"choice\",\n \"instructions\": \"Which department should see this patient?\",\n \"criteria\": {\n \"cardiology\": \"heart and circulation\",\n \"dermatology\": \"skin\",\n \"orthopedics\": \"bones and joints\"\n }\n },\n \"urgent\": {\n \"type\": \"noul\",\n \"instructions\": \"Does the patient need to be seen today?\",\n \"criteria\": {\n \"true\": \"symptoms could be life-threatening\"\n }\n },\n \"severity\": {\n \"type\": \"score\",\n \"instructions\": \"How severe are the symptoms?\",\n \"criteria\": [\n \"mild\",\n \"moderate\",\n \"severe\"\n ]\n }\n }\n}")
.asString();{
"id": "decision-82d4140c-b151-4fcf-be91-a4661be068e9",
"object": "structured_decision",
"created": 1796196928,
"model": "mammoth-1",
"answers": {
"department": {
"type": "choice",
"choice": "cardiology",
"probabilities": {
"cardiology": 0.9969,
"dermatology": 0.001,
"orthopedics": 0.0021
},
"confidence": 0.8328
},
"urgent": {
"type": "noul",
"noul": 0.5388,
"probabilities": {
"yes": 0.5388,
"no": 0.4612
},
"confidence": 0.0513
},
"severity": {
"type": "score",
"score": 0.8546,
"legend": {
"0": "mild",
"1": "moderate",
"2": "severe"
},
"probabilities": {
"0": 0.3086,
"1": 0.5281,
"2": 0.1633
},
"confidence": 0.0749
}
},
"usage": {
"input_tokens": 378,
"output_tokens": 3
},
"diagnostics": {
"department": {
"label_mass": 0.8354,
"argmax_is_label": true
},
"urgent": {
"label_mass": 0.0951,
"argmax_is_label": true
},
"severity": {
"label_mass": 0.1418,
"argmax_is_label": true
}
},
"joint": null
}Body
application/json
Unknown fields return 400.
Response
Decision response
Was this page helpful?