TypeSafe System One
| Method | Path | Use |
|---|---|---|
POST | /v1/systemone | Answer typed questions (yes/no probability, single choice, score) about one piece of content and return structured answers |
Both the request and the response follow TypeSafe's official System One API. A client written against the official docs only needs its base URL changed to https://api.modelgo.ai and a ModelGo API key. model is the platform logical model name; whether a model offers this endpoint follows the protocols shown in the model marketplace (TypeSafe System One), otherwise the gateway answers 400 model_protocol_not_offered. The endpoint is synchronous, generates no text, and does not stream.
bash
curl https://api.modelgo.ai/v1/systemone \
-H "Authorization: Bearer $MODELGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<model>",
"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?"
},
"tone": {
"type": "choice",
"instructions": "What is the tone of this message?",
"criteria": {
"angry": "An upset or hostile message",
"calm": "A neutral or polite message",
"excited": "An enthusiastic or eager message"
}
},
"urgency": {
"type": "score",
"instructions": "How urgent is this message?",
"criteria": ["Can wait", "Needs attention this week", "Needs attention today"]
}
}
}'Request
| Field | Type | Required | Notes |
|---|---|---|---|
model | string | Yes | Platform logical model name |
state | string / object / array | Yes | The content every question refers to |
questions | object | Yes | Question name → question, at least one; each name becomes a key in answers |
Every question needs a type and an instructions (string, object, or array) describing what to judge. The official API lets you omit instructions, but the provider currently serving this platform requires it and answers 400 without it:
type | Meaning | criteria | Answer fields |
|---|---|---|---|
noul | Yes / no | Optional, {"true": …, "false": …} | noul: probability of "yes" (0–1) |
choice | Pick one | Required, choice name → description, 1–255 entries | choice, confidence, probabilities |
score | Ordered rating | Required, an array of 1–10 level descriptions; the index is the score (starting at 0) | score (weighted expected value, may be fractional), confidence, legend, probabilities |
Response
json
{
"model": "<model>",
"answers": {
"billing": { "type": "noul", "noul": 0.98 },
"tone": {
"type": "choice",
"choice": "calm",
"confidence": 0.7,
"probabilities": { "angry": 0.15, "calm": 0.8, "excited": 0.05 }
},
"urgency": {
"type": "score",
"score": 1.7,
"confidence": 0.55,
"legend": { "0": "Can wait", "1": "Needs attention this week", "2": "Needs attention today" },
"probabilities": { "0": 0.1, "1": 0.1, "2": 0.8 }
}
},
"usage": { "input_tokens": 277, "output_tokens": 20 }
}modelechoes the logical model name you sent.- Billing uses the token counts in
usage; unit prices are in the console's model list. - A missing
modelorstate, or an emptyquestions, is refused with400before any upstream call; question fields are validated by the model and an invalid one also returns a 4xx. Errors use the platform's unified error format (not the officialdetailshape); see Errors & Rate Limits. - A
streamfield in the request is ignored; the full JSON answer is always returned synchronously.
Not supported yet
- Image
assets,boxquestions, and anything else that needs aTypeSafe-Danger-Zone-*request header (including long context); multipart/form-datarequest bodies — the body must be JSON.