Skip to main content

ChatCompletionMessageSchema

A single chat message. For image-to-text models, content may be an array of text and image parts.

content object[]nullable

The message content. For image-to-text models, pass an array of content parts, each a text part or an image_url part (shown below). For plain text-only messages, you can also pass content as a single string.

  • Array [
  • typestringrequired

    The content part type.

    Possible values: [text, image_url]

    textstring

    The text of this part. Provide when type is text.

    image_url object

    The image for this part. Provide when type is image_url.

    urlstringrequired

    The image as a data URI (base64-encoded) or a publicly reachable URL.

    detailstring

    How much detail the model uses when processing the image.

    Possible values: [auto, high, low]

    Default: auto
  • ]
  • rolestringrequired

    The role of the message author: system, user, or assistant.

    jsonChatCompletionMessageSchema
    {
    "content": "string",
    "role": "string"
    }