Discussions

Ask a Question
Back to all

Help on integrating your Agent Streams API using my own backend/frontend

Hello,

Can you provide a sample or best-practices guide on integrating your Agent Streams API with a custom Python backend?
I’d like to understand the exact API calls and workflow needed to replicate your streaming agent demo, but routed through my own backend instead of calling your API directly from the frontend.

Specifically, I need to know:

The step-by-step sequence of API calls my backend should perform to establish a WebRTC stream, send user chat messages, handle ICE candidates, and forward media to the frontend.

Any required response parsing or mapping (for keys like streamId vs stream_id, etc) to avoid mismatches.

How to handle session/stream state on the backend, and if there are limitations on how long a stream can remain open.

I want to deliver an experience as seamless as your demo, but with backend control for business logic, security, and integration with my app.

Is there an official code sample (preferably Python) for this kind of backend integration?

Thank you—your solution is truly the best I’ve found for live video generation, and a backend sample would help a lot.

Best regards,

Vasilis