OpenAI APIs · Schema

CreateMessageRequest

Artificial IntelligenceEmbeddingsImage GenerationLanguage ModelsSpeech

Properties

Name Type Description
role string The role of the entity creating the message
content object The content of the message
metadata object Key-value metadata for the message
View JSON Schema on GitHub

JSON Schema

openai-apis-createmessagerequest-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/CreateMessageRequest",
  "title": "CreateMessageRequest",
  "type": "object",
  "required": [
    "role",
    "content"
  ],
  "properties": {
    "role": {
      "type": "string",
      "enum": [
        "user",
        "assistant"
      ],
      "description": "The role of the entity creating the message"
    },
    "content": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      ],
      "description": "The content of the message"
    },
    "metadata": {
      "type": "object",
      "description": "Key-value metadata for the message"
    }
  }
}