curl https://api.dottxt.ai/v1/chat/completions \
-H "Authorization: Bearer $DOTTXT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-oss-20b",
"messages": [{ "role": "user", "content": "My card was charged twice for order ORD-9842. Need refund today." }],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "ticket_classification",
"schema": {
"oneOf": [
{
"type": "object",
"properties": {
"label": { "type": "string", "enum": ["billing", "technical", "account", "shipping"] },
"priority": { "type": "string", "enum": ["low", "medium", "high", "urgent"] },
"evidence": { "type": "array", "items": { "type": "string", "minLength": 10, "maxLength": 160 }, "minItems": 1, "maxItems": 3 }
},
"required": ["label", "priority", "evidence"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"label": { "type": "string", "const": "other" },
"other_label": { "type": "string", "minLength": 3, "maxLength": 60 },
"priority": { "type": "string", "enum": ["low", "medium", "high", "urgent"] },
"evidence": { "type": "array", "items": { "type": "string", "minLength": 10, "maxLength": 160 }, "minItems": 1, "maxItems": 3 }
},
"required": ["label", "other_label", "priority", "evidence"],
"additionalProperties": false
}
]
}
}
}
}'