---
title: "Create a new stream"
method: POST
path: "/agents/{agentId}/streams"
tags: ["Agents Streams"]
---

# Create a new stream

`POST /agents/{agentId}/streams`

Initiates the creation of a new WebRTC connection to a browser peer. The endpoint returns the necessary information to set up and manage the connection.

## Path parameters

- `agentId` string, required

## Request body

- InitVideoStreamRequest
  - `fluent` boolean — Whether to request a fluent stream.
  - `session_timeout` number, double — Maximum duration (in seconds) between messages before session times out. Can only be used with proper permissions
  - `stream_warmup` boolean — Whether to stream wamrup video on the connection. If set to true, will stream a warmup video when connection is established. At the end of the warmup video, a message containing "stream/ready" will be sent on the data channel.
  - `compatibility_mode` 'on' | 'off' | 'auto'

## Response `201`

Created stream

- InitStreamResponse
  - `session_id` string
  - `id` string, required — Id of the stream - should be returned as *path parameter* in all streaming request to the same stream
  - `jsep` OfferJsep, required
    - `type` 'offer', required — The session description object describes the initial proposal in an offer/answer exchange.
    - `sdp` string, required — Describe the media communication sessions to accept the session the is being negotiated
  - `ice_servers` IceServer[], required — ICE servers used to create a peer connection
    - `urls` union, required — URL of the server - can be multiple addresses
      - string[]
      - string
    - `username` string — Username for authentication
    - `credential` string — Credintials for secure connection to the server

## Other responses

- `401` — AuthorizationError

---

[API](https://skmtc.net/d-id/apis/realtime-endpoints.md) · [All operations](https://skmtc.net/d-id/apis/realtime-endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/d-id/realtime-endpoints/revisions/2f2425e1b6b6/schema)
