curl https://router.requesty.ai/v1/systemone \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_REQUESTY_API_KEY" \
-d '{
"model": "openai/gpt-6-luna",
"state": "The dragon heist in this fantasy novel had me hooked, but the ending dragged a little.",
"questions": {
"positive": {
"type": "noul",
"instructions": "The review is positive."
},
"genre": {
"type": "choice",
"instructions": "Which genre is the book?",
"criteria": {
"fantasy": "Magic, myth or invented worlds",
"mystery": "A crime or puzzle to solve",
"romance": "A love story"
}
},
"rating": {
"type": "score",
"instructions": "How much did the reviewer enjoy the book?",
"criteria": ["Hated it", "Disliked it", "Neutral", "Liked it", "Loved it"]
}
}
}'
import httpx
response = httpx.post(
"https://router.requesty.ai/v1/systemone",
headers={"Authorization": "Bearer YOUR_REQUESTY_API_KEY"},
json={
"model": "openai/gpt-6-luna",
"state": "The dragon heist in this fantasy novel had me hooked, but the ending dragged a little.",
"questions": {
"positive": {"type": "noul", "instructions": "The review is positive."},
},
},
)
answer = response.json()["answers"]["positive"]
if answer["type"] == "refusal":
print("The model declined to answer")
else:
print(answer["noul"])
const response = await fetch("https://router.requesty.ai/v1/systemone", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.REQUESTY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "openai/gpt-6-luna",
state: "The dragon heist in this fantasy novel had me hooked, but the ending dragged a little.",
questions: {
positive: { type: "noul", instructions: "The review is positive." },
},
}),
});
const { answers } = await response.json();
const answer = answers.positive;
console.log(answer.type === "refusal" ? "The model declined to answer" : answer.noul);
{
"answers": {
"genre": {
"type": "choice",
"choice": "fantasy",
"confidence": 1,
"probabilities": {
"fantasy": 1,
"mystery": 0,
"romance": 0
}
},
"positive": {
"type": "noul",
"noul": 0.73
},
"rating": {
"type": "score",
"score": 3.1,
"confidence": 0.87,
"probabilities": [
{ "value": 0, "probability": 0.01 },
{ "value": 1, "probability": 0 },
{ "value": 2, "probability": 0 },
{ "value": 3, "probability": 0.86 },
{ "value": 4, "probability": 0.13 }
]
}
},
"id": "rqsty-dcsn-15e2efde-f7c6-49cb-92ae-c763b1b16193",
"model": "gpt-6-luna",
"provider": "openai",
"usage": {
"input_tokens": 424,
"output_tokens": 0
}
}
{
"answers": {
"positive": {
"type": "refusal"
}
},
"id": "rqsty-dcsn-75924058-d3b3-471a-b19c-4e003550bcc7",
"model": "gpt-6-luna",
"provider": "openai",
"usage": {
"input_tokens": 5,
"output_tokens": 0
}
}
Create System One Decision
Ask typed questions about a piece of content in TypeSafe’s System One format. Images go in assets, as JSON or as multipart form parts.
curl https://router.requesty.ai/v1/systemone \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_REQUESTY_API_KEY" \
-d '{
"model": "openai/gpt-6-luna",
"state": "The dragon heist in this fantasy novel had me hooked, but the ending dragged a little.",
"questions": {
"positive": {
"type": "noul",
"instructions": "The review is positive."
},
"genre": {
"type": "choice",
"instructions": "Which genre is the book?",
"criteria": {
"fantasy": "Magic, myth or invented worlds",
"mystery": "A crime or puzzle to solve",
"romance": "A love story"
}
},
"rating": {
"type": "score",
"instructions": "How much did the reviewer enjoy the book?",
"criteria": ["Hated it", "Disliked it", "Neutral", "Liked it", "Loved it"]
}
}
}'
import httpx
response = httpx.post(
"https://router.requesty.ai/v1/systemone",
headers={"Authorization": "Bearer YOUR_REQUESTY_API_KEY"},
json={
"model": "openai/gpt-6-luna",
"state": "The dragon heist in this fantasy novel had me hooked, but the ending dragged a little.",
"questions": {
"positive": {"type": "noul", "instructions": "The review is positive."},
},
},
)
answer = response.json()["answers"]["positive"]
if answer["type"] == "refusal":
print("The model declined to answer")
else:
print(answer["noul"])
const response = await fetch("https://router.requesty.ai/v1/systemone", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.REQUESTY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "openai/gpt-6-luna",
state: "The dragon heist in this fantasy novel had me hooked, but the ending dragged a little.",
questions: {
positive: { type: "noul", instructions: "The review is positive." },
},
}),
});
const { answers } = await response.json();
const answer = answers.positive;
console.log(answer.type === "refusal" ? "The model declined to answer" : answer.noul);
{
"answers": {
"genre": {
"type": "choice",
"choice": "fantasy",
"confidence": 1,
"probabilities": {
"fantasy": 1,
"mystery": 0,
"romance": 0
}
},
"positive": {
"type": "noul",
"noul": 0.73
},
"rating": {
"type": "score",
"score": 3.1,
"confidence": 0.87,
"probabilities": [
{ "value": 0, "probability": 0.01 },
{ "value": 1, "probability": 0 },
{ "value": 2, "probability": 0 },
{ "value": 3, "probability": 0.86 },
{ "value": 4, "probability": 0.13 }
]
}
},
"id": "rqsty-dcsn-15e2efde-f7c6-49cb-92ae-c763b1b16193",
"model": "gpt-6-luna",
"provider": "openai",
"usage": {
"input_tokens": 424,
"output_tokens": 0
}
}
{
"answers": {
"positive": {
"type": "refusal"
}
},
"id": "rqsty-dcsn-75924058-d3b3-471a-b19c-4e003550bcc7",
"model": "gpt-6-luna",
"provider": "openai",
"usage": {
"input_tokens": 5,
"output_tokens": 0
}
}
curl https://router.requesty.ai/v1/systemone \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_REQUESTY_API_KEY" \
-d '{
"model": "openai/gpt-6-luna",
"state": "The dragon heist in this fantasy novel had me hooked, but the ending dragged a little.",
"questions": {
"positive": {
"type": "noul",
"instructions": "The review is positive."
},
"genre": {
"type": "choice",
"instructions": "Which genre is the book?",
"criteria": {
"fantasy": "Magic, myth or invented worlds",
"mystery": "A crime or puzzle to solve",
"romance": "A love story"
}
},
"rating": {
"type": "score",
"instructions": "How much did the reviewer enjoy the book?",
"criteria": ["Hated it", "Disliked it", "Neutral", "Liked it", "Loved it"]
}
}
}'
import httpx
response = httpx.post(
"https://router.requesty.ai/v1/systemone",
headers={"Authorization": "Bearer YOUR_REQUESTY_API_KEY"},
json={
"model": "openai/gpt-6-luna",
"state": "The dragon heist in this fantasy novel had me hooked, but the ending dragged a little.",
"questions": {
"positive": {"type": "noul", "instructions": "The review is positive."},
},
},
)
answer = response.json()["answers"]["positive"]
if answer["type"] == "refusal":
print("The model declined to answer")
else:
print(answer["noul"])
const response = await fetch("https://router.requesty.ai/v1/systemone", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.REQUESTY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "openai/gpt-6-luna",
state: "The dragon heist in this fantasy novel had me hooked, but the ending dragged a little.",
questions: {
positive: { type: "noul", instructions: "The review is positive." },
},
}),
});
const { answers } = await response.json();
const answer = answers.positive;
console.log(answer.type === "refusal" ? "The model declined to answer" : answer.noul);
{
"answers": {
"genre": {
"type": "choice",
"choice": "fantasy",
"confidence": 1,
"probabilities": {
"fantasy": 1,
"mystery": 0,
"romance": 0
}
},
"positive": {
"type": "noul",
"noul": 0.73
},
"rating": {
"type": "score",
"score": 3.1,
"confidence": 0.87,
"probabilities": [
{ "value": 0, "probability": 0.01 },
{ "value": 1, "probability": 0 },
{ "value": 2, "probability": 0 },
{ "value": 3, "probability": 0.86 },
{ "value": 4, "probability": 0.13 }
]
}
},
"id": "rqsty-dcsn-15e2efde-f7c6-49cb-92ae-c763b1b16193",
"model": "gpt-6-luna",
"provider": "openai",
"usage": {
"input_tokens": 424,
"output_tokens": 0
}
}
{
"answers": {
"positive": {
"type": "refusal"
}
},
"id": "rqsty-dcsn-75924058-d3b3-471a-b19c-4e003550bcc7",
"model": "gpt-6-luna",
"provider": "openai",
"usage": {
"input_tokens": 5,
"output_tokens": 0
}
}
model needs its provider prefix, for example typesafe/jev-1.13.0 or cloudflare/clef. List the available models with /v1/models/decision. See Decisions for the question types.
Every answer has a type. A model can decline a question and return {"type": "refusal"} for it, so check type before reading the value. See OpenAI’s Decisions guide.
Responses are not streamed. To put images directly inside state, use /v1/decisions.
Images
Models that accept images, such ascloudflare/clef and openai/gpt-6-luna, also look at images. Send each image in assets under a name you choose, and mention that name in state so the model knows which image it refers to. typesafe models reject assets that state does not reference. Images inside state are rejected on this endpoint.
JSON
Each asset carries itsformat and the base64-encoded image bytes in data_base64, without a data: prefix.
curl https://router.requesty.ai/v1/systemone \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_REQUESTY_API_KEY" \
-d '{
"model": "openai/gpt-6-luna",
"state": "Listing title: Red leather armchair. Photo: listing_photo",
"assets": {
"listing_photo": {
"type": "image",
"format": "jpeg",
"data_base64": "/9j/4AAQSkZJRgABAQAAAQABAAD..."
}
},
"questions": {
"matches_title": {
"type": "noul",
"instructions": "The photo shows the item in the title."
},
"color": {
"type": "choice",
"instructions": "What is the main colour in the photo?",
"criteria": {
"red": "Red",
"green": "Green",
"blue": "Blue"
}
}
}
}'
Multipart
Upload image files without base64-encoding them by sending amultipart/form-data request, the format TypeSafe’s SDKs use. Put the JSON request in a part named request, and point each asset at the part that holds its file with part. Image parts need an image/* content type.
curl https://router.requesty.ai/v1/systemone \
-H "Authorization: Bearer YOUR_REQUESTY_API_KEY" \
-F 'request={"model":"openai/gpt-6-luna","state":"Listing title: Red leather armchair. Photo: listing_photo","assets":{"listing_photo":{"type":"image","part":"photo"}},"questions":{"matches_title":{"type":"noul","instructions":"The photo shows the item in the title."}}};type=application/json' \
-F '[email protected];type=image/jpeg'
{
"answers": {
"color": {
"type": "choice",
"choice": "red",
"confidence": 0.99,
"probabilities": {
"blue": 0,
"green": 0.01,
"red": 0.99
}
},
"matches_title": {
"type": "noul",
"noul": 0.52
}
},
"id": "rqsty-dcsn-b57050ea-7298-4d59-a0b0-ffc87db60fe8",
"model": "gpt-6-luna",
"provider": "openai",
"usage": {
"input_tokens": 287,
"output_tokens": 0
}
}
Authorizations
API key for authentication
Body
Request body for POST /v1/systemone, in TypeSafe's System One format. Images go in assets; images inside state are rejected on this endpoint.
A decision model ID from /v1/models/decision.
"openai/gpt-6-luna"
The content to evaluate: a string, an object or an array. Mention each asset's name in state so the model knows which image it refers to; typesafe models reject assets that state does not reference.
Map of question ID to question. Each ID gets one entry in answers.
Show child attributes
Show child attributes
Map of asset name to image. Only for models that accept images, such as cloudflare/clef and openai/gpt-6-luna.
Show child attributes
Show child attributes
Was this page helpful?