TwinToneAPI Docs

Get started

Quickstart

Get your first AI-hosted live stream running in under 5 minutes.

Base URL: https://live.twintone.ai/api/v1

API access requires the Growth plan or above (live keys). API streams draw on the same plan minutes as dashboard streams — there is no separate API bill. Test keys are free. See API pricing.

All examples use placeholders. Replace "Radiance Serum" with your product name, "avt_9ww075quzedr" with a creator id from GET /api/v1/creators, and *** with your actual API key.


1. Create an API key

Dashboard → sidebar DEVELOPERS → API Keys → + Create new key.

  • Pick a name you'll recognize later (e.g. production-backend).
  • Pick the environment:
    • Live (tt_live_…) — dispatches real streams against your plan minutes.
    • Test (tt_test_…) — simulates the full lifecycle, no agent dispatch, consumes no minutes.
  • Choose scopes (least privilege — you can create separate keys for separate jobs).

The full key is shown once. Copy it somewhere safe — we store only a hash, so it can never be recovered. If you lose it, revoke it and create a new one.

2. Make your first call

curl -X POST https://live.twintone.ai/api/v1/streams \ -H "Authorization: Bearer ***" \ -H "Content-Type: application/json" \ -d '{ "creator_id": "avt_9ww075quzedr", "product_name": "Radiance Serum", "platform": "youtube", "duration_minutes": 30, "script": "Welcome in! Today we are talking about the Radiance Serum..." }'

Python (requests)

import requests resp = requests.post( "https://live.twintone.ai/api/v1/streams", headers={"Authorization": "Bearer ***"}, json={ "creator_id": "avt_9ww075quzedr", "product_name": "Radiance Serum", "platform": "youtube", "duration_minutes": 30, "script": "Welcome in! Today we are talking about the Radiance Serum...", }, ) print(resp.status_code) print(resp.json())

Node (fetch)

const resp = await fetch("https://live.twintone.ai/api/v1/streams", { method: "POST", headers: { Authorization: "Bearer ***", "Content-Type": "application/json", }, body: JSON.stringify({ creator_id: "avt_9ww075quzedr", product_name: "Radiance Serum", platform: "youtube", duration_minutes: 30, script: "Welcome in! Today we are talking about the Radiance Serum...", }), }); console.log(resp.status); console.log(await resp.json());

Response (201)

{ "stream_id": "a1b2c3d4-…", "status": "preparing", "room_name": "stream-a1b2c3d4", "ws_url": "wss://…", "viewer_token": "eyJ…", "created_at": "2026-08-07T10:00:00.000Z" }

With a test key the stream goes live immediately (no agent, no minutes consumed) so you can exercise the whole lifecycle — including DELETE — end to end. With a live key the response is status: "preparing" and the stream flips to live once the agent is running (poll or use a webhook).

3. Watch it go live

Poll status:

curl https://live.twintone.ai/api/v1/streams/a1b2c3d4-… \ -H "Authorization: Bearer ***"

Or register a webhook and we'll push stream.started / stream.ended events to your server — see Webhooks.

4. End the stream

curl -X DELETE https://live.twintone.ai/api/v1/streams/a1b2c3d4-… \ -H "Authorization: Bearer ***"

Next steps

Was this page helpful?