Structured outputs
Set response_format.type to json_object or json_schema. The model must list structured_outputs in GET /v1/models. Only text, json_object, and json_schema are accepted — anything else is ignored.
400 if structured outputs are off
json_object and json_schema return 400 invalid_request on models that do not list structured outputs. Check the catalog before sending the field.Example
terminal
curl https://api.astorias.ai/v1/chat/completions \
-H "Authorization: Bearer $ASTORIAS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "{huggingface-model-id}",
"messages": [{"role": "user", "content": "Extract the city and temperature."}],
"response_format": {
"type": "json_object"
}
}'Python and JavaScript show json_schema. The curl example uses json_object, which still requires the model flag.