curl --request POST \
--url http://localhost:8000/invoke \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'"data: {\"content\":{\"parts\":[{\"text\":\"Hello\"}]},\"author\":\"harness_agent\"}\n\n"{
"error": "<string>"
}{
"error": "CONTENT_LENGTH_REQUIRED"
}{
"error": "REQUEST_TOO_LARGE"
}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
curl --request POST \
--url http://localhost:8000/invoke \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'"data: {\"content\":{\"parts\":[{\"text\":\"Hello\"}]},\"author\":\"harness_agent\"}\n\n"{
"error": "<string>"
}{
"error": "CONTENT_LENGTH_REQUIRED"
}{
"error": "REQUEST_TOO_LARGE"
}{"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
curl -N and handle in-stream error messages. For structured ADK messages, use Run Harness with SSEAuthorizations
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
Response
SSE event stream
The response is of type string.