Skip to main content
Amazon Nova Sonic is Bedrock’s speech-to-speech realtime model. Through TrueFoundry it uses a dedicated HTTP/2 bidirectional EventStream endpoint under /live/{providerAccount}/bedrock/... — not the WebSocket Live / Realtime API used by Gemini, OpenAI, and Azure.

Prerequisites

  1. An AWS Bedrock model account on TrueFoundry.
  2. A model with type Realtime and Bedrock model id such as amazon.nova-2-sonic-v1:0 (or amazon.nova-2-5-sonic).
  3. IAM permission for bidirectional invoke on that model (see IAM below).
  4. Your TrueFoundry API key and the gateway streaming base URL.
Display name vs model id: TrueFoundry sanitizes : in Bedrock ids for the UI display name (for example amazon.nova-2-sonic-v1-0). The streaming URL and Bedrock SDK still use the real model id with the colon (amazon.nova-2-sonic-v1:0).
Streaming host: Self-hosted gateways often expose Nova Sonic on a dedicated TLS port (default 8443). Set GATEWAY_BASE to that HTTPS origin (for example https://gateway.example.com:8443). On managed TrueFoundry, use the Bedrock streaming base URL for your tenant.

Endpoint and auth

Set the Bedrock SDK endpoint_uri to {GATEWAY_BASE}/live/{providerAccount}/bedrock. The SDK appends /model/{modelId}/invoke-with-bidirectional-stream.
Legacy path /bedrock-stream/{providerAccount}/model/{modelId}/invoke-with-bidirectional-stream is still accepted during transition. Prefer the /live/{providerAccount}/bedrock/... form.
The gateway authenticates you with the TrueFoundry API key, then signs upstream Bedrock traffic with the provider account’s AWS credentials (SigV4 or Bedrock API key). Request/response bodies are AWS EventStream frames. Chunk payloads are JSON with a base64 bytes field; each frame’s :content-type must be application/json (not application/octet-stream), or Bedrock returns modelStreamErrorException.

Add the model

  1. Open your Bedrock model account → add a model.
  2. Set Model ID to the Bedrock id (for example amazon.nova-2-sonic-v1:0).
  3. Set Model type to Realtime.
  4. Save. Use the account name as {providerAccount} and the Bedrock model id as {modelId} in the path (URL-encode : as %3A if you build the URL by hand).

Code example (Python)

Requires Python 3.12+. Uses the experimental Bedrock Runtime SDK against the gateway streaming base. Authenticate with your TrueFoundry API key via AWS_BEARER_TOKEN_BEDROCK (same header shape as Bedrock API keys).
Python

Session shape (high level)

Nova Sonic expects an ordered EventStream of JSON events, including:
  1. sessionStart → promptStart
  2. Optional system TEXT (contentStart / textInput / contentEnd)
  3. User AUDIO (contentStart / audioInput chunks / contentEnd) — at least one audio content is required
  4. After the turn: promptEnd → sessionEnd
See Amazon Nova Sonic and InvokeModelWithBidirectionalStream for the full event schema.

IAM

Grant the Bedrock identity used by your provider account permission to invoke bidirectional streams, for example:
JSON
Adjust ARNs for the model ids and regions you use. See AWS Bedrock authentication for how TrueFoundry attaches credentials.

Limitations

  • Shares the /live/{account}/... URL prefix with other realtime providers, but uses HTTP/2 EventStream, not a WebSocket upgrade. Do not point OpenAI/Gemini Live SDKs at the Nova Sonic path.
  • Clients must speak AWS EventStream (HTTP/2). Ordinary REST/SSE clients and most Postman setups cannot drive a full duplex session; use the Bedrock Runtime SDK or an HTTP/2 EventStream client.
  • Tool calling for Nova Sonic follows Bedrock’s native schema, not the OpenAI Realtime tool-calling examples on the Live API pages.

References