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": "Announce a new schema audit service for engineering teams.\nTone should be professional and concrete." }],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "content_payload",
"schema": {
"type": "object",
"properties": {
"headline": { "type": "string", "minLength": 15, "maxLength": 80 },
"subheadline": { "type": "string", "minLength": 25, "maxLength": 140 },
"key_points": {
"type": "array",
"minItems": 3,
"maxItems": 5,
"items": { "type": "string", "minLength": 20, "maxLength": 140 }
},
"cta": {
"type": "object",
"properties": {
"label": { "type": "string", "minLength": 2, "maxLength": 24 },
"url": { "type": "string", "pattern": "^https://" }
},
"required": ["label", "url"],
"additionalProperties": false
},
"tone": { "type": "string", "enum": ["professional", "friendly", "technical"] }
},
"required": ["headline", "subheadline", "key_points", "cta", "tone"],
"additionalProperties": false
}
}
}
}'