> ## Documentation Index
> Fetch the complete documentation index at: https://docs.veadk.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Harness with SSE

> Without general Harness overrides, stream agent events over SSE. `streaming` defaults to false; set it to true for incremental model output. Create a session under harness_agent first. MCP-only overrides preserve the normal streaming behavior

KeyAuth deployments support general `harness` overrides. This path waits for completion and returns a single SSE event; `streaming` does not enable incremental output. General overrides read only text from `new_message.parts`; `state_delta` and `invocation_id` are not applied on that path

Shared OAuth deployments support MCP-only overrides, not general model, tool, or instruction overrides. Failures can appear inside the SSE stream as `data: {"error":"..."}`, so HTTP 200 does not establish invocation success. Use `curl -N` for live output

Submit `app_name: "harness_agent"`, `user_id`, `session_id`, and `new_message`. Create a session first for standard calls or MCP-only overrides; `streaming: true` requests incremental model output

With general `harness` overrides on KeyAuth deployments, the service waits for completion and sends one SSE event. It reads only text from `new_message.parts` and does not apply `state_delta` or `invocation_id`. Top-level `max_llm_calls` applies only to this general-override path and takes precedence over `harness.max_llm_calls`

<Warning>
  Execution saves session events and can call models and tools. Retries can repeat external actions. Shared OAuth allows only MCP overrides; see the [service overview](/productions/api-reference/preview/en/harness-runtime/overview) for all restrictions
</Warning>

Each SSE message uses `data: <JSON>` followed by a blank line. Read until the stream closes with `curl -N`, handling text, state, or artifact events as well as `data: {"error":"..."}`. HTTP `200` does not establish execution success. A successful general-override event has this form:

```text theme={null}
data: {"content":{"parts":[{"text":"Hello"}]},"partial":false}

```


## OpenAPI

````yaml productions/api-reference/openapi/en/harness-runtime.json POST /run_sse
openapi: 3.1.0
info:
  title: Harness Runtime
  version: agentkit-cli 0.54.0 / SDK 0.8.0 / ADK 2.2.0
  description: >-
    Harness Runtime deployed by AgentKit CLI 0.54.0, verified with VeADK 1.0.8,
    AgentKit SDK 0.8.0, and Google ADK 2.2.0; scheduled tasks require separate
    enablement
servers:
  - url: http://localhost:8000
    description: Local server
security:
  - {}
  - RuntimeBearer: []
tags:
  - name: Service and applications
  - name: Sessions
  - name: Agent execution
  - name: Artifacts
  - name: Memory
  - name: Evaluation · development server
  - name: Debugging · development server
  - name: Compatibility endpoints
  - name: Harness cronjobs
paths:
  /run_sse:
    post:
      tags:
        - Agent execution
      summary: Run Harness with SSE
      description: >-
        Without general Harness overrides, stream agent events over SSE.
        `streaming` defaults to false; set it to true for incremental model
        output. Create a session under harness_agent first. MCP-only overrides
        preserve the normal streaming behavior


        KeyAuth deployments support general `harness` overrides. This path waits
        for completion and returns a single SSE event; `streaming` does not
        enable incremental output. General overrides read only text from
        `new_message.parts`; `state_delta` and `invocation_id` are not applied
        on that path


        Shared OAuth deployments support MCP-only overrides, not general model,
        tool, or instruction overrides. Failures can appear inside the SSE
        stream as `data: {"error":"..."}`, so HTTP 200 does not establish
        invocation success. Use `curl -N` for live output
      operationId: harnessRuntimeRunSse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HarnessRunSseRequest'
            examples:
              basic:
                summary: Basic invocation
                value:
                  app_name: harness_agent
                  user_id: user-001
                  session_id: session-001
                  new_message:
                    role: user
                    parts:
                      - text: Hello
                  streaming: true
              mcp:
                summary: Per-request MCP override
                value:
                  app_name: harness_agent
                  user_id: user-001
                  session_id: session-001
                  new_message:
                    role: user
                    parts:
                      - text: Hello
                  streaming: true
                  harness:
                    mcp_servers:
                      - protocol: streamable-http
                        endpoint: https://mcp.example.com/mcp
                        api_key: <mcp-service-token>
              general:
                summary: KeyAuth general overrides, one completion event
                value:
                  app_name: harness_agent
                  user_id: user-001
                  session_id: session-001
                  new_message:
                    role: user
                    parts:
                      - text: Hello
                  streaming: true
                  harness:
                    system_prompt: Answer concisely
                    tools: web_search
      responses:
        '200':
          description: Successful response
          content:
            text/event-stream:
              schema:
                type: string
              example: >+
                data:
                {"content":{"role":"model","parts":[{"text":"Hello"}]},"author":"harness_agent","invocationId":"invocation-001","id":"event-001","timestamp":1789603200}

        '400':
          description: >-
            Shared OAuth request combines MCP and other Harness overrides, or
            the request does not meet endpoint requirements
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      error:
                        type: string
                  - $ref: '#/components/schemas/ApiError'
        '404':
          description: Requested resource was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '411':
          description: 'Shared OAuth only: a valid Content-Length is required'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: CONTENT_LENGTH_REQUIRED
        '413':
          description: 'Shared OAuth only: request body exceeds 128 KiB'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: REQUEST_TOO_LARGE
        '422':
          description: Request validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |-
            curl -N 'http://localhost:8000/run_sse' \
              -H 'Content-Type: application/json' \
              -d '{"app_name": "harness_agent", "user_id": "user-001", "session_id": "session-001", "new_message": {"role": "user", "parts": [{"text": "Hello"}]}, "streaming": true}'
