---
title: "Message delta object"
url: "https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1/schemas/MessageDeltaObject"
---

> Full API specification: https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1.md

# Message delta object

Represents a message delta i.e. any changed fields on a message during streaming.

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: OpenAI API
  version: 2.3.0
servers:
  - url: https://api.openai.com/v1
components:
  schemas:
    MessageDeltaContentImageFileObject:
      title: Image file
      type: object
      description: References an image [File](/docs/api-reference/files) in the
        content of a message.
      properties:
        index:
          type: integer
          description: The index of the content part in the message.
        type:
          description: Always `image_file`.
          type: string
          enum:
            - image_file
          x-stainless-const: true
        image_file:
          type: object
          properties:
            file_id:
              description: The [File](/docs/api-reference/files) ID of the image in the
                message content. Set `purpose="vision"` when uploading the File
                if you need to later display the file content.
              type: string
            detail:
              type: string
              description: Specifies the detail level of the image if specified by the user.
                `low` uses fewer tokens, you can opt in to high resolution using
                `high`.
              enum:
                - auto
                - low
                - high
              default: auto
      required:
        - index
        - type
    MessageDeltaContentTextObject:
      title: Text
      type: object
      description: The text content that is part of a message.
      properties:
        index:
          type: integer
          description: The index of the content part in the message.
        type:
          description: Always `text`.
          type: string
          enum:
            - text
          x-stainless-const: true
        text:
          type: object
          properties:
            value:
              description: The data that makes up the text.
              type: string
            annotations:
              type: array
              items:
                oneOf:
                  - $ref: "#/components/schemas/MessageDeltaContentTextAnnotationsFileCitationObjec\
                      t"
                  - $ref: "#/components/schemas/MessageDeltaContentTextAnnotationsFilePathObject"
                x-oaiExpandable: true
      required:
        - index
        - type
    MessageDeltaContentRefusalObject:
      title: Refusal
      type: object
      description: The refusal content that is part of a message.
      properties:
        index:
          type: integer
          description: The index of the refusal part in the message.
        type:
          description: Always `refusal`.
          type: string
          enum:
            - refusal
          x-stainless-const: true
        refusal:
          type: string
      required:
        - index
        - type
    MessageDeltaContentImageUrlObject:
      title: Image URL
      type: object
      description: References an image URL in the content of a message.
      properties:
        index:
          type: integer
          description: The index of the content part in the message.
        type:
          description: Always `image_url`.
          type: string
          enum:
            - image_url
          x-stainless-const: true
        image_url:
          type: object
          properties:
            url:
              description: "The URL of the image, must be a supported image types: jpeg, jpg,
                png, gif, webp."
              type: string
            detail:
              type: string
              description: Specifies the detail level of the image. `low` uses fewer tokens,
                you can opt in to high resolution using `high`.
              enum:
                - auto
                - low
                - high
              default: auto
      required:
        - index
        - type
    MessageDeltaContentTextAnnotationsFileCitationObject:
      title: File citation
      type: object
      description: A citation within the message that points to a specific quote from
        a specific File associated with the assistant or the message. Generated
        when the assistant uses the "file_search" tool to search files.
      properties:
        index:
          type: integer
          description: The index of the annotation in the text content part.
        type:
          description: Always `file_citation`.
          type: string
          enum:
            - file_citation
          x-stainless-const: true
        text:
          description: The text in the message content that needs to be replaced.
          type: string
        file_citation:
          type: object
          properties:
            file_id:
              description: The ID of the specific File the citation is from.
              type: string
            quote:
              description: The specific quote in the file.
              type: string
        start_index:
          type: integer
          minimum: 0
        end_index:
          type: integer
          minimum: 0
      required:
        - index
        - type
    MessageDeltaContentTextAnnotationsFilePathObject:
      title: File path
      type: object
      description: A URL for the file that's generated when the assistant used the
        `code_interpreter` tool to generate a file.
      properties:
        index:
          type: integer
          description: The index of the annotation in the text content part.
        type:
          description: Always `file_path`.
          type: string
          enum:
            - file_path
          x-stainless-const: true
        text:
          description: The text in the message content that needs to be replaced.
          type: string
        file_path:
          type: object
          properties:
            file_id:
              description: The ID of the file that was generated.
              type: string
        start_index:
          type: integer
          minimum: 0
        end_index:
          type: integer
          minimum: 0
      required:
        - index
        - type
    MessageDeltaObject:
      type: object
      title: Message delta object
      description: >
        Represents a message delta i.e. any changed fields on a message during
        streaming.
      properties:
        id:
          description: The identifier of the message, which can be referenced in API
            endpoints.
          type: string
        object:
          description: The object type, which is always `thread.message.delta`.
          type: string
          enum:
            - thread.message.delta
          x-stainless-const: true
        delta:
          description: The delta containing the fields that have changed on the Message.
          type: object
          properties:
            role:
              description: The entity that produced the message. One of `user` or `assistant`.
              type: string
              enum:
                - user
                - assistant
            content:
              description: The content of the message in array of text and/or images.
              type: array
              items:
                oneOf:
                  - $ref: "#/components/schemas/MessageDeltaContentImageFileObject"
                  - $ref: "#/components/schemas/MessageDeltaContentTextObject"
                  - $ref: "#/components/schemas/MessageDeltaContentRefusalObject"
                  - $ref: "#/components/schemas/MessageDeltaContentImageUrlObject"
                x-oaiExpandable: true
      required:
        - id
        - object
        - delta
      x-oaiMeta:
        name: The message delta object
        beta: true
        example: |
          {
            "id": "msg_123",
            "object": "thread.message.delta",
            "delta": {
              "content": [
                {
                  "index": 0,
                  "type": "text",
                  "text": { "value": "Hello", "annotations": [] }
                }
              ]
            }
          }
```
