release notes
We're excited to announce that Grok now supports structured outputs. Grok can
now format responses in a predefined, organized format rather than free-form text. 1. Specify the
desired schema
Text
{
"name": "movie_response",
"schema": {
"type": "object",
"properties": {
"title": { "type": "string" },
"rating": { "type": "number" }
},
"required": [ "title", "rating" ],
"additionalProperties": false
},
"strict": true
}
Get the desired data
Text
{
"title": "Star Wars",
"rating": 8.6
}
Start building more reliable applications. Check out the docs for more information.