curl https://api.inference.net/v1/chat/completions \
-H "Authorization: Bearer $INFERENCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "meta-llama/llama-3.2-11b-instruct/fp-16",
"messages": [
{ "role": "system", "content": "You are a multi-label classifier. Given a headline and a list of possible labels, return all applicable labels as an array. Only include labels from the provided list. If none apply, return [\"none\"]. Respond only with the array of matching labels." },
{ "role": "user", "content": "Headline: \"Russia funds new AI climate project\"" }
],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "news_tags",
"strict": true,
"schema": {
"type": "object",
"properties": {
"labels": {
"type": "array",
"items": { "type": "string", "enum": ["space","science","technology","climate", "none"] }
}
},
"required": ["labels"],
"additionalProperties": false
}
}
}
}'