Add your AgentHuman API key to your .env file, along with any STT, LLM, and TTS services you plan to use:
Step 2 — Set up your transport with video output
AgentHumanVideoService requires a transport with video_out_enabled=True. The transport dimensions are used to auto-select the avatar’s aspect ratio.
Step 3 — Add AgentHumanVideoService to your pipeline
Import AgentHumanVideoService and NewSessionRequest from pipecat.services.agenthuman, instantiate the service with your avatar ID and transport, and place it in the pipeline after TTS and before transport.output().
Step 4 — Run your bot
AgentHumanVideoService creates the AgentHuman session and connects to the internal LiveKit room automatically on pipeline start. You don’t need to manage room tokens or WebSocket connections manually.