{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-openai/json-schema/microsoft-azure-openai-open-ai-realtime-session-create-response-schema.json",
  "title": "Realtime session configuration object",
  "description": "A Realtime session configuration object.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-openai-v1-openapi.yml#/components/schemas/OpenAI.RealtimeSessionCreateResponse",
  "type": "object",
  "required": [
    "type"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the session that looks like `sess_1234567890abcdef`."
    },
    "object": {
      "type": "string",
      "description": "The object type. Always `realtime.session`."
    },
    "expires_at": {
      "type": "integer",
      "format": "unixtime",
      "description": "Expiration timestamp for the session, in seconds since epoch."
    },
    "include": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "item.input_audio_transcription.logprobs"
        ]
      },
      "description": "Additional fields to include in server outputs.\n  - `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription."
    },
    "model": {
      "type": "string",
      "description": "The Realtime model used for this session."
    },
    "output_modalities": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "text",
          "audio"
        ]
      },
      "description": "The set of modalities the model can respond with. To disable audio,\n  set this to [\"text\"]."
    },
    "instructions": {
      "type": "string",
      "description": "The default system instructions (i.e. system message) prepended to model\n  calls. This field allows the client to guide the model on desired\n  responses. The model can be instructed on response content and format,\n  (e.g. \"be extremely succinct\", \"act friendly\", \"here are examples of good\n  responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion\n  into your voice\", \"laugh frequently\"). The instructions are not guaranteed\n  to be followed by the model, but they provide guidance to the model on the\n  desired behavior.\n  Note that the server sets default instructions which will be used if this\n  field is not set and are visible in the `session.created` event at the\n  start of the session."
    },
    "audio": {
      "allOf": [
        {
          "$ref": "#/$defs/OpenAI.RealtimeSessionCreateResponseAudio"
        }
      ],
      "description": "Configuration for input and output audio for the session."
    },
    "tracing": {
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "auto"
          ]
        },
        {
          "type": "object",
          "properties": {
            "workflow_name": {
              "type": "string"
            },
            "group_id": {
              "type": "string"
            },
            "metadata": {
              "type": "object",
              "unevaluatedProperties": {}
            }
          }
        }
      ],
      "description": "Configuration options for tracing. Set to null to disable tracing. Once\n  tracing is enabled for a session, the configuration cannot be modified.\n  `auto` will create a trace for the session with default values for the\n  workflow name, group id, and metadata.",
      "title": "Tracing Configuration",
      "default": "auto"
    },
    "turn_detection": {
      "allOf": [
        {
          "$ref": "#/$defs/OpenAI.RealtimeSessionCreateResponseTurnDetection"
        }
      ],
      "description": "Configuration for turn detection. Can be set to `null` to turn off. Server\n  VAD means that the model will detect the start and end of speech based on\n  audio volume and respond at the end of user speech."
    },
    "tools": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OpenAI.RealtimeFunctionTool"
      },
      "description": "Tools (functions) available to the model."
    },
    "tool_choice": {
      "type": "string",
      "description": "How the model chooses tools. Options are `auto`, `none`, `required`, or\n  specify a function."
    },
    "max_output_tokens": {
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string",
          "enum": [
            "inf"
          ]
        }
      ],
      "description": "Maximum number of output tokens for a single assistant response,\n  inclusive of tool calls. Provide an integer between 1 and 4096 to\n  limit output tokens, or `inf` for the maximum available tokens for a\n  given model. Defaults to `inf`."
    },
    "type": {
      "type": "string",
      "enum": [
        "realtime"
      ]
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/OpenAI.RealtimeSessionCreateResponseUnion"
    }
  ],
  "x-oaiMeta": {
    "name": "The session object",
    "group": "realtime"
  },
  "$defs": {
    "OpenAI.AudioTranscriptionResponse": {
      "type": "object",
      "properties": {
        "model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "string",
              "enum": [
                "whisper-1",
                "gpt-4o-mini-transcribe",
                "gpt-4o-mini-transcribe-2025-12-15",
                "gpt-4o-transcribe",
                "gpt-4o-transcribe-diarize",
                "gpt-realtime-whisper"
              ]
            }
          ],
          "description": "The model used for transcription. Current options are `whisper-1`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`."
        },
        "language": {
          "type": "string",
          "description": "The language of the input audio."
        },
        "prompt": {
          "type": "string",
          "description": "The prompt configured for input audio transcription, when present."
        }
      }
    },
    "OpenAI.NoiseReductionType": {
      "type": "string",
      "enum": [
        "near_field",
        "far_field"
      ],
      "description": "Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones."
    },
    "OpenAI.RealtimeAudioFormats": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "$ref": "#/$defs/OpenAI.RealtimeAudioFormatsType"
        }
      }
    },
    "OpenAI.RealtimeAudioFormatsType": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "string",
          "enum": [
            "audio/pcm",
            "audio/pcmu",
            "audio/pcma"
          ]
        }
      ]
    },
    "OpenAI.RealtimeFunctionTool": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "function"
          ],
          "description": "The type of the tool, i.e. `function`.",
          "x-stainless-const": true
        },
        "name": {
          "type": "string",
          "description": "The name of the function."
        },
        "description": {
          "type": "string",
          "description": "The description of the function, including guidance on when and how\n  to call it, and guidance about what to tell the user when calling\n  (if anything)."
        },
        "parameters": {
          "allOf": [
            {
              "$ref": "#/$defs/OpenAI.RealtimeFunctionToolParameters"
            }
          ],
          "description": "Parameters of the function in JSON Schema."
        }
      },
      "title": "Function tool"
    },
    "OpenAI.RealtimeFunctionToolParameters": {
      "type": "object"
    },
    "OpenAI.RealtimeSessionCreateResponseAudio": {
      "type": "object",
      "properties": {
        "input": {
          "$ref": "#/$defs/OpenAI.RealtimeSessionCreateResponseAudioInput"
        },
        "output": {
          "$ref": "#/$defs/OpenAI.RealtimeSessionCreateResponseAudioOutput"
        }
      }
    },
    "OpenAI.RealtimeSessionCreateResponseAudioInput": {
      "type": "object",
      "properties": {
        "format": {
          "$ref": "#/$defs/OpenAI.RealtimeAudioFormats"
        },
        "transcription": {
          "$ref": "#/$defs/OpenAI.AudioTranscriptionResponse"
        },
        "noise_reduction": {
          "$ref": "#/$defs/OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction"
        },
        "turn_detection": {
          "$ref": "#/$defs/OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection"
        }
      }
    },
    "OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/$defs/OpenAI.NoiseReductionType"
        }
      }
    },
    "OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "threshold": {
          "type": "number"
        },
        "prefix_padding_ms": {
          "type": "integer"
        },
        "silence_duration_ms": {
          "type": "integer"
        }
      }
    },
    "OpenAI.RealtimeSessionCreateResponseAudioOutput": {
      "type": "object",
      "properties": {
        "format": {
          "$ref": "#/$defs/OpenAI.RealtimeAudioFormats"
        },
        "voice": {
          "$ref": "#/$defs/OpenAI.VoiceIdsShared"
        },
        "speed": {
          "type": "number"
        }
      }
    },
    "OpenAI.RealtimeSessionCreateResponseTurnDetection": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "threshold": {
          "type": "number"
        },
        "prefix_padding_ms": {
          "type": "integer"
        },
        "silence_duration_ms": {
          "type": "integer"
        }
      }
    },
    "OpenAI.RealtimeSessionCreateResponseUnion": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "$ref": "#/$defs/OpenAI.RealtimeSessionCreateResponseUnionType"
        }
      }
    },
    "OpenAI.RealtimeSessionCreateResponseUnionType": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "string",
          "enum": [
            "realtime",
            "transcription"
          ]
        }
      ]
    },
    "OpenAI.VoiceIdsShared": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "string",
          "enum": [
            "alloy",
            "ash",
            "ballad",
            "coral",
            "echo",
            "sage",
            "shimmer",
            "verse",
            "marin",
            "cedar"
          ]
        }
      ]
    }
  }
}