---
title: "Run Agent Sse"
method: POST
path: "/run_sse"
---

# Run Agent Sse

`POST /run_sse`

## Request body

- RunAgentRequest
  - `appName` string, nullable
  - `userId` string, required
  - `sessionId` string, required
  - `newMessage` Content — Contains the multi-part content of a message.
    - `parts` Part[], nullable — List of parts that constitute a single message. Each part may have a different IANA MIME type.
      - `mediaResolution` PartMediaResolution — Media resolution for the input media.
        - `level` 'MEDIA_RESOLUTION_UNSPECIFIED' | 'MEDIA_RESOLUTION_LOW' | 'MEDIA_RESOLUTION_MEDIUM' | 'MEDIA_RESOLUTION_HIGH' | 'MEDIA_RESOLUTION_ULTRA_HIGH' — The tokenization quality used for given media.
        - `numTokens` integer, nullable — Specifies the required sequence length for media tokenization.
      - `codeExecutionResult` CodeExecutionResult — Result of executing the ExecutableCode. Generated only when the `CodeExecution` tool is used.
        - `outcome` 'OUTCOME_UNSPECIFIED' | 'OUTCOME_OK' | 'OUTCOME_FAILED' | 'OUTCOME_DEADLINE_EXCEEDED' — Outcome of the code execution.
        - `output` string, nullable — Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
        - `id` string, nullable — Optional. The identifier of the `ExecutableCode` part this result is for. Only populated if the corresponding `ExecutableCode` has an id. This field is not supported in Vertex AI.
      - `executableCode` ExecutableCode — Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding CodeExecutionResult will also be generated.
        - `code` string, nullable — Required. The code to be executed.
        - `language` 'LANGUAGE_UNSPECIFIED' | 'PYTHON' — Programming language of the `code`.
        - `id` string, nullable — Optional. Unique identifier of the `ExecutableCode` part. The server returns the `CodeExecutionResult` with the matching `id`. This field is not supported in Vertex AI.
      - `fileData` FileData — URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage.
        - `displayName` string, nullable — Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.
        - `fileUri` string, nullable — Required. The URI of the file in Google Cloud Storage.
        - `mimeType` string, nullable — Required. The IANA standard MIME type of the source data.
      - `functionCall` FunctionCall — A predicted FunctionCall returned from the model that contains a string representing the FunctionDeclaration.name and a structured JSON object containing the parameters and their values.
        - `id` string, nullable — Optional. The unique id of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`.
        - `args` object, nullable — Optional. The function parameters and values in JSON object format. See FunctionDeclaration.parameters for parameter details.
        - `name` string, nullable — Optional. The name of the function to call. Matches FunctionDeclaration.name.
        - `partialArgs` PartialArg[], nullable — Optional. The partial argument value of the function call. If provided, represents the arguments/fields that are streamed incrementally. This field is not supported in Gemini API.
          - `boolValue` boolean, nullable — Optional. Represents a boolean value.
          - `jsonPath` string, nullable — Required. A JSON Path (RFC 9535) to the argument being streamed. https://datatracker.ietf.org/doc/html/rfc9535. e.g. "$.foo.bar[0].data".
          - `nullValue` 'NULL_VALUE', nullable — Optional. Represents a null value.
          - `numberValue` number, nullable — Optional. Represents a double value.
          - `stringValue` string, nullable — Optional. Represents a string value.
          - `willContinue` boolean, nullable — Optional. Whether this is not the last part of the same json_path. If true, another PartialArg message for the current json_path is expected to follow.
        - `willContinue` boolean, nullable — Optional. Whether this is the last part of the FunctionCall. If true, another partial message for the current FunctionCall is expected to follow. This field is not supported in Gemini API.
      - `functionResponse` FunctionResponse — The result output from a FunctionCall that contains a string representing the FunctionDeclaration.name and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a `FunctionCall` made based on model prediction.
        - `willContinue` boolean, nullable — Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`. This field is not supported in Vertex AI.
        - `scheduling` 'SCHEDULING_UNSPECIFIED' | 'SILENT' | 'WHEN_IDLE' | 'INTERRUPT' — Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.
        - `parts` FunctionResponsePart[], nullable — Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
          - `inlineData` FunctionResponseBlob — Raw media bytes for function response. Text should not be sent as raw bytes, use the 'text' field.
            - `mimeType` string, nullable — Required. The IANA standard MIME type of the source data.
            - `data` string, binary, nullable — Required. Raw bytes.
            - `displayName` string, nullable — Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. This field is not supported in Gemini API.
          - `fileData` FunctionResponseFileData — URI based data for function response. This data type is not supported in Gemini API.
            - `fileUri` string, nullable — Required. URI.
            - `mimeType` string, nullable — Required. The IANA standard MIME type of the source data.
            - `displayName` string, nullable — Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
        - `id` string, nullable — Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.
        - `name` string, nullable — Required. The name of the function to call. Matches FunctionDeclaration.name and FunctionCall.name.
        - `response` object, nullable — Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
      - `inlineData` Blob — A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video.
        - `data` string, binary, nullable — Required. The raw bytes of the data.
        - `displayName` string, nullable — Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled. This field is not supported in Gemini API.
        - `mimeType` string, nullable — Required. The IANA standard MIME type of the source data.
      - `text` string, nullable — Optional. The text content of the part. When sent from the VSCode Gemini Code Assist extension, references to @mentioned items will be converted to markdown boldface text. For example `@my-repo` will be converted to and sent as `**my-repo**` by the IDE agent.
      - `thought` boolean, nullable — Optional. Indicates whether the `part` represents the model's thought process or reasoning.
      - `thoughtSignature` string, binary, nullable — Optional. An opaque signature for the thought so it can be reused in subsequent requests.
      - `videoMetadata` VideoMetadata — Provides metadata for a video, including the start and end offsets for clipping and the frame rate.
        - `endOffset` string, nullable — Optional. The end offset of the video.
        - `fps` number, nullable — Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
        - `startOffset` string, nullable — Optional. The start offset of the video.
      - `toolCall` ToolCall — A predicted server-side `ToolCall` returned from the model. This message contains information about a tool that the model wants to invoke. The client is NOT expected to execute this `ToolCall`. Instead, the client should pass this `ToolCall` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolResponse`.
        - `id` string, nullable — Unique identifier of the tool call. The server returns the tool response with the matching `id`.
        - `toolType` 'TOOL_TYPE_UNSPECIFIED' | 'GOOGLE_SEARCH_WEB' | 'GOOGLE_SEARCH_IMAGE' | 'URL_CONTEXT' | 'GOOGLE_MAPS' | 'FILE_SEARCH' — The type of tool in the function call.
        - `args` object, nullable — The tool call arguments. Example: {"arg1": "value1", "arg2": "value2"}.
      - `toolResponse` ToolResponse — The output from a server-side `ToolCall` execution. This message contains the results of a tool invocation that was initiated by a `ToolCall` from the model. The client should pass this `ToolResponse` back to the API in a subsequent turn within a `Content` message, along with the corresponding `ToolCall`.
        - `id` string, nullable — The identifier of the tool call this response is for.
        - `toolType` 'TOOL_TYPE_UNSPECIFIED' | 'GOOGLE_SEARCH_WEB' | 'GOOGLE_SEARCH_IMAGE' | 'URL_CONTEXT' | 'GOOGLE_MAPS' | 'FILE_SEARCH' — The type of tool in the function call.
        - `response` object, nullable — The tool response.
      - `partMetadata` object, nullable — Custom metadata associated with the Part. Agents using genai.Part as content representation may need to keep track of the additional information. For example it can be name of a file/source from which the Part originates or a way to multiplex multiple Part streams. This field is not supported in Vertex AI.
      - `audioTranscription` Transcription — Audio transcription in Server Content.
        - `text` string, nullable — Optional. Transcription text.
        - `finished` boolean, nullable — Optional. The bool indicates the end of the transcription.
        - `languageCode` string, nullable — The BCP-47 language code of the transcription.
        - `speakerLabel` string, nullable — A label identifying the speaker of this audio segment (e.g. "spk_1", "spk_2").
        - `words` WordInfo[], nullable — Detailed word-level transcriptions and timing details.
          - `word` string, nullable — Transcript of the word.
          - `startOffset` string, nullable — Start offset in time of the word relative to the start of the audio.
          - `endOffset` string, nullable — End offset in time of the word relative to the start of the audio.
    - `role` string, nullable — Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the service will default to 'user'.
  - `streaming` boolean
  - `stateDelta` object, nullable
  - `functionCallEventId` string, nullable
  - `invocationId` string, nullable
  - `customMetadata` object, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

## Changes

- **2026-07-31** `05dc9d47fcf0` — 1 info
  - added the new optional request property `newMessage/anyOf[subschema #1: Content]/parts/anyOf[subschema #1]/items/audioTranscription`
- **2026-07-01** `b1a6765e8252` — 1 info
  - added the new optional request property `customMetadata`
- **2026-05-20** `dc6d59bbb970` — 2 info
  - the request property `appName` became optional
  - request property `appName` list-of-types was widened by adding types `null` to media type `application/json`
- **2026-04-17** `70b3151fd168` — 1 breaking, 1 info
  - removed `#/components/schemas/Content-Input` from the `newMessage` request property `anyOf` list
  - added `#/components/schemas/Content` to the `newMessage` request property `anyOf` list
- **2026-04-09** `f158b902cb96` — 1 info
  - added the new optional request property `newMessage/anyOf[subschema #1: Content]/parts/anyOf[subschema #1]/items/partMetadata`

[Full history](https://skmtc.dev/google/apis/adk-rest-api-reference/changes/run_sse/post.md)

---

[API](https://skmtc.dev/google/apis/adk-rest-api-reference.md) · [All operations](https://skmtc.dev/google/apis/adk-rest-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/adk-rest-api-reference/revisions/05dc9d47fcf0/schema)
