{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/twexapi-io/json-schema/twexapi-io-grok-ask-response-schema.json",
  "title": "GrokAskResponse",
  "description": "Response for asking Grok",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/twexapi-io-grok-endpoints-api-openapi.yml#/components/schemas/GrokAskResponse",
  "properties": {
    "code": {
      "type": "integer",
      "title": "Code",
      "description": "Response code"
    },
    "msg": {
      "type": "string",
      "title": "Msg",
      "description": "Response message"
    },
    "data": {
      "anyOf": [
        {
          "$ref": "#/$defs/GrokAskResult"
        },
        {
          "type": "null"
        }
      ],
      "description": "Grok result"
    }
  },
  "type": "object",
  "required": [
    "code",
    "msg"
  ],
  "$defs": {
    "GrokAskResult": {
      "properties": {
        "conversation_id": {
          "type": "string",
          "title": "Conversation Id",
          "description": "Grok conversation id"
        },
        "user_chat_item_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "User Chat Item Id",
          "description": "User chat item id"
        },
        "agent_chat_item_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Agent Chat Item Id",
          "description": "Agent chat item id"
        },
        "message": {
          "type": "string",
          "title": "Message",
          "description": "Final assistant message"
        },
        "reasoning": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reasoning",
          "description": "Reasoning text"
        },
        "soft_stop": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Soft Stop",
          "description": "Whether response soft-stopped"
        },
        "follow_up_suggestions": {
          "items": {
            "$ref": "#/$defs/GrokFollowUpSuggestion"
          },
          "type": "array",
          "title": "Follow Up Suggestions",
          "description": "Follow-up suggestions"
        }
      },
      "type": "object",
      "required": [
        "conversation_id",
        "message"
      ],
      "title": "GrokAskResult",
      "description": "Grok ask result"
    },
    "GrokFollowUpSuggestion": {
      "properties": {
        "label": {
          "type": "string",
          "title": "Label",
          "description": "Suggestion label"
        },
        "properties": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Properties",
          "description": "Suggestion properties"
        },
        "tools_overrides": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tools Overrides",
          "description": "Tools overrides"
        }
      },
      "type": "object",
      "required": [
        "label"
      ],
      "title": "GrokFollowUpSuggestion",
      "description": "Grok follow-up suggestion"
    }
  }
}