Embed
The <speechify-agent> web component is the shortest path from “I have an agent ID” to “my users are talking to it on my landing page”. One script tag, one element, no realtime plumbing to wire up.
That’s the whole integration for a public agent. Private agents use the same tag with a server-minted session token (see below).
Two modes
Public agent (direct embed)
Flip the Public toggle on the agent’s Embed tab in the console, add the domains you want the widget to work on to the origin allowlist, and paste the snippet into your page. The widget calls POST /v1/agents/{id}/sessions unauthenticated; the server verifies that Origin matches your allowlist before minting a session.
Use this for marketing sites, demo pages, and anywhere the agent conversation is the product itself.
Security
- Embed only works from origins you explicitly allowlist on the agent. An empty allowlist with the public toggle on means “any origin accepted” — intended for open demos; enable deliberately.
- No subdomain wildcards. Add each origin exactly (e.g.
https://app.example.com,https://www.example.com). - The session endpoint is per-IP rate-limited. Repeat abuse from one source is throttled without affecting legitimate users.
- The agent owner is always the billed principal regardless of who triggered the session.
Private agent (server-minted token)
Keep the agent private, mint a short-lived session token on your backend with your API key, and pass it to the widget. The API key never reaches the browser.
Python
TypeScript
cURL
Browser side:
Attributes
Events
The element emits CustomEvents you can listen for with addEventListener:
Programmatic API
For React/Vue/Svelte apps that don’t want the default button UI, import the ESM bundle and call startAgent directly:
Styling
The component uses Shadow DOM so your page’s CSS can’t leak in. Light theming is exposed through CSS custom properties on the host:
Need more control than that? Use the programmatic API and build your own UI on top of the returned AgentHandle.