| 123456789101112131415161718192021222324252627 |
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
- import { APIResource } from "../../../resource.mjs";
- export class Sessions extends APIResource {
- /**
- * Create an ephemeral API token for use in client-side applications with the
- * Realtime API. Can be configured with the same session parameters as the
- * `session.update` client event.
- *
- * It responds with a session object, plus a `client_secret` key which contains a
- * usable ephemeral API token that can be used to authenticate browser clients for
- * the Realtime API.
- *
- * @example
- * ```ts
- * const session =
- * await client.beta.realtime.sessions.create();
- * ```
- */
- create(body, options) {
- return this._client.post('/realtime/sessions', {
- body,
- ...options,
- headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
- });
- }
- }
- //# sourceMappingURL=sessions.mjs.map
|