---
title: "POST /v1/{+session}:streamRunSession"
method: POST
path: "/v1/{+session}:streamRunSession"
tags: ["projects"]
---

# POST /v1/{+session}:streamRunSession

`POST /v1/{+session}:streamRunSession`

Initiates a single-turn interaction with the CES agent. Uses server-side streaming to deliver incremental results and partial responses as they are generated. By default, complete responses (e.g., messages from callbacks or full LLM responses) are sent to the client as soon as they are available. To enable streaming individual text chunks directly from the model, set enable_text_streaming to true.

## Path parameters

- `session` string, required

## Request body

- RunSessionRequest — Request message for SessionService.RunSession.
  - `config` SessionConfig — The configuration for the session.
    - `useToolFakes` boolean — Optional. Whether to use tool fakes for the session. If this field is set, the agent will attempt use tool fakes instead of calling the real tools.
    - `remoteDialogflowQueryParameters` SessionConfigRemoteDialogflowQueryParameters — [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters) to send to the remote [Dialogflow](https://cloud.google.com/dialogflow/cx/docs/concept/console-conversational-agents) agent when the session control is transferred to the remote agent.
      - `payload` object — Optional. The payload to be sent in [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters).
      - `endUserMetadata` object — Optional. The end user metadata to be sent in [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters).
      - `webhookHeaders` object — Optional. The HTTP headers to be sent as webhook_headers in [QueryParameters](https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#queryparameters).
    - `outputAudioConfig` OutputAudioConfig — OutputAudioConfig configures how the CES agent should synthesize outgoing audio responses.
      - `audioEncoding` 'AUDIO_ENCODING_UNSPECIFIED' | 'LINEAR16' | 'MULAW' | 'ALAW' — Required. The encoding of the output audio data.
      - `sampleRateHertz` integer — Required. The sample rate (in Hertz) of the output audio data.
    - `timeZone` string — Optional. The time zone of the user. If provided, the agent will use the time zone for date and time related variables. Otherwise, the agent will use the time zone specified in the App.time_zone_settings. The format is the IANA Time Zone Database time zone, e.g. "America/Los_Angeles".
    - `enableTextStreaming` boolean — Optional. Whether to enable streaming text outputs from the model. By default, text outputs from the model are collected before sending to the client. NOTE: This is only supported for text (non-voice) sessions via StreamRunSession or BidiRunSession.
    - `entryAgent` string — Optional. The entry agent to handle the session. If not specified, the session will be handled by the root agent of the app. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
    - `deployment` string — Optional. The deployment of the app to use for the session. Format: `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}`
    - `inputAudioConfig` InputAudioConfig — InputAudioConfig configures how the CES agent should interpret the incoming audio data.
      - `audioEncoding` 'AUDIO_ENCODING_UNSPECIFIED' | 'LINEAR16' | 'MULAW' | 'ALAW' — Required. The encoding of the input audio data.
      - `sampleRateHertz` integer — Required. The sample rate (in Hertz) of the input audio data.
      - `noiseSuppressionLevel` string — Optional. Whether to enable noise suppression on the input audio. Available values are "low", "moderate", "high", "very_high".
    - `historicalContexts` Message[] — Optional. The historical context of the session, including user inputs, agent responses, and other messages. Typically, CES agent would manage session automatically so client doesn't need to explicitly populate this field. However, client can optionally override the historical contexts to force the session start from certain state.
      - `eventTime` string, google-datetime — Optional. Timestamp when the message was sent or received. Should not be used if the message is part of an example.
      - `chunks` Chunk[] — Optional. Content of the message as a series of chunks.
        - `agentTransfer` AgentTransfer — Represents an event indicating the transfer of a conversation to a different agent.
          - `targetAgent` string — Required. The agent to which the conversation is being transferred. The agent will handle the conversation from this point forward. Format: `projects/{project}/locations/{location}/apps/{app}/agents/{agent}`
          - `displayName` string — Output only. Display name of the agent.
        - `toolCall` ToolCall — Request for the client or the agent to execute the specified tool.
          - `tool` string — Optional. The name of the tool to execute. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
          - `displayName` string — Output only. Display name of the tool.
          - `args` object — Optional. The input parameters and values for the tool in JSON object format.
          - `toolsetTool` ToolsetTool — A tool that is created from a toolset.
            - `toolset` string — Required. The resource name of the Toolset from which this tool is derived. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
            - `toolId` string — Optional. The tool ID to filter the tools to retrieve the schema for.
          - `id` string — Optional. The unique identifier of the tool call. If populated, the client should return the execution result with the matching ID in ToolResponse.
        - `transcript` string — Optional. Transcript associated with the audio.
        - `text` string — Optional. Text data.
        - `payload` object — Optional. Custom payload data.
        - `toolResponse` ToolResponse — The execution result of a specific tool from the client or the agent.
          - `toolsetTool` ToolsetTool — A tool that is created from a toolset.
            - `toolset` string — Required. The resource name of the Toolset from which this tool is derived. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
            - `toolId` string — Optional. The tool ID to filter the tools to retrieve the schema for.
          - `id` string — Optional. The matching ID of the tool call the response is for.
          - `response` object — Required. The tool execution result in JSON object format. Use "output" key to specify tool response and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as tool execution result.
          - `displayName` string — Output only. Display name of the tool.
          - `tool` string — Optional. The name of the tool to execute. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
        - `image` Image — Represents an image input or output in the conversation.
          - `mimeType` string — Required. The IANA standard MIME type of the source data. Supported image types includes: * image/png * image/jpeg * image/webp
          - `data` string, byte — Required. Raw bytes of the image.
        - `updatedVariables` object — A struct represents variables that were updated in the conversation, keyed by variable names.
        - `defaultVariables` object — A struct represents default variables at the start of the conversation, keyed by variable names.
        - `blob` Blob — Represents a blob input or output in the conversation.
          - `mimeType` string — Required. The IANA standard MIME type of the source data.
          - `data` string, byte — Required. Raw bytes of the blob.
      - `role` string — Optional. The role within the conversation, e.g., user, agent.
  - `inputs` SessionInput[] — Required. Inputs for the session.
    - `dtmf` string — Optional. DTMF digits from the end user.
    - `audio` string, byte — Optional. Audio data from the end user.
    - `text` string — Optional. Text data from the end user.
    - `toolResponses` ToolResponses — Execution results for the requested tool calls from the client.
      - `toolResponses` ToolResponse[] — Optional. The list of tool execution results.
        - `toolsetTool` ToolsetTool — A tool that is created from a toolset.
          - `toolset` string — Required. The resource name of the Toolset from which this tool is derived. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
          - `toolId` string — Optional. The tool ID to filter the tools to retrieve the schema for.
        - `id` string — Optional. The matching ID of the tool call the response is for.
        - `response` object — Required. The tool execution result in JSON object format. Use "output" key to specify tool response and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as tool execution result.
        - `displayName` string — Output only. Display name of the tool.
        - `tool` string — Optional. The name of the tool to execute. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
    - `image` Image — Represents an image input or output in the conversation.
      - `mimeType` string — Required. The IANA standard MIME type of the source data. Supported image types includes: * image/png * image/jpeg * image/webp
      - `data` string, byte — Required. Raw bytes of the image.
    - `blob` Blob — Represents a blob input or output in the conversation.
      - `mimeType` string — Required. The IANA standard MIME type of the source data.
      - `data` string, byte — Required. Raw bytes of the blob.
    - `event` Event — Event input.
      - `event` string — Required. The name of the event.
    - `willContinue` boolean — Optional. A flag to indicate if the current message is a fragment of a larger input in the bidi streaming session. When set to `true`, the agent defers processing until it receives a subsequent message where `will_continue` is `false`, or until the system detects an endpoint in the audio input. NOTE: This field does not apply to audio and DTMF inputs, as they are always processed automatically based on the endpointing signal.
    - `variables` object — Optional. Contextual variables for the session, keyed by name. Only variables declared in the app will be used by the CES agent. Unrecognized variables will still be sent to the Dialogflow agent as additional session parameters.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/ces.md) · [All operations](https://skmtc.net/google/apis/ces/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/ces/versions/429598666166/schema)
