Skip to content
Back to feed

January 1, 2026 · xAI

Structured Outputs

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

{
    "name": "movie_response",
    "schema": {
        "type": "object",
        "properties": {
            "title": { "type": "string" },
            "rating": { "type": "number" }
        },
        "required": [ "title", "rating" ],
        "additionalProperties": false
    },
    "strict": true
}

2. Get the desired data

{
  "title": "Star Wars",
  "rating": 8.6
}

Start building more reliable applications. Check out the docs for more information.