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-Key
リクエスト
This endpoint expects an object.
max_duration_seconds
Required maximum live session duration in seconds. The USD amount is reserved for the selected 15, 60, or 300 second tier.
許可された値:
allowed_origins
Exact browser origins allowed to use the short-lived session secret.
metadata
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
data
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

