Skip to main content
Use Pipecat when you want an explicit Python pipeline where your application controls transports, processors, context, the LLM, tools, and turn policy. Add PyAI Hear and PyAI Speak as two services in that pipeline. If you want PyAI to operate the complete conversation loop, use Omni.
The pipecat-pyai package is maintained by PyAI. It does not replace your transport, LLM, context aggregator, or application processors.

What stays under your control

Pipecat still owns frame order and routing. You can place custom processors before, between, or after the PyAI services and keep the deployment model you already use.

Prerequisites

  • Python 3.11 or newer
  • A Pipecat application with a transport and LLM service
  • A PyAI key with hear:stream and speak:synthesize scopes
  • A voice id from GET https://api.pyai.com/v1/voices
A pyai_test_ sandbox key includes the required Hear and Speak scopes, starts working immediately, and does not require billing. Keep the key on the server that runs the Pipecat pipeline.

Install

Install the verified public release from PyPI:
Keep any Pipecat transport, VAD, and LLM extras your application already installs. Then set the PyAI key:

Add PyAI to the pipeline

Put Hear after the transport input and Speak before the transport output:
The names transport, user_aggregator, assistant_aggregator, and llm refer to the objects your Pipecat application already creates. Your VAD and turn configuration remain in effect.

Complete task shape

The transport remains responsible for joining the room or call and queuing the initial frames required by your application.

Configuration

Hear speech-to-text

The service opens the canonical PyAI Hear WebSocket, sends raw PCM audio frames, sends a commit when Pipecat VAD reports the end of speech, and emits InterimTranscriptionFrame plus finalized TranscriptionFrame objects. Hear streaming is English-only.

Speak text-to-speech

The service sends Pipecat text frames to Speak and yields raw mono TTSAudioRawFrame objects at the configured rate. Use a streaming-capable stock, cloned, or designed voice id available to the same PyAI organization.

Share a TTS HTTP session

For applications that already manage an aiohttp.ClientSession, pass it to the TTS service:
The TTS service will reuse that session and leave its lifecycle under your application’s control.

Run and verify

1

Start your Pipecat bot

Run the same transport and deployment command you use today.
2

Send a two-turn conversation

Speak one short request, wait for agent audio, then interrupt or ask a follow-up. This verifies transcript finalization, context flow, TTS, and interruption behavior.
3

Inspect pipeline metrics

Confirm the Pipecat task receives transcript frames and TTS usage metrics. Log the transport region, worker region, LLM, VAD settings, voice, and PyAI region with any latency result.
4

Exercise failure handling

Test an invalid key, missing scope, and exhausted concurrency so your pipeline presents a safe fallback instead of silently stopping.

Production notes

  • Keep your Pipecat worker, transport media server, and PyAI speech endpoints in nearby regions.
  • A running Hear service counts against the PyAI key’s realtime concurrency.
  • Hear and Speak meter against your PyAI account. Pipecat Cloud, transport, your LLM, and worker hosting remain separate.
  • Keep a bounded queue and timeout around custom processors so one integration cannot stall caller audio indefinitely.
  • Use Omni instead when you want PyAI to own turn-taking, reasoning, tools, caller continuity when an Agent profile has continuity enabled and a caller key is available, and optional managed telephony as one system.

Troubleshooting

Which path should I choose?

Choose Pipecat + PyAI for custom frame processors, transport flexibility, branching, and per-stage observability. Choose Omni when one managed speech-to-speech contract is more valuable than operating the pipeline.

Pipecat documentation

Review Pipecat’s pipeline, transport, and deployment model.

PyAI Omni overview

Compare the managed speech-to-speech path.