Decisions
Accepts input and a questions array. Also accepts the System One format (state and a questions object). Responses use the submitted format. Use one format per request.
Typed answers and token usage. Example costs are illustrative.
Invalid request or unsupported input.
Internal server error.
curl https://api.cortecs.ai/v1/decisions \
-H "Authorization: Bearer $CORTECS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "clef",
"input": "Cold storage is at 9 C; the maximum allowed temperature is 5 C.",
"questions": [
{
"type": "predicate",
"name": "inspect",
"instructions": "Does the room need a temperature inspection?"
}
]
}'
{
"model": "clef",
"answers": [
{
"type": "predicate",
"name": "inspect",
"probability": 0.97
}
],
"usage": {
"input_tokens": 100,
"output_tokens": 0,
"cost": 20,
"cost_details": {
"prompt_cost": 20,
"completion_cost": 0
},
"total_tokens": 100
}
}Accepts state and a named questions object and returns a named answers object. Use /decisions for input and a questions array. Use one format per request.
Choose an available model tagged Decision.
Application state as text, an object, or an array.
The provider preference for handling the request.
Provider IDs allowed to process the request, subject to project settings.
Whether to use only providers based and regulated within the EU.
Set to custom to try allowed_providers in the listed order instead of using preference-based routing.
customPossible values: Whether to use only zero-data-retention providers.
Allow automatic model fallback. Project settings may override this value.
Explicit fallback model IDs, tried in order. A nonempty list takes precedence over automatic fallback settings.
Typed answers and token usage.
Invalid request or unsupported input.
Internal server error.
curl https://api.cortecs.ai/v1/systemone \
-H "Authorization: Bearer $CORTECS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "clef",
"state": "Cold storage is at 9 C; the maximum allowed temperature is 5 C.",
"questions": {
"inspect": {
"type": "noul",
"instructions": "Does the room need a temperature inspection?"
}
}
}'
{
"model": "clef",
"answers": {
"inspect": {
"type": "noul",
"noul": 0.97
}
},
"usage": {
"input_tokens": 100,
"output_tokens": 0,
"cost": 20,
"cost_details": {
"prompt_cost": 20,
"completion_cost": 0
}
}
}Last updated