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": "Qualify lead LEAD-9821: mid-market company, 51-200 employees, uses Salesforce and HubSpot, high priority for Q2 migration." }],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "lead_qualification",
"schema": {
"type": "object",
"properties": {
"lead_id": { "type": "string", "pattern": "^LEAD-[0-9]{4,10}$" },
"segment": { "type": "string", "enum": ["smb", "mid_market", "enterprise"] },
"priority": { "type": "string", "enum": ["low", "medium", "high"] },
"company_size": { "type": "string", "enum": ["1-10", "11-50", "51-200", "201+"] },
"tech_stack": {
"type": "array",
"items": { "type": "string", "minLength": 1, "maxLength": 40 },
"maxItems": 10
},
"notes": { "type": "string", "maxLength": 300 }
},
"required": ["lead_id", "segment", "priority"],
"additionalProperties": false
}
}
}
}'