Send a message to an AI Studio Agent and get a response, with optional streaming and multi-turn conversation support.
conversationId.
InvokeResponse containing the agent’s text response and the conversation ID for follow-up messages.
| Type | Fields | Description |
|---|---|---|
start | conversation_id | Agent started processing |
content | content | Text chunk from the agent |
tool_use | tool_name | Agent is using a tool |
end | - | Agent finished |
error | error | Error occurred |
conversationId from a previous response. The agent retains full context from all prior turns in the conversation.
| Code | Error Type | Description |
|---|---|---|
400 | BAD_REQUEST | Invalid request body or missing message field |
401 | UNAUTHORIZED | Invalid or expired JWT token |
403 | AGENT_NOT_ENABLED | Agent exists but is not enabled for API access |
404 | AGENT_NOT_FOUND | No agent found with the given name |
429 | RATE_LIMITED | Too many requests. Retry after the duration in the Retry-After header |
500 | AGENT_EXECUTION_ERROR | Agent encountered an internal error during execution |