curl https://api.inference.net/v1/chat/completions \
-H "Authorization: Bearer $INFERENCE_API_KEY" \
-H "Content-Type: application/json" \
-d @- <<'JSON'
{
"model": "meta-llama/llama-3.2-3b-instruct/fp-16",
"messages": [
{
"role": "system",
"content": "You are a support ticket classifier."
},
{
"role": "user",
"content": "Classify customer support requests into intents. Examples:\n\n\"My order hasn't arrived yet\" → billing_issue\n\"How do I reset my password?\" → account_help\n\"The app keeps crashing on iOS\" → technical_support\n\"I want to cancel my subscription\" → billing_issue\n\"Can you explain how the free trial works?\" → product_info\n\nNow classify: \"I was charged twice for the same order\"\nReply with JSON only."
}
],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "intent_classification",
"strict": true,
"schema": {
"type": "object",
"properties": {
"intent": {
"type": "string",
"enum": ["billing_issue", "account_help", "technical_support", "product_info", "other"]
},
"confidence": { "type": "number", "minimum": 0, "maximum": 1 },
"reasoning": { "type": "string", "maxLength": 100 }
},
"required": ["intent", "confidence", "reasoning"],
"additionalProperties": false
}
}
}
}