System One
Answer one or more questions about the content supplied in state.
You can mix question types in one request. Answers use the same names as the questions, so you can match each result to its question. The response also includes the model used and token usage.
curl --request POST \
--url https://api.typesafe.ai/v1/systemone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "jev-latest",
"state": "I was charged twice for my subscription this month. Please refund the extra charge.",
"questions": {
"billing": {
"type": "noul",
"instructions": "Is this message about billing?"
}
}
}
'{
"model": "jev-latest",
"answers": {
"billing": {
"type": "noul",
"noul": 0.98
}
},
"usage": {
"input_tokens": 120,
"output_tokens": 12
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Set to true to use assets or box questions.
true Set to true to use long context.
true Body
Content and named questions to evaluate together using a TypeSafe model.
Name or alias of the model to use. Available names are returned by GET /v1/models.
"jev-latest"
The content all questions in this request refer to.
"I was charged twice. Please help."
Questions to ask about the content, each with a name you choose. The response uses those names to identify the answers.
Hide child attributes
Hide child attributes
A question about the supplied content.
- Noul
- Choice
- Score
- Box
Hide child attributes
Hide child attributes
Identifies a yes/no question or statement.
"noul""noul"
The yes/no question or statement to evaluate.
"Is this message spam?"
Criteria clarifying what counts as a yes or no answer.
Hide child attributes
Hide child attributes
What counts as a yes answer.
"The message is unsolicited advertising."
What counts as a no answer.
"The message is a legitimate conversation."
{
"false": "A legitimate conversation",
"true": "Unsolicited advertising"
}
{
"billing": {
"instructions": "Is this message about billing?",
"type": "noul"
}
}
Media assets keyed by an opaque placeholder (recommend a per-image UUID). Each placeholder, wherever it appears as or inside a string in state, question instructions, or criteria, is replaced with the asset. Image assets require a vision-language model.
Hide child attributes
Hide child attributes
An image that replaces its placeholder: its bytes in data_base64 with their format, or, in a multipart request, the name of the image part that holds them. Requests with images must send the header TypeSafe-Danger-Zone-Images: true.
Hide child attributes
Hide child attributes
Identifies an image asset.
"image"The image format, required with data_base64. The actual format is detected from the bytes.
png, jpg, jpeg Base64-encoded image data.
In a multipart request, the name of the image part this asset uses. With part, data_base64 is ignored.
Response
Successful Response
Answers grouped by question name, with the model used and token usage.
Name of the model that answered the questions. May differ from the alias supplied in the request.
"jev-latest"
Answers keyed by the question names supplied in the request. Each answer's type matches its question's type.
Hide child attributes
Hide child attributes
An answer whose type matches the corresponding question.
- Noul
- Choice
- Score
- Box
Hide child attributes
Hide child attributes
Identifies a yes/no answer.
"noul""noul"
Probability of a yes answer or a true statement, from 0 to 1. Values near 1 favor yes or true, values near 0 favor no or false, and values near 0.5 indicate uncertainty.
0.98
{
"billing": { "noul": 0.98, "type": "noul" }
}
Input and output token counts for this evaluation.
{ "input_tokens": 120, "output_tokens": 12 }
Was this page helpful?
curl --request POST \
--url https://api.typesafe.ai/v1/systemone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "jev-latest",
"state": "I was charged twice for my subscription this month. Please refund the extra charge.",
"questions": {
"billing": {
"type": "noul",
"instructions": "Is this message about billing?"
}
}
}
'{
"model": "jev-latest",
"answers": {
"billing": {
"type": "noul",
"noul": 0.98
}
},
"usage": {
"input_tokens": 120,
"output_tokens": 12
}
}
