> ## 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.

# Compatibility invocation

> Return results over SSE. Use prompt from a JSON object when present; other JSON values are converted to text, while non-JSON bodies are treated as raw text. User and session IDs come from request headers, defaulting to agentkit_user and an empty string; explicitly provide both

The endpoint checks and creates the session automatically. The application is selected from the loaded agent, so no application name is needed in the body. It supports per-request `harness.mcp_servers` overrides but does not apply other Harness overrides. Errors after streaming starts are returned as error events

Use this endpoint for text-only compatibility clients. The body is typically `{"prompt":"Hello"}`; supply the user and session in the `user_id` and `session_id` headers, rather than body fields

Provide both headers explicitly to avoid grouping unrelated calls under default user or session identifiers. The service checks and creates the session, using the loaded agent application name

<Warning>
  Invocation saves the session and executes models and tools, which can incur charges or perform external actions. Resending the same message can repeat these actions
</Warning>

The response is SSE. Read continuously with `curl -N` and handle in-stream `error` messages. For structured ADK messages, use [Run Harness with SSE](/productions/api-reference/preview/en/harness-runtime/run-sse)


## OpenAPI

````yaml productions/api-reference/openapi/en/harness-runtime.json POST /invoke
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:
  /invoke:
    post:
      tags:
        - Harness invocation
      summary: Compatibility invocation
      description: >-
        Return results over SSE. Use prompt from a JSON object when present;
        other JSON values are converted to text, while non-JSON bodies are
        treated as raw text. User and session IDs come from request headers,
        defaulting to agentkit_user and an empty string; explicitly provide both


        The endpoint checks and creates the session automatically. The
        application is selected from the loaded agent, so no application name is
        needed in the body. It supports per-request `harness.mcp_servers`
        overrides but does not apply other Harness overrides. Errors after
        streaming starts are returned as error events
      operationId: harnessRuntimeInvokeCompatible
      parameters:
        - name: user_id
          in: header
          required: false
          schema:
            type: string
            default: agentkit_user
          example: user-001
        - name: session_id
          in: header
          required: false
          schema:
            type: string
            default: ''
          example: session-001
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    prompt:
                      type: string
                      description: User message for this invocation
                    harness:
                      $ref: '#/components/schemas/HarnessMcpOverrides'
                  additionalProperties: true
                - type: array
                  items: {}
                - type: string
                - type: number
                - type: boolean
                - type: 'null'
            examples:
              prompt:
                value:
                  prompt: Hello
              mcp:
                value:
                  prompt: Hello
                  harness:
                    mcp_servers:
                      - endpoint: https://mcp.example.com/mcp
          text/plain:
            schema:
              type: string
            example: Hello
      responses:
        '200':
          description: SSE event stream
          content:
            text/event-stream:
              schema:
                type: string
              example: >+
                data:
                {"content":{"parts":[{"text":"Hello"}]},"author":"harness_agent"}

        '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'
        '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
components:
  schemas:
    HarnessMcpOverrides:
      type: object
      properties:
        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
    ApiError:
      type: object
      properties:
        detail:
          type: string
          description: Error details
      required:
        - detail
    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
  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

````