OhMyGPT

Create Realtime client secret

POST
/v1/realtime/client_secrets

Creates a short-lived client secret for browsers and mobile apps: open a session at wss://api.ohmygpt.com/v1/realtime with it in place of your API key. The model and session settings are fixed when it is created and applied when the session opens. Set the model in session.model or the top-level model field.

授权

ApiKeyAuth
headerAuthorization<token>

请求主体

application/json
  1. body
expires_after?
model?string

OhMyGPT model ID. Used when session.model is omitted.

session?
[key: string]?any

响应主体

The client secret and its session configuration.

application/json
  1. response
expires_at*integer

Unix time when the client secret expires.

格式int64
session*

The session settings, applied when a session opens with this client secret.

value*string

The client secret. Connect to wss://api.ohmygpt.com/v1/realtime with it in place of an API key.

[key: string]?any
示例请求
curl -X POST 'https://api.ohmygpt.com/v1/realtime/client_secrets' \  -H 'Content-Type: application/json' \  -d '{}'
示例响应
{  "expires_at": 0,  "session": {},  "value": "string"}