Skip to main content

Live Streaming API Reference

Live Streaming API Reference

Base URL: https://api.antcdn.net

Authentication: Authorization: Bearer <api-key>

All requests are automatically scoped to the environment associated with your API key.


Create Stream

/v1/live-streams

Creates a new live stream and returns the stream key. The stream key is only returned here and on key rotation — store it immediately.

Request body

FieldTypeDefaultDescription
namestringrequiredDisplay name for the stream
qualitystringstandardstandard (720p/480p/360p), high (1080p/720p/480p), passthrough (source resolution)
lowLatencybooleantrueEnable low-latency HLS
recordingbooleanfalseRecord the stream for later VOD playback

Response

{
"streamId": "ls_01jpp...",
"edgeId": "lse_01jpp...",
"name": "My Live Show",
"state": "idle",
"quality": "standard",
"recording": false,
"lowLatency": true,
"reconnectWindowSeconds": 60,
"createdAt": "2026-03-15T10:00:00Z",
"ingest": {
"rtmpUrl": "rtmp://ingest.antcdn.net/live",
"srtUrl": "srt://ingest.antcdn.net:9000",
"streamKey": "sk_...",
"rtmpFullUrl": "rtmp://ingest.antcdn.net/live/sk_...",
"srtFullUrl": "srt://ingest.antcdn.net:9000?streamid=#!::r=live/sk_...,m=publish"
},
"playback": {
"hlsUrl": "https://worker.antcdn.net/live/lse_01jpp.../master.m3u8",
"edgeId": "lse_01jpp..."
}
}

Important: ingest.streamKey, ingest.rtmpFullUrl, and ingest.srtFullUrl are only present in this response and on key rotation. Subsequent GET calls omit them.


List Streams

/v1/live-streams

Returns all streams for your environment.

Query parameters

ParamTypeDefaultDescription
limitinteger20Max results to return (max 100)
offsetinteger0Pagination offset

Response

{
"streams": [ { /* stream object, no streamKey */ } ],
"total": 3
}

Get Stream

/v1/live-streams/{streamId}

Returns the current state of a stream. Poll this endpoint to track state changes.

The stream key is not returned — only ingest.rtmpUrl and ingest.srtUrl (without key).


Rotate Stream Key

/v1/live-streams/{streamId}/rotate-key

Generates a new stream key and immediately invalidates the previous one. Any active encoder will be disconnected.

Returns the new key and full connection URLs — same one-time visibility as on creation.

Response

{
"streamKey": "sk_new...",
"rtmpFullUrl": "rtmp://ingest.antcdn.net/live/sk_new...",
"srtFullUrl": "srt://ingest.antcdn.net:9000?streamid=#!::r=live/sk_new...,m=publish"
}

Cannot rotate while a stream is live or connecting.


Delete Stream

/v1/live-streams/{streamId}

Permanently deletes the stream. Cannot delete while live or connecting.

Returns 204 No Content on success.


Stream Object Reference

FieldTypeDescription
streamIdstringStable resource ID
edgeIdstringPublic ID used in the playback URL
namestringDisplay name
statestringidle | connecting | live | ended | error
qualitystringstandard | high | passthrough
recordingbooleanWhether recording is enabled
lowLatencybooleanWhether low-latency HLS is enabled
reconnectWindowSecondsintegerHow long to hold a session open after encoder disconnect
createdAtstringISO 8601 timestamp
startedAtstring?When the stream last went live
endedAtstring?When the stream last ended
ingest.rtmpUrlstringRTMP server address (without key)
ingest.srtUrlstringSRT server address (without key)
playback.hlsUrlstringHLS master playlist URL for viewers