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}'import requests
url = "http://localhost:8000/run_sse"
payload = {
"app_name": "harness_agent",
"user_id": "user-001",
"session_id": "session-001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({app_name: 'harness_agent', user_id: 'user-001', session_id: 'session-001'})
};
fetch('http://localhost:8000/run_sse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));"data: {\"content\":{\"role\":\"model\",\"parts\":[{\"text\":\"Hello\"}]},\"author\":\"harness_agent\",\"invocationId\":\"invocation-001\",\"id\":\"event-001\",\"timestamp\":1789603200}\n\n"{
"error": "<string>"
}{
"detail": "<string>"
}{
"error": "CONTENT_LENGTH_REQUIRED"
}{
"error": "REQUEST_TOO_LARGE"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}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
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}'import requests
url = "http://localhost:8000/run_sse"
payload = {
"app_name": "harness_agent",
"user_id": "user-001",
"session_id": "session-001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({app_name: 'harness_agent', user_id: 'user-001', session_id: 'session-001'})
};
fetch('http://localhost:8000/run_sse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));"data: {\"content\":{\"role\":\"model\",\"parts\":[{\"text\":\"Hello\"}]},\"author\":\"harness_agent\",\"invocationId\":\"invocation-001\",\"id\":\"event-001\",\"timestamp\":1789603200}\n\n"{
"error": "<string>"
}{
"detail": "<string>"
}{
"error": "CONTENT_LENGTH_REQUIRED"
}{
"error": "REQUEST_TOO_LARGE"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}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
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:
data: {"content":{"parts":[{"text":"Hello"}]},"partial":false}
Authorizations
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
Body
Application name; explicitly provide harness_agent for standard calls. This endpoint does not use ADK_DEFAULT_APP_NAME as a fallback
User ID
Session ID
Input message for this turn; it may be omitted when resuming an invocation supported by the application
Show child attributes
Show child attributes
Request incremental model streaming; defaults to false
Session state changes to apply
Accepted by the request model but not applied by /run_sse in the verified SDK
Invocation ID
Accepted by the request model but not applied by /run_sse in the verified SDK
Per-request overrides; omitted fields inherit the deployed configuration; use the snake_case top-level fields shown on this page when supplying overrides
Show child attributes
Show child attributes
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
x >= 1Response
Successful response
The response is of type string.