Skip to main content
POST
/
v1
/
speak
/
stream-input
/
token
Mint Stream Input Token
curl --request POST \
  --url https://api.bland.ai/v1/speak/stream-input/token \
  --header 'authorization: <authorization>'
{
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expires_in_seconds": 300
  },
  "errors": null
}

Overview

Mints a short-lived JWT scoped to your account that can be passed as the token query parameter when opening Stream Speech (WebSocket). Use this from your backend so browser clients never see your long-lived API key. Tokens are valid for 5 minutes and can only authorize a WebSocket session against the same org that minted them.

Headers

authorization
string
required
Your API key for authentication.

Body Parameters

This endpoint takes no body. POST an empty body or {}.

Response

data.token
string
JWT to pass as ?token=<token> on the WebSocket upgrade URL.
data.expires_in_seconds
number
Lifetime of the token. Currently 300 (5 minutes).
errors
null | array
null on success.
{
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expires_in_seconds": 300
  },
  "errors": null
}

Docs for agents: llms.txt