Claude · Schema

MessageParam

An input message in the conversation.

Artificial IntelligenceChatbotsConversational AIGenerative AILarge Language ModelsMachine-LearningNatural Language Processing

Properties

Name Type Description
role string The role of the message author.
content object The content of the message. Can be a string or array of content blocks.
View JSON Schema on GitHub

JSON Schema

claude-messageparam-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/MessageParam",
  "title": "MessageParam",
  "type": "object",
  "description": "An input message in the conversation.",
  "required": [
    "role",
    "content"
  ],
  "properties": {
    "role": {
      "type": "string",
      "description": "The role of the message author.",
      "enum": [
        "user",
        "assistant"
      ],
      "example": "user"
    },
    "content": {
      "description": "The content of the message. Can be a string or array of content blocks.",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/ContentBlockParam"
          }
        }
      ],
      "example": "example_value"
    }
  }
}