Prerequisites
- LiteLLM Agent Platform deployed at a public HTTPS URL
- A LAP agent with a working runtime and model
- A Google Cloud project with the Google Chat API enabled
- Permission to create or edit a Google Chat app
- A service account JSON key for sending Google Chat replies
1. Open the agent Google Chat flow
In the LAP UI, open Agents, choose an agent, then click Add to Google Chat. The flow shows the agent-specific event endpoint:2. Configure the Google Chat app
In Google Cloud Console, open the Google Chat API configuration for your project and create or edit a Chat app. Set the app endpoint to the LAP event endpoint:3. Save LAP credentials
Paste these values into the LAP Google Chat flow:- App name
- Service account JSON key
chat.bot OAuth scope and create or update Google Chat replies.
The saved agent config looks like this:
4. Install and test the app
Start a direct message with the Google Chat app:Message behavior
- Direct messages create or reuse a session for that DM space.
- Mentions in a space create or reuse a session for that thread.
- Replies inside an existing thread continue the session for that thread.
- Unmentioned space messages do not start a new session.
- Non-message events, such as card clicks, are ignored by the agent runner.
Manual API setup
The UI handles this setup automatically. If you need to configure an agent through the API, store the service account JSON in the personal vault first:Troubleshooting
- No callback reaches LAP: Confirm the Google Chat app URL uses the public HTTPS LAP URL and ends with
/api/agents/<agent-id>/google-chat/events. - Unauthorized callback: Confirm the auth audience saved in LAP matches the app URL exactly.
- Bot cannot reply: Confirm the service account JSON is valid and belongs to the Google Cloud project that owns the Chat app.
- Bot replies with an agent error: Confirm the agent runtime and model provider credentials work from the LAP UI before testing Google Chat.
Routing to different agents
Create a separate Google Chat app for each LAP agent you want to expose. Each app points to its own/api/agents/<agent-id>/google-chat/events endpoint.