Skip to main content
Choose Self-hosted when your Pipecat bot runs on your own servers. Egma sends the start request to a public HTTPS URL that you give it, with the auth headers you choose. Your starter creates a Daily room, starts the bot in it, and answers with the room’s address. The bot still needs the Egma SDK line and the EGMA_URL and EGMA_API_KEY settings. See Prepare the bot.

The start request

Egma sends one POST to your start URL for each simulation. It carries every stored auth header and Content-Type: application/json:
This is Pipecat’s own start request, so Pipecat’s development runner answers it as it is. Your starter must:
  1. Check the auth headers.
  2. Create a Daily room with dailyRoomProperties. The expiry ends the room two minutes after the simulation’s duration limit.
  3. Start your bot in that room with body as runner_args.body.
  4. Answer with a 2xx JSON object that holds dailyRoom, the room’s https://…daily.co/… URL. Add dailyToken when the room needs a token to join. Egma ignores every other field.

Example starter

This FastAPI starter checks a bearer secret, creates a private Daily room with your Daily API key, and runs bot() from your bot.py in the same process. A production starter usually starts each bot on its own worker instead.
Save it as starter.py beside bot.py, then run it behind your HTTPS reverse proxy:

Rules for the start URL

  • The URL must use HTTPS and a public host name. Egma refuses IP addresses, localhost, and addresses that resolve to private networks. These rules also apply to self-hosted Egma.
  • Egma does not follow redirects. A 3xx answer fails the simulation.
  • Each attempt has 30 seconds, and Egma reads at most 64 KiB of the answer.
  • HTTP 429 is retried within Egma’s 120-second wait, honoring Retry-After. Every other failure ends the simulation at once with its cause. See Troubleshooting.

Connect Egma to the starter

With the prompt from Agents → Connect an agent → Pipecat, your coding agent asks where the bot runs. Answer on my own servers and give it the start URL and the auth headers, such as {"Authorization": "Bearer …"}. From the CLI, set PIPECAT_START_URL to the full start URL and load EGMA_START_SECRET from your secret store. This command passes the headers through standard input:
You can also put the header object in EGMA_PIPECAT_START_HEADERS as JSON text instead of using standard input. Run the command again with --modality chat for a chat connection. Egma stores the headers sealed and shows only their names. Use the returned connection ID to start a run.