components:
  schemas:
    HarnessRunSseRequest:
      properties:
        app_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Appname
          description: >-
            Application name; explicitly provide harness_agent for standard
            calls. This endpoint does not use ADK_DEFAULT_APP_NAME as a fallback
        user_id:
          type: string
          title: Userid
          description: User ID
        session_id:
          type: string
          title: Sessionid
          description: Session ID
        new_message:
          anyOf:
            - $ref: '#/components/schemas/Content-Input'
            - type: 'null'
          description: >-
            Input message for this turn; it may be omitted when resuming an
            invocation supported by the application
        streaming:
          type: boolean
          title: Streaming
          default: false
          description: Request incremental model streaming; defaults to false
        state_delta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Statedelta
          description: Session state changes to apply
        function_call_event_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Functioncalleventid
          description: >-
            Accepted by the request model but not applied by /run_sse in the
            verified SDK
        invocation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Invocationid
          description: Invocation ID
        custom_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Custommetadata
          description: >-
            Accepted by the request model but not applied by /run_sse in the
            verified SDK
        harness:
          $ref: '#/components/schemas/HarnessOverrides'
          description: >-
            Per-request overrides; omitted fields inherit the deployed
            configuration; use the snake_case top-level fields shown on this
            page when supplying overrides
        max_llm_calls:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          description: >-
            Applies only with general Harness overrides on KeyAuth deployments.
            The top-level value takes precedence over harness.max_llm_calls,
            followed by deployment configuration. Standard calls and MCP-only
            overrides do not apply this field
      type: object
      required:
        - app_name
        - user_id
        - session_id
      title: HarnessRunSseRequest
    ApiError:
      type: object
      properties:
        detail:
          type: string
          description: Error details
      required:
        - detail
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
          description: Error details
      type: object
      title: HTTPValidationError
    Content-Input:
      properties:
        parts:
          anyOf:
            - items:
                $ref: '#/components/schemas/Part-Input'
              type: array
            - type: 'null'
          title: Parts
          description: Ordered message parts
        role:
          anyOf:
            - type: string
            - type: 'null'
          title: Role
          description: Message role, such as user or model
      additionalProperties: false
      type: object
      title: Content
    HarnessOverrides:
      properties:
        model_name:
          type: string
          title: Model Name
          default: ''
          description: Model name for this invocation
        tools:
          type: string
          title: Tools
          default: ''
          description: >-
            Comma-separated built-in tool names, appended with deduplication; an
            empty string does not clear existing tools and invalid names are
            skipped. See [Built-in
            tools](/productions/api-reference/preview/en/harness-runtime/tools)
            for all 13 names, their uses, and prerequisites in the default CLI
            0.54.0 deployment
        mcp_servers:
          items:
            $ref: '#/components/schemas/McpServerConfig'
          type: array
          title: Mcp Servers
          description: >-
            Remote MCP servers; omission inherits the deployment, a provided
            list replaces it, and an empty array disables remote MCP for this
            request
        skills:
          type: string
          title: Skills
          default: ''
          description: >-
            Comma-separated Skill Hub slugs, skill-space IDs, or space:skill
            references; appended for this request. An empty string does not
            clear deployed skills
        system_prompt:
          type: string
          title: System Prompt
          default: ''
          description: System prompt replacement; an empty string clears the instruction
        runtime:
          type: string
          enum:
            - adk
            - codex
          title: Runtime
          default: adk
          description: Execution backend for this invocation
        registry_space_id:
          type: string
          title: Registry Space Id
          default: ''
          description: Agent registry space ID
        registry_endpoint:
          type: string
          title: Registry Endpoint
          default: ''
          description: Agent registry endpoint
        registry_region:
          type: string
          title: Registry Region
          default: ''
          description: Agent registry region
        registry_top_k:
          type: integer
          minimum: 1
          title: Registry Top K
          default: 3
          description: >-
            Number of registry search results; defaults to 3 and must be at
            least 1
        max_llm_calls:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Max Llm Calls
          description: >-
            Model-call limit, at least 1; run_agent_request takes precedence
            over harness overrides, followed by the deployed configuration
      type: object
      title: HarnessOverrides
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
          description: Location of the invalid field
        msg:
          type: string
          title: Message
          description: Validation error message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    Part-Input:
      properties:
        mediaResolution:
          anyOf:
            - $ref: '#/components/schemas/PartMediaResolution'
            - type: 'null'
        codeExecutionResult:
          anyOf:
            - $ref: '#/components/schemas/CodeExecutionResult'
            - type: 'null'
          description: Code execution result
        executableCode:
          anyOf:
            - $ref: '#/components/schemas/ExecutableCode'
            - type: 'null'
          description: Executable code
        fileData:
          anyOf:
            - $ref: '#/components/schemas/FileData'
            - type: 'null'
          description: File content referenced by URI
        functionCall:
          anyOf:
            - $ref: '#/components/schemas/FunctionCall'
            - type: 'null'
          description: Function call requested by the model
        functionResponse:
          anyOf:
            - $ref: '#/components/schemas/FunctionResponse-Input'
            - type: 'null'
          description: Function execution result
        inlineData:
          anyOf:
            - $ref: '#/components/schemas/Blob'
            - type: 'null'
          description: Inline binary content with Base64-encoded data
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
          description: Text content
        thought:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Thought
          description: Whether this is thought content
        thoughtSignature:
          anyOf:
            - type: string
              contentEncoding: base64
              contentMediaType: application/octet-stream
            - type: 'null'
          title: Thoughtsignature
          description: Thought signature for subsequent requests
        videoMetadata:
          anyOf:
            - $ref: '#/components/schemas/VideoMetadata'
            - type: 'null'
          description: Video metadata
        toolCall:
          anyOf:
            - $ref: '#/components/schemas/ToolCall'
            - type: 'null'
        toolResponse:
          anyOf:
            - $ref: '#/components/schemas/ToolResponse'
            - type: 'null'
        partMetadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Partmetadata
      additionalProperties: false
      type: object
      title: Part
    McpServerConfig:
      properties:
        protocol:
          type: string
          enum:
            - streamable-http
            - sse
          title: Protocol
          default: streamable-http
          description: MCP transport; defaults to streamable-http and also supports sse
        endpoint:
          type: string
          title: Endpoint
          description: >-
            HTTP(S) endpoint without user information, a fragment, or control
            characters
        api_key:
          anyOf:
            - type: string
              format: password
              writeOnly: true
            - type: 'null'
          title: Api Key
          description: >-
            Optional Bearer credential for the MCP service; line breaks are
            forbidden. This is separate from Runtime access credentials
      additionalProperties: false
      type: object
      required:
        - endpoint
      title: McpServerConfig
    PartMediaResolution:
      properties:
        level:
          anyOf:
            - $ref: '#/components/schemas/PartMediaResolutionLevel'
            - type: 'null'
        numTokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Numtokens
      additionalProperties: false
      type: object
      title: PartMediaResolution
    CodeExecutionResult:
      properties:
        outcome:
          anyOf:
            - $ref: '#/components/schemas/Outcome'
            - type: 'null'
        output:
          anyOf:
            - type: string
            - type: 'null'
          title: Output
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Identifier
      additionalProperties: false
      type: object
      title: CodeExecutionResult
    ExecutableCode:
      properties:
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
        language:
          anyOf:
            - $ref: '#/components/schemas/Language'
            - type: 'null'
          description: Application definition language
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Identifier
      additionalProperties: false
      type: object
      title: ExecutableCode
    FileData:
      properties:
        displayName:
          anyOf:
            - type: string
            - type: 'null'
          title: Displayname
        fileUri:
          anyOf:
            - type: string
            - type: 'null'
          title: Fileuri
          description: File URI
        mimeType:
          anyOf:
            - type: string
            - type: 'null'
          title: Mimetype
          description: Content MIME type
      additionalProperties: false
      type: object
      title: FileData
    FunctionCall:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Identifier
        args:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Args
          description: Function arguments
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name
        partialArgs:
          anyOf:
            - items:
                $ref: '#/components/schemas/PartialArg'
              type: array
            - type: 'null'
          title: Partialargs
        willContinue:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Willcontinue
      additionalProperties: false
      type: object
      title: FunctionCall
    FunctionResponse-Input:
      properties:
        willContinue:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Willcontinue
        scheduling:
          anyOf:
            - $ref: '#/components/schemas/FunctionResponseScheduling'
            - type: 'null'
        parts:
          anyOf:
            - items:
                $ref: '#/components/schemas/FunctionResponsePart'
              type: array
            - type: 'null'
          title: Parts
          description: Ordered message parts
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Identifier
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name
        response:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Response
          description: Response content
      additionalProperties: false
      type: object
      title: FunctionResponse
    Blob:
      properties:
        data:
          anyOf:
            - type: string
              contentEncoding: base64
              contentMediaType: application/octet-stream
            - type: 'null'
          title: Data
        displayName:
          anyOf:
            - type: string
            - type: 'null'
          title: Displayname
        mimeType:
          anyOf:
            - type: string
            - type: 'null'
          title: Mimetype
          description: Content MIME type
      additionalProperties: false
      type: object
      title: Blob
    VideoMetadata:
      properties:
        endOffset:
          anyOf:
            - type: string
            - type: 'null'
          title: Endoffset
        fps:
          anyOf:
            - type: number
            - type: 'null'
          title: Fps
        startOffset:
          anyOf:
            - type: string
            - type: 'null'
          title: Startoffset
      additionalProperties: false
      type: object
      title: VideoMetadata
    ToolCall:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Identifier
        toolType:
          anyOf:
            - $ref: '#/components/schemas/ToolType'
            - type: 'null'
        args:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Args
          description: Function arguments
      additionalProperties: false
      type: object
      title: ToolCall
    ToolResponse:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Identifier
        toolType:
          anyOf:
            - $ref: '#/components/schemas/ToolType'
            - type: 'null'
        response:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Response
          description: Response content
      additionalProperties: false
      type: object
      title: ToolResponse
    PartMediaResolutionLevel:
      type: string
      enum:
        - MEDIA_RESOLUTION_UNSPECIFIED
        - MEDIA_RESOLUTION_LOW
        - MEDIA_RESOLUTION_MEDIUM
        - MEDIA_RESOLUTION_HIGH
        - MEDIA_RESOLUTION_ULTRA_HIGH
      title: PartMediaResolutionLevel
    Outcome:
      type: string
      enum:
        - OUTCOME_UNSPECIFIED
        - OUTCOME_OK
        - OUTCOME_FAILED
        - OUTCOME_DEADLINE_EXCEEDED
      title: Outcome
    Language:
      type: string
      enum:
        - LANGUAGE_UNSPECIFIED
        - PYTHON
      title: Language
    PartialArg:
      properties:
        boolValue:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Boolvalue
        jsonPath:
          anyOf:
            - type: string
            - type: 'null'
          title: Jsonpath
        nullValue:
          anyOf:
            - type: string
              const: NULL_VALUE
            - type: 'null'
          title: Nullvalue
        numberValue:
          anyOf:
            - type: number
            - type: 'null'
          title: Numbervalue
        stringValue:
          anyOf:
            - type: string
            - type: 'null'
          title: Stringvalue
        willContinue:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Willcontinue
      additionalProperties: false
      type: object
      title: PartialArg
    FunctionResponseScheduling:
      type: string
      enum:
        - SCHEDULING_UNSPECIFIED
        - SILENT
        - WHEN_IDLE
        - INTERRUPT
      title: FunctionResponseScheduling
    FunctionResponsePart:
      properties:
        inlineData:
          anyOf:
            - $ref: '#/components/schemas/FunctionResponseBlob'
            - type: 'null'
          description: Inline binary content with Base64-encoded data
        fileData:
          anyOf:
            - $ref: '#/components/schemas/FunctionResponseFileData'
            - type: 'null'
          description: File content referenced by URI
      additionalProperties: false
      type: object
      title: FunctionResponsePart
    ToolType:
      type: string
      enum:
        - TOOL_TYPE_UNSPECIFIED
        - GOOGLE_SEARCH_WEB
        - GOOGLE_SEARCH_IMAGE
        - URL_CONTEXT
        - GOOGLE_MAPS
        - FILE_SEARCH
      title: ToolType
    FunctionResponseBlob:
      properties:
        mimeType:
          anyOf:
            - type: string
            - type: 'null'
          title: Mimetype
          description: Content MIME type
        data:
          anyOf:
            - type: string
              contentEncoding: base64
              contentMediaType: application/octet-stream
            - type: 'null'
          title: Data
        displayName:
          anyOf:
            - type: string
            - type: 'null'
          title: Displayname
      additionalProperties: false
      type: object
      title: FunctionResponseBlob
    FunctionResponseFileData:
      properties:
        fileUri:
          anyOf:
            - type: string
            - type: 'null'
          title: Fileuri
          description: File URI
        mimeType:
          anyOf:
            - type: string
            - type: 'null'
          title: Mimetype
          description: Content MIME type
        displayName:
          anyOf:
            - type: string
            - type: 'null'
          title: Displayname
      additionalProperties: false
      type: object
      title: FunctionResponseFileData
  securitySchemes:
    RuntimeBearer:
      type: http
      scheme: bearer
      description: >-
        Optional locally without a gateway; cloud deployments use the Runtime
        API key or user-pool JWT required by that deployment, never the model
        API key

````