Skip to main content

APIs & SDKs overview

The nanocosmos platform exposes everything you can do in the nanoStream Dashboard through APIs, plus a JavaScript player and a browser broadcasting library. This page is the one place for base URLs and authentication. Start here, then jump to the reference for the API you need.

Which API do you need?​

API / SDKWhat you do with itBase URLReference
nanoStream REST APICreate and manage streams, tags, transcoding, organisation settings, webhookshttps://bintu.nanostream.cloudnanoStream REST API, full reference
nanoStream Real-Time APIStart and stop On-Demand Recording, switch Multi-Camera angles while a stream is livehttps://real-time-api.nanostream.cloudnanoStream Real-Time API
Analytics API (v2)Read viewer, playback, ingest, usage and alert metricshttps://metrics-api.nanostream.cloudAnalytics API
Cloud Token ServiceMint expiring access tokens from your API keyhttps://token.nanostream.cloudAccess tokens below, full reference
nanoStream PlayerPlay streams in the browser (JavaScript)https://demo.nanocosmos.de/nanoplayer/api/release/nanoplayer.5.min.jsnanoStream Player
nanoStream WebcasterBroadcast from the browser—nanoStream Webcaster
AI Live Captions APIControl live captions and translations—AI Live Captions API
nanoStudio Chroma APIAutomate chroma keying and branded outputs—nanoStudio Chroma API

The nanoStream REST API is also called the bintu API. Hostnames, headers and config keys keep the bintu name (bintu.nanostream.cloud, X-BINTU-APIKEY, source.group.apiurl), so you see both names in code.

The primary API host is https://bintu.nanostream.cloud. The former host https://bintu.nanocosmos.de still works and serves the same API, so existing integrations don't need to change; the nanoStream Player also still uses it as its default apiurl.

All APIs operate on the same data. A stream you create with the REST API shows up in the Dashboard at once, and changes you make in the Dashboard are visible through the API.

note

Viewers never authenticate against an API. Playback is either open, or, on organisations with secure playback, gated by a playback token (JWT) that you put into the player config. API credentials are only for managing streams and reading metrics. See Playback tokens.

Credentials at a glance​

CredentialLifetimeScopeHeaderUse it for
Organisation API keyNever expiresFull control of the organisationX-BINTU-APIKEYServer-side calls and minting access tokens. Never put it in a browser or client app.
Dashboard login (email + password)Until changedThe user's role, for example nanoAdmin or nanoReadOnly—Signing in, and minting access tokens without handling the API key
Access token (JWT)You choose at mint time, up to 365 days (default 24 hours)Same as or narrower than the credential that minted itX-BINTU-TOKEN (REST API), x-access-token (Analytics API), Authorization: Bearer (Real-Time API)The recommended credential for services, CI jobs, dashboards and status pages
Player key—Read-only stream discovery—Listing an organisation's streams from a public page
Playback token (JWT)You choose at mint timePlayback of specific streams, groups or the whole organisationPlayer security configSecure playback only, not API calls. See Playback tokens.

The REST API, the Analytics API and the Cloud Token Service share one user database and one token format. One access token minted with the audiences bintu and metrics works for both the REST API and the Analytics API. Your Analytics login is your Dashboard login.

Get your API key​

  1. Sign in to the nanoStream Dashboard at https://dashboard.nanostream.cloud.
  2. Open your organisation overview page: https://dashboard.nanostream.cloud/organisation.
  3. Copy the API key of your organisation.
  4. Store it in a server-side secret store or environment variable, for example BINTU_API_KEY.

Send the key in the X-BINTU-APIKEY header:

curl -s "https://bintu.nanostream.cloud/stream?quantity=1" \
-H "content-type: application/json" \
-H "X-BINTU-APIKEY: $BINTU_API_KEY"

The organisation record also carries a player key (playerKey). It only allows stream discovery, so it is the safe choice when a public page needs to list your streams. Read it from the Dashboard (Organisation › Overview › API Access, rows Api Key and Player Key) or with GET https://bintu.nanostream.cloud/organisation and your API key.

warning

The API key never expires and grants full control of your organisation. Keep it out of browsers, mobile apps, tickets and repositories. If it leaks, contact support to rotate it; you can't rotate it yourself in the Dashboard. For anything that leaves your backend, use an access token.

Access tokens​

An access token is a JWT with an expiry. It is the recommended credential for all API access, because a leaked token stops working on its own. There is no revocation route for access tokens, so expiry is your control: keep exp as short as your use case allows.

You can mint access tokens in three ways.

From your API key (Cloud Token Service)​

This route gives you the most control: you choose the lifetime, the audiences and, optionally, the user whose role the token inherits.

curl -X POST https://token.nanostream.cloud/bintu/token \
-H "X-BINTU-APIKEY: $BINTU_API_KEY" \
-H "content-type: application/json" \
-d '{
"exp": 1790261651,
"aud": ["bintu", "metrics"],
"iss": "<USER_ID>",
"custom": "status page service"
}'
FieldRequiredDescription
expNoExpiry as Unix time in seconds. Default 24 hours, maximum 365 days (error 3000 beyond that).
nbfNo"Not before" as Unix time in seconds. Default: now.
audNoServices the token may call. Default ["bintu"]. Add metrics for the Analytics API. Other values: splay, guardian, secure-conference.
issNoA user ID. Limits the token to that user's role, for example a read-only user. Without it, the token has the API key's full rights.
customNoFree-text note stored in the token.

The response contains the token in data.token. POST https://token.nanostream.cloud/bintu/verify validates a token.

tip

For anything client-facing, mint against a read-only user's ID (iss) and list only the audiences you need.

From a Dashboard login (no API key)​

POST /user/validate mints a token that carries exactly the signed-in user's role. This is the safer default when a suitable read-only user exists, because no organisation key is involved.

curl -X POST https://bintu.nanostream.cloud/user/validate \
-H "content-type: application/json" \
-d '{ "email": "<EMAIL>", "password": "<PASSWORD>", "exp": 1790271095 }'

From the Analytics login​

The Analytics API has its own POST /authenticate route, which the Analytics dashboard uses. It always returns a token valid for 24 hours and ignores any expiry you send. For longer-lived Analytics tokens, use the Cloud Token Service with "aud": ["metrics"]. See Analytics API.

Use the token​

APIHeader
nanoStream REST APIX-BINTU-TOKEN: <token>
Analytics APIx-access-token: <token>
nanoStream Real-Time APIAuthorization: Bearer <token> (switching endpoints also accept X-BINTU-TOKEN)

The same token value works in all three if it carries the right audiences.

What is inside a token​

ClaimMeaning
audServices the token may call, for example ["bintu","metrics"]
exp / nbf / iatValidity window (Unix seconds)
jtiUnique token ID. Quote this when you report a token, never the token itself.
subThe user the token acts as
hashOrganisation hash. A token always belongs to one organisation.
customYour free-text note

Rate limits​

APILimit
Analytics API1 request per second, with bursts of up to 30 requests per second processed immediately. Above that you get HTTP 502 or 504.
nanoStream REST APINo rate limit.
nanoStream Real-Time APINo rate limit.

There is still no need to poll tightly: use webhooks to learn when a stream starts or stops.

Full API references​

APIInteractive reference
Analytics API v2https://api.nanostream.cloud/docs/analytics/v2/ (OpenAPI: https://api.nanostream.cloud/docs/analytics/v2/openapi_v2.json)
nanoStream Real-Time APIhttps://real-time-api.nanostream.cloud/docs
nanoStream REST API (bintu)https://api.nanostream.cloud/docs/bintu/ (OpenAPI: https://api.nanostream.cloud/docs/bintu/openapi.json); guide: nanoStream REST API
Cloud Token Servicehttps://api.nanostream.cloud/docs/token/ (OpenAPI: https://api.nanostream.cloud/docs/token/openapi.json)
Player APIPlayer configuration reference, Events & error codes

Common errors​

SymptomLikely causeFix
401 on the REST or Real-Time APIMissing, expired or malformed key or tokenCheck the header name and the token's exp
403 on the REST APIKey of another organisation, or a malformed stream nameUse the key of the organisation that owns the stream
403 with 105002 on the Analytics APIYour plan or user role does not include that routeUse a higher-tier account or ask support
403 with 105003 on the Analytics APIRoute is only available in the Analytics dashboardUse the dashboard for that view
Token rejected after a whileToken expiredMint a new one; keep lifetimes short and rotate automatically

Next steps​