Skip to main content
POST
Returns a direct WebSocket URL and a connect token. A connection opened at that URL does not pass through api.metastreams.io. Its frames, limits and billing are the same as on /v1/stream. The request requires an API key and costs no credit. Routes describes when to use it.

Response

  • url is the WebSocket URL to connect to, such as wss://<host>:<port>/v1/stream. Use it exactly as returned.
  • token is an opaque string that starts with metaconnect_. Send it as Authorization: Bearer <token> in the WebSocket handshake. Treat it as a secret.
  • expiresAt is the token’s expiry time in Unix milliseconds, 30 seconds after the response. The token opens any number of connections until then, within the key’s limit of 20.
The token is not accepted on any REST endpoint or on /v1/stream at api.metastreams.io.

Errors

Authorizations

Authorization
string
header
required

Send an API key, or a session token a key minted, as Authorization: Bearer <credential>. A browser opening /v1/stream offers its session token in Sec-WebSocket-Protocol instead.

Response

The direct stream URL, and the token that opens a socket there within 30 seconds. The call costs no credit.

Where to open the stream socket directly, and the token that opens it.

expiresAt
integer<int64>
required

When the token stops opening sockets.

token
string
required

The token that opens sockets at url, as Authorization: Bearer <token>.

url
string
required

The answering site's direct stream URL.

Example:

"wss://stream-<region>.metastreams.io:9443/v1/stream"