{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the response."
    },
    "model": {
      "type": "string",
      "description": "The model version used for this response."
    },
    "type": {
      "type": "string",
      "enum": ["message"],
      "description": "Indicates that the object is a message."
    },
    "role": {
      "type": "string",
      "enum": ["assistant"],
      "description": "Always 'assistant' for responses generated by the model."
    },
    "content": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": ["text", "tool_use"],
            "description": "Type of content block, either text or tool usage."
          },
          "text": {
            "type": "string",
            "description": "The text generated by the assistant."
          },
          "tool_use": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier for this tool usage event."
              },
              "name": {
                "type": "string",
                "description": "The name of the tool used."
              },
              "input": {
                "type": "object",
                "description": "Input parameters provided to the tool."
              }
            },
            "required": ["id", "name", "input"]
          }
        },
        "required": ["type"]
      },
      "description": "An array of content blocks, which can be text or tool usage events."
    },
    "stop_reason": {
      "type": "string",
      "enum": ["end_turn", "max_tokens", "stop_sequence", "tool_use"],
      "description": "Reason why generation stopped."
    },
    "stop_sequence": {
      "type": ["string", "null"],
      "description": "The custom stop sequence that was encountered, if applicable."
    },
    "usage": {
      "type": "object",
      "properties": {
        "input_tokens": {
          "type": "integer",
          "description": "Number of tokens in the input."
        },
        "output_tokens": {
          "type": "integer",
          "description": "Number of tokens in the output."
        }
      },
      "required": ["input_tokens", "output_tokens"],
      "description": "Statistics on token usage for this request and response."
    }
  },
  "required": ["id", "model", "type", "role", "content", "stop_reason", "usage"]
}
