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": "Use the lookup_order tool to check order ORD-9842." }],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "agent_output",
"schema": {
"oneOf": [
{
"type": "object",
"properties": {
"kind": { "const": "tool_call" },
"tool": { "type": "string", "enum": ["search_docs", "lookup_order", "send_email"] },
"arguments": { "type": "object", "additionalProperties": true },
"confidence": { "type": "number", "minimum": 0, "maximum": 1 }
},
"required": ["kind", "tool", "arguments", "confidence"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": { "const": "final_answer" },
"answer": { "type": "string", "minLength": 1, "maxLength": 1200 },
"confidence": { "type": "number", "minimum": 0, "maximum": 1 }
},
"required": ["kind", "answer", "confidence"],
"additionalProperties": false
}
]
}
}
}
}'