ナビゲーションにスキップ

Realtime API

Create a short-lived Realtime API browser session and receive a client secret for the BeatAPI realtime SDK.

Create the Session on your trusted server, pass only client_secret to the browser, connect with @beatapi/realtime, and close the Session when the experience ends. See the Quick Guide for the security and lifecycle checklist.

認証

AuthorizationBearer

Send your API key as Authorization: Bearer <BEATAPI_API_KEY>.

ヘッダー

Idempotency-Keystring必須1-128 characters

リクエスト

This endpoint expects an object.
max_duration_secondsenum必須
Required maximum live session duration in seconds. The USD amount is reserved for the selected 15, 60, or 300 second tier.
許可された値:
allowed_originslist of strings必須

Exact browser origins allowed to use the short-lived session secret.

metadatamap from strings to stringsオプション

Optional server-defined string metadata for your own correlation. Up to 20 keys; keys are at most 64 characters and values at most 256 characters.

レスポンス

Realtime session created
dataobject

Created Realtime Session including the one-time short-lived browser credential.

エラー

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
409
Conflict Error
429
Too Many Requests Error
503
Service Unavailable Error