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

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

# RealtimeResponse

The response resource.

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: OpenAI API
  version: 2.3.0
servers:
  - url: https://api.openai.com/v1
components:
  schemas:
    RealtimeConversationItem:
      type: object
      x-oaiExpandable: true
      description: The item to add to the conversation.
      properties:
        id:
          type: string
          description: >
            The unique ID of the item, this can be generated by the client to
            help 

            manage server-side context, but is not required because the server
            will 

            generate one if not provided.
        type:
          type: string
          enum:
            - message
            - function_call
            - function_call_output
          description: >
            The type of the item (`message`, `function_call`,
            `function_call_output`).
        object:
          type: string
          enum:
            - realtime.item
          description: >
            Identifier for the API object being returned - always
            `realtime.item`.
          x-stainless-const: true
        status:
          type: string
          enum:
            - completed
            - incomplete
          description: >
            The status of the item (`completed`, `incomplete`). These have no
            effect 

            on the conversation, but are accepted for consistency with the 

            `conversation.item.created` event.
        role:
          type: string
          enum:
            - user
            - assistant
            - system
          description: >
            The role of the message sender (`user`, `assistant`, `system`),
            only 

            applicable for `message` items.
        content:
          type: array
          x-oaiExpandable: true
          description: >
            The content of the message, applicable for `message` items. 

            - Message items of role `system` support only `input_text` content

            - Message items of role `user` support `input_text` and
            `input_audio` 
              content
            - Message items of role `assistant` support `text` content.
          items:
            type: object
            x-oaiExpandable: true
            properties:
              type:
                type: string
                enum:
                  - input_audio
                  - input_text
                  - item_reference
                  - text
                description: >
                  The content type (`input_text`, `input_audio`,
                  `item_reference`, `text`).
              text:
                type: string
                description: >
                  The text content, used for `input_text` and `text` content
                  types.
              id:
                type: string
                description: >
                  ID of a previous conversation item to reference (for
                  `item_reference`

                  content types in `response.create` events). These can
                  reference both

                  client and server created items.
              audio:
                type: string
                description: >
                  Base64-encoded audio bytes, used for `input_audio` content
                  type.
              transcript:
                type: string
                description: >
                  The transcript of the audio, used for `input_audio` content
                  type.
        call_id:
          type: string
          description: >
            The ID of the function call (for `function_call` and 

            `function_call_output` items). If passed on a
            `function_call_output` 

            item, the server will check that a `function_call` item with the
            same 

            ID exists in the conversation history.
        name:
          type: string
          description: |
            The name of the function being called (for `function_call` items).
        arguments:
          type: string
          description: |
            The arguments of the function call (for `function_call` items).
        output:
          type: string
          description: |
            The output of the function call (for `function_call_output` items).
    Metadata:
      type: object
      description: >
        Set of 16 key-value pairs that can be attached to an object. This can be

        useful for storing additional information about the object in a
        structured

        format, and querying for objects via API or the dashboard. 


        Keys are strings with a maximum length of 64 characters. Values are
        strings

        with a maximum length of 512 characters.
      additionalProperties:
        type: string
      x-oaiTypeLabel: map
      nullable: true
    RealtimeResponse:
      type: object
      description: The response resource.
      properties:
        id:
          type: string
          description: The unique ID of the response.
        object:
          type: string
          enum:
            - realtime.response
          description: The object type, must be `realtime.response`.
          x-stainless-const: true
        status:
          type: string
          enum:
            - completed
            - cancelled
            - failed
            - incomplete
          description: >
            The final status of the response (`completed`, `cancelled`,
            `failed`, or 

            `incomplete`).
        status_details:
          type: object
          description: Additional details about the status.
          properties:
            type:
              type: string
              enum:
                - completed
                - cancelled
                - failed
                - incomplete
              description: >
                The type of error that caused the response to fail,
                corresponding 

                with the `status` field (`completed`, `cancelled`,
                `incomplete`, 

                `failed`).
            reason:
              type: string
              enum:
                - turn_detected
                - client_cancelled
                - max_output_tokens
                - content_filter
              description: >
                The reason the Response did not complete. For a `cancelled`
                Response, 

                one of `turn_detected` (the server VAD detected a new start of
                speech) 

                or `client_cancelled` (the client sent a cancel event). For an 

                `incomplete` Response, one of `max_output_tokens` or
                `content_filter` 

                (the server-side safety filter activated and cut off the
                response).
            error:
              type: object
              description: |
                A description of the error that caused the response to fail, 
                populated when the `status` is `failed`.
              properties:
                type:
                  type: string
                  description: The type of error.
                code:
                  type: string
                  description: Error code, if any.
        output:
          type: array
          description: The list of output items generated by the response.
          items:
            $ref: "#/components/schemas/RealtimeConversationItem"
        metadata:
          $ref: "#/components/schemas/Metadata"
        usage:
          type: object
          description: >
            Usage statistics for the Response, this will correspond to billing.
            A 

            Realtime API session will maintain a conversation context and append
            new 

            Items to the Conversation, thus output from previous turns (text
            and 

            audio tokens) will become the input for later turns.
          properties:
            total_tokens:
              type: integer
              description: >
                The total number of tokens in the Response including input and
                output 

                text and audio tokens.
            input_tokens:
              type: integer
              description: >
                The number of input tokens used in the Response, including text
                and 

                audio tokens.
            output_tokens:
              type: integer
              description: >
                The number of output tokens sent in the Response, including text
                and 

                audio tokens.
            input_token_details:
              type: object
              description: Details about the input tokens used in the Response.
              properties:
                cached_tokens:
                  type: integer
                  description: The number of cached tokens used in the Response.
                text_tokens:
                  type: integer
                  description: The number of text tokens used in the Response.
                audio_tokens:
                  type: integer
                  description: The number of audio tokens used in the Response.
            output_token_details:
              type: object
              description: Details about the output tokens used in the Response.
              properties:
                text_tokens:
                  type: integer
                  description: The number of text tokens used in the Response.
                audio_tokens:
                  type: integer
                  description: The number of audio tokens used in the Response.
        conversation_id:
          description: >
            Which conversation the response is added to, determined by the
            `conversation`

            field in the `response.create` event. If `auto`, the response will
            be added to

            the default conversation and the value of `conversation_id` will be
            an id like

            `conv_1234`. If `none`, the response will not be added to any
            conversation and

            the value of `conversation_id` will be `null`. If responses are
            being triggered

            by server VAD, the response will be added to the default
            conversation, thus

            the `conversation_id` will be an id like `conv_1234`.
          type: string
        voice:
          type: string
          enum:
            - alloy
            - ash
            - ballad
            - coral
            - echo
            - sage
            - shimmer
            - verse
          description: >
            The voice the model used to respond.

            Current voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`
            `sage`, 

            `shimmer` and `verse`.
        modalities:
          type: array
          description: >
            The set of modalities the model used to respond. If there are
            multiple modalities,

            the model will pick one, for example if `modalities` is `["text",
            "audio"]`, the model

            could be responding in either text or audio.
          items:
            type: string
            enum:
              - text
              - audio
        output_audio_format:
          type: string
          enum:
            - pcm16
            - g711_ulaw
            - g711_alaw
          description: >
            The format of output audio. Options are `pcm16`, `g711_ulaw`, or
            `g711_alaw`.
        temperature:
          type: number
          description: >
            Sampling temperature for the model, limited to [0.6, 1.2]. Defaults
            to 0.8.
        max_output_tokens:
          oneOf:
            - type: integer
            - type: string
              enum:
                - inf
              x-stainless-const: true
          description: |
            Maximum number of output tokens for a single assistant response,
            inclusive of tool calls, that was used in this response.
```
