curl -N -X POST 'http://localhost:8000/run_sse' \
-H 'Content-Type: application/json' \
-d '{"appName": "travel_assistant", "userId": "user-001", "sessionId": "session-001", "newMessage": {"role": "user", "parts": [{"text": "Plan a day in Beijing"}]}, "streaming": true}'import requests
url = "http://localhost:8000/run_sse"
payload = {
"userId": "user-001",
"sessionId": "session-001"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({userId: 'user-001', sessionId: '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\":\"travel_assistant\",\"invocationId\":\"invocation-001\",\"id\":\"event-001\",\"timestamp\":1789603200}\n\n"{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Run an agent with SSE
Return text/event-stream, with each message formatted as data: followed by a JSON event; streaming=true requests incremental model output
streaming defaults to false; complete events are still transported using SSE. Successful JSON events use the Event structure; errors after the stream starts are sent as data: {"error":"..."}. Use curl -N for live output; the interactive request panel may not display individual events as they arrive
Create the session first by default; --auto_create_session allows automatic creation. appName may be omitted when ADK_DEFAULT_APP_NAME is configured
curl -N -X POST 'http://localhost:8000/run_sse' \
-H 'Content-Type: application/json' \
-d '{"appName": "travel_assistant", "userId": "user-001", "sessionId": "session-001", "newMessage": {"role": "user", "parts": [{"text": "Plan a day in Beijing"}]}, "streaming": true}'import requests
url = "http://localhost:8000/run_sse"
payload = {
"userId": "user-001",
"sessionId": "session-001"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({userId: 'user-001', sessionId: '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\":\"travel_assistant\",\"invocationId\":\"invocation-001\",\"id\":\"event-001\",\"timestamp\":1789603200}\n\n"{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}streaming defaults to false, which still delivers complete events over SSE; set it to true to request incremental model output
data:, contains JSON, and ends with a blank line. Read continuously with curl -N. Events can contain only state or artifact changes rather than text; partial: true marks incremental content
data: {"content":{"role":"model","parts":[{"text":"Hello"}]},"partial":false,"author":"travel_assistant","invocationId":"invocation-001","id":"event-001","timestamp":1789603200}
data: {"error":"Example execution error"}
200 only indicates that the stream has started. Check for error in the stream and continue reading until it closes. The interactive request panel may not display events individuallyBody
User ID
Session ID
Application name; falls back to ADK_DEFAULT_APP_NAME when omitted and returns 400 if no default is configured
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
Event ID of the function call, used for streaming function-response handling
Invocation ID
Custom metadata
Response
Successful response
The response is of type string.