client-secrets.d.ts 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. import { APIResource } from "../../core/resource.js";
  2. import * as ClientSecretsAPI from "./client-secrets.js";
  3. import * as RealtimeAPI from "./realtime.js";
  4. import * as ResponsesAPI from "../responses/responses.js";
  5. import { APIPromise } from "../../core/api-promise.js";
  6. import { RequestOptions } from "../../internal/request-options.js";
  7. export declare class ClientSecrets extends APIResource {
  8. /**
  9. * Create a Realtime client secret with an associated session configuration.
  10. *
  11. * @example
  12. * ```ts
  13. * const clientSecret =
  14. * await client.realtime.clientSecrets.create();
  15. * ```
  16. */
  17. create(body: ClientSecretCreateParams, options?: RequestOptions): APIPromise<ClientSecretCreateResponse>;
  18. }
  19. /**
  20. * Ephemeral key returned by the API.
  21. */
  22. export interface RealtimeSessionClientSecret {
  23. /**
  24. * Timestamp for when the token expires. Currently, all tokens expire after one
  25. * minute.
  26. */
  27. expires_at: number;
  28. /**
  29. * Ephemeral key usable in client environments to authenticate connections to the
  30. * Realtime API. Use this in client-side environments rather than a standard API
  31. * token, which should only be used server-side.
  32. */
  33. value: string;
  34. }
  35. /**
  36. * A new Realtime session configuration, with an ephemeral key. Default TTL for
  37. * keys is one minute.
  38. */
  39. export interface RealtimeSessionCreateResponse {
  40. /**
  41. * Ephemeral key returned by the API.
  42. */
  43. client_secret: RealtimeSessionClientSecret;
  44. /**
  45. * The type of session to create. Always `realtime` for the Realtime API.
  46. */
  47. type: 'realtime';
  48. /**
  49. * Configuration for input and output audio.
  50. */
  51. audio?: RealtimeSessionCreateResponse.Audio;
  52. /**
  53. * Additional fields to include in server outputs.
  54. *
  55. * `item.input_audio_transcription.logprobs`: Include logprobs for input audio
  56. * transcription.
  57. */
  58. include?: Array<'item.input_audio_transcription.logprobs'>;
  59. /**
  60. * The default system instructions (i.e. system message) prepended to model calls.
  61. * This field allows the client to guide the model on desired responses. The model
  62. * can be instructed on response content and format, (e.g. "be extremely succinct",
  63. * "act friendly", "here are examples of good responses") and on audio behavior
  64. * (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The
  65. * instructions are not guaranteed to be followed by the model, but they provide
  66. * guidance to the model on the desired behavior.
  67. *
  68. * Note that the server sets default instructions which will be used if this field
  69. * is not set and are visible in the `session.created` event at the start of the
  70. * session.
  71. */
  72. instructions?: string;
  73. /**
  74. * Maximum number of output tokens for a single assistant response, inclusive of
  75. * tool calls. Provide an integer between 1 and 4096 to limit output tokens, or
  76. * `inf` for the maximum available tokens for a given model. Defaults to `inf`.
  77. */
  78. max_output_tokens?: number | 'inf';
  79. /**
  80. * The Realtime model used for this session.
  81. */
  82. model?: (string & {}) | 'gpt-realtime' | 'gpt-realtime-2025-08-28' | 'gpt-4o-realtime-preview' | 'gpt-4o-realtime-preview-2024-10-01' | 'gpt-4o-realtime-preview-2024-12-17' | 'gpt-4o-realtime-preview-2025-06-03' | 'gpt-4o-mini-realtime-preview' | 'gpt-4o-mini-realtime-preview-2024-12-17' | 'gpt-realtime-mini' | 'gpt-realtime-mini-2025-10-06' | 'gpt-realtime-mini-2025-12-15' | 'gpt-audio-mini' | 'gpt-audio-mini-2025-10-06' | 'gpt-audio-mini-2025-12-15';
  83. /**
  84. * The set of modalities the model can respond with. It defaults to `["audio"]`,
  85. * indicating that the model will respond with audio plus a transcript. `["text"]`
  86. * can be used to make the model respond with text only. It is not possible to
  87. * request both `text` and `audio` at the same time.
  88. */
  89. output_modalities?: Array<'text' | 'audio'>;
  90. /**
  91. * Reference to a prompt template and its variables.
  92. * [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
  93. */
  94. prompt?: ResponsesAPI.ResponsePrompt | null;
  95. /**
  96. * How the model chooses tools. Provide one of the string modes or force a specific
  97. * function/MCP tool.
  98. */
  99. tool_choice?: ResponsesAPI.ToolChoiceOptions | ResponsesAPI.ToolChoiceFunction | ResponsesAPI.ToolChoiceMcp;
  100. /**
  101. * Tools available to the model.
  102. */
  103. tools?: Array<RealtimeAPI.RealtimeFunctionTool | RealtimeSessionCreateResponse.McpTool>;
  104. /**
  105. * Realtime API can write session traces to the
  106. * [Traces Dashboard](/logs?api=traces). Set to null to disable tracing. Once
  107. * tracing is enabled for a session, the configuration cannot be modified.
  108. *
  109. * `auto` will create a trace for the session with default values for the workflow
  110. * name, group id, and metadata.
  111. */
  112. tracing?: 'auto' | RealtimeSessionCreateResponse.TracingConfiguration | null;
  113. /**
  114. * When the number of tokens in a conversation exceeds the model's input token
  115. * limit, the conversation be truncated, meaning messages (starting from the
  116. * oldest) will not be included in the model's context. A 32k context model with
  117. * 4,096 max output tokens can only include 28,224 tokens in the context before
  118. * truncation occurs.
  119. *
  120. * Clients can configure truncation behavior to truncate with a lower max token
  121. * limit, which is an effective way to control token usage and cost.
  122. *
  123. * Truncation will reduce the number of cached tokens on the next turn (busting the
  124. * cache), since messages are dropped from the beginning of the context. However,
  125. * clients can also configure truncation to retain messages up to a fraction of the
  126. * maximum context size, which will reduce the need for future truncations and thus
  127. * improve the cache rate.
  128. *
  129. * Truncation can be disabled entirely, which means the server will never truncate
  130. * but would instead return an error if the conversation exceeds the model's input
  131. * token limit.
  132. */
  133. truncation?: RealtimeAPI.RealtimeTruncation;
  134. }
  135. export declare namespace RealtimeSessionCreateResponse {
  136. /**
  137. * Configuration for input and output audio.
  138. */
  139. interface Audio {
  140. input?: Audio.Input;
  141. output?: Audio.Output;
  142. }
  143. namespace Audio {
  144. interface Input {
  145. /**
  146. * The format of the input audio.
  147. */
  148. format?: RealtimeAPI.RealtimeAudioFormats;
  149. /**
  150. * Configuration for input audio noise reduction. This can be set to `null` to turn
  151. * off. Noise reduction filters audio added to the input audio buffer before it is
  152. * sent to VAD and the model. Filtering the audio can improve VAD and turn
  153. * detection accuracy (reducing false positives) and model performance by improving
  154. * perception of the input audio.
  155. */
  156. noise_reduction?: Input.NoiseReduction;
  157. /**
  158. * Configuration for input audio transcription, defaults to off and can be set to
  159. * `null` to turn off once on. Input audio transcription is not native to the
  160. * model, since the model consumes audio directly. Transcription runs
  161. * asynchronously through
  162. * [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription)
  163. * and should be treated as guidance of input audio content rather than precisely
  164. * what the model heard. The client can optionally set the language and prompt for
  165. * transcription, these offer additional guidance to the transcription service.
  166. */
  167. transcription?: RealtimeAPI.AudioTranscription;
  168. /**
  169. * Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
  170. * set to `null` to turn off, in which case the client must manually trigger model
  171. * response.
  172. *
  173. * Server VAD means that the model will detect the start and end of speech based on
  174. * audio volume and respond at the end of user speech.
  175. *
  176. * Semantic VAD is more advanced and uses a turn detection model (in conjunction
  177. * with VAD) to semantically estimate whether the user has finished speaking, then
  178. * dynamically sets a timeout based on this probability. For example, if user audio
  179. * trails off with "uhhm", the model will score a low probability of turn end and
  180. * wait longer for the user to continue speaking. This can be useful for more
  181. * natural conversations, but may have a higher latency.
  182. */
  183. turn_detection?: Input.ServerVad | Input.SemanticVad | null;
  184. }
  185. namespace Input {
  186. /**
  187. * Configuration for input audio noise reduction. This can be set to `null` to turn
  188. * off. Noise reduction filters audio added to the input audio buffer before it is
  189. * sent to VAD and the model. Filtering the audio can improve VAD and turn
  190. * detection accuracy (reducing false positives) and model performance by improving
  191. * perception of the input audio.
  192. */
  193. interface NoiseReduction {
  194. /**
  195. * Type of noise reduction. `near_field` is for close-talking microphones such as
  196. * headphones, `far_field` is for far-field microphones such as laptop or
  197. * conference room microphones.
  198. */
  199. type?: RealtimeAPI.NoiseReductionType;
  200. }
  201. /**
  202. * Server-side voice activity detection (VAD) which flips on when user speech is
  203. * detected and off after a period of silence.
  204. */
  205. interface ServerVad {
  206. /**
  207. * Type of turn detection, `server_vad` to turn on simple Server VAD.
  208. */
  209. type: 'server_vad';
  210. /**
  211. * Whether or not to automatically generate a response when a VAD stop event
  212. * occurs. If `interrupt_response` is set to `false` this may fail to create a
  213. * response if the model is already responding.
  214. *
  215. * If both `create_response` and `interrupt_response` are set to `false`, the model
  216. * will never respond automatically but VAD events will still be emitted.
  217. */
  218. create_response?: boolean;
  219. /**
  220. * Optional timeout after which a model response will be triggered automatically.
  221. * This is useful for situations in which a long pause from the user is unexpected,
  222. * such as a phone call. The model will effectively prompt the user to continue the
  223. * conversation based on the current context.
  224. *
  225. * The timeout value will be applied after the last model response's audio has
  226. * finished playing, i.e. it's set to the `response.done` time plus audio playback
  227. * duration.
  228. *
  229. * An `input_audio_buffer.timeout_triggered` event (plus events associated with the
  230. * Response) will be emitted when the timeout is reached. Idle timeout is currently
  231. * only supported for `server_vad` mode.
  232. */
  233. idle_timeout_ms?: number | null;
  234. /**
  235. * Whether or not to automatically interrupt (cancel) any ongoing response with
  236. * output to the default conversation (i.e. `conversation` of `auto`) when a VAD
  237. * start event occurs. If `true` then the response will be cancelled, otherwise it
  238. * will continue until complete.
  239. *
  240. * If both `create_response` and `interrupt_response` are set to `false`, the model
  241. * will never respond automatically but VAD events will still be emitted.
  242. */
  243. interrupt_response?: boolean;
  244. /**
  245. * Used only for `server_vad` mode. Amount of audio to include before the VAD
  246. * detected speech (in milliseconds). Defaults to 300ms.
  247. */
  248. prefix_padding_ms?: number;
  249. /**
  250. * Used only for `server_vad` mode. Duration of silence to detect speech stop (in
  251. * milliseconds). Defaults to 500ms. With shorter values the model will respond
  252. * more quickly, but may jump in on short pauses from the user.
  253. */
  254. silence_duration_ms?: number;
  255. /**
  256. * Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this
  257. * defaults to 0.5. A higher threshold will require louder audio to activate the
  258. * model, and thus might perform better in noisy environments.
  259. */
  260. threshold?: number;
  261. }
  262. /**
  263. * Server-side semantic turn detection which uses a model to determine when the
  264. * user has finished speaking.
  265. */
  266. interface SemanticVad {
  267. /**
  268. * Type of turn detection, `semantic_vad` to turn on Semantic VAD.
  269. */
  270. type: 'semantic_vad';
  271. /**
  272. * Whether or not to automatically generate a response when a VAD stop event
  273. * occurs.
  274. */
  275. create_response?: boolean;
  276. /**
  277. * Used only for `semantic_vad` mode. The eagerness of the model to respond. `low`
  278. * will wait longer for the user to continue speaking, `high` will respond more
  279. * quickly. `auto` is the default and is equivalent to `medium`. `low`, `medium`,
  280. * and `high` have max timeouts of 8s, 4s, and 2s respectively.
  281. */
  282. eagerness?: 'low' | 'medium' | 'high' | 'auto';
  283. /**
  284. * Whether or not to automatically interrupt any ongoing response with output to
  285. * the default conversation (i.e. `conversation` of `auto`) when a VAD start event
  286. * occurs.
  287. */
  288. interrupt_response?: boolean;
  289. }
  290. }
  291. interface Output {
  292. /**
  293. * The format of the output audio.
  294. */
  295. format?: RealtimeAPI.RealtimeAudioFormats;
  296. /**
  297. * The speed of the model's spoken response as a multiple of the original speed.
  298. * 1.0 is the default speed. 0.25 is the minimum speed. 1.5 is the maximum speed.
  299. * This value can only be changed in between model turns, not while a response is
  300. * in progress.
  301. *
  302. * This parameter is a post-processing adjustment to the audio after it is
  303. * generated, it's also possible to prompt the model to speak faster or slower.
  304. */
  305. speed?: number;
  306. /**
  307. * The voice the model uses to respond. Voice cannot be changed during the session
  308. * once the model has responded with audio at least once. Current voice options are
  309. * `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`,
  310. * and `cedar`. We recommend `marin` and `cedar` for best quality.
  311. */
  312. voice?: (string & {}) | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse' | 'marin' | 'cedar';
  313. }
  314. }
  315. /**
  316. * Give the model access to additional tools via remote Model Context Protocol
  317. * (MCP) servers.
  318. * [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
  319. */
  320. interface McpTool {
  321. /**
  322. * A label for this MCP server, used to identify it in tool calls.
  323. */
  324. server_label: string;
  325. /**
  326. * The type of the MCP tool. Always `mcp`.
  327. */
  328. type: 'mcp';
  329. /**
  330. * List of allowed tool names or a filter object.
  331. */
  332. allowed_tools?: Array<string> | McpTool.McpToolFilter | null;
  333. /**
  334. * An OAuth access token that can be used with a remote MCP server, either with a
  335. * custom MCP server URL or a service connector. Your application must handle the
  336. * OAuth authorization flow and provide the token here.
  337. */
  338. authorization?: string;
  339. /**
  340. * Identifier for service connectors, like those available in ChatGPT. One of
  341. * `server_url` or `connector_id` must be provided. Learn more about service
  342. * connectors
  343. * [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).
  344. *
  345. * Currently supported `connector_id` values are:
  346. *
  347. * - Dropbox: `connector_dropbox`
  348. * - Gmail: `connector_gmail`
  349. * - Google Calendar: `connector_googlecalendar`
  350. * - Google Drive: `connector_googledrive`
  351. * - Microsoft Teams: `connector_microsoftteams`
  352. * - Outlook Calendar: `connector_outlookcalendar`
  353. * - Outlook Email: `connector_outlookemail`
  354. * - SharePoint: `connector_sharepoint`
  355. */
  356. connector_id?: 'connector_dropbox' | 'connector_gmail' | 'connector_googlecalendar' | 'connector_googledrive' | 'connector_microsoftteams' | 'connector_outlookcalendar' | 'connector_outlookemail' | 'connector_sharepoint';
  357. /**
  358. * Optional HTTP headers to send to the MCP server. Use for authentication or other
  359. * purposes.
  360. */
  361. headers?: {
  362. [key: string]: string;
  363. } | null;
  364. /**
  365. * Specify which of the MCP server's tools require approval.
  366. */
  367. require_approval?: McpTool.McpToolApprovalFilter | 'always' | 'never' | null;
  368. /**
  369. * Optional description of the MCP server, used to provide more context.
  370. */
  371. server_description?: string;
  372. /**
  373. * The URL for the MCP server. One of `server_url` or `connector_id` must be
  374. * provided.
  375. */
  376. server_url?: string;
  377. }
  378. namespace McpTool {
  379. /**
  380. * A filter object to specify which tools are allowed.
  381. */
  382. interface McpToolFilter {
  383. /**
  384. * Indicates whether or not a tool modifies data or is read-only. If an MCP server
  385. * is
  386. * [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
  387. * it will match this filter.
  388. */
  389. read_only?: boolean;
  390. /**
  391. * List of allowed tool names.
  392. */
  393. tool_names?: Array<string>;
  394. }
  395. /**
  396. * Specify which of the MCP server's tools require approval. Can be `always`,
  397. * `never`, or a filter object associated with tools that require approval.
  398. */
  399. interface McpToolApprovalFilter {
  400. /**
  401. * A filter object to specify which tools are allowed.
  402. */
  403. always?: McpToolApprovalFilter.Always;
  404. /**
  405. * A filter object to specify which tools are allowed.
  406. */
  407. never?: McpToolApprovalFilter.Never;
  408. }
  409. namespace McpToolApprovalFilter {
  410. /**
  411. * A filter object to specify which tools are allowed.
  412. */
  413. interface Always {
  414. /**
  415. * Indicates whether or not a tool modifies data or is read-only. If an MCP server
  416. * is
  417. * [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
  418. * it will match this filter.
  419. */
  420. read_only?: boolean;
  421. /**
  422. * List of allowed tool names.
  423. */
  424. tool_names?: Array<string>;
  425. }
  426. /**
  427. * A filter object to specify which tools are allowed.
  428. */
  429. interface Never {
  430. /**
  431. * Indicates whether or not a tool modifies data or is read-only. If an MCP server
  432. * is
  433. * [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
  434. * it will match this filter.
  435. */
  436. read_only?: boolean;
  437. /**
  438. * List of allowed tool names.
  439. */
  440. tool_names?: Array<string>;
  441. }
  442. }
  443. }
  444. /**
  445. * Granular configuration for tracing.
  446. */
  447. interface TracingConfiguration {
  448. /**
  449. * The group id to attach to this trace to enable filtering and grouping in the
  450. * Traces Dashboard.
  451. */
  452. group_id?: string;
  453. /**
  454. * The arbitrary metadata to attach to this trace to enable filtering in the Traces
  455. * Dashboard.
  456. */
  457. metadata?: unknown;
  458. /**
  459. * The name of the workflow to attach to this trace. This is used to name the trace
  460. * in the Traces Dashboard.
  461. */
  462. workflow_name?: string;
  463. }
  464. }
  465. /**
  466. * A Realtime transcription session configuration object.
  467. */
  468. export interface RealtimeTranscriptionSessionCreateResponse {
  469. /**
  470. * Unique identifier for the session that looks like `sess_1234567890abcdef`.
  471. */
  472. id: string;
  473. /**
  474. * The object type. Always `realtime.transcription_session`.
  475. */
  476. object: string;
  477. /**
  478. * The type of session. Always `transcription` for transcription sessions.
  479. */
  480. type: 'transcription';
  481. /**
  482. * Configuration for input audio for the session.
  483. */
  484. audio?: RealtimeTranscriptionSessionCreateResponse.Audio;
  485. /**
  486. * Expiration timestamp for the session, in seconds since epoch.
  487. */
  488. expires_at?: number;
  489. /**
  490. * Additional fields to include in server outputs.
  491. *
  492. * - `item.input_audio_transcription.logprobs`: Include logprobs for input audio
  493. * transcription.
  494. */
  495. include?: Array<'item.input_audio_transcription.logprobs'>;
  496. }
  497. export declare namespace RealtimeTranscriptionSessionCreateResponse {
  498. /**
  499. * Configuration for input audio for the session.
  500. */
  501. interface Audio {
  502. input?: Audio.Input;
  503. }
  504. namespace Audio {
  505. interface Input {
  506. /**
  507. * The PCM audio format. Only a 24kHz sample rate is supported.
  508. */
  509. format?: RealtimeAPI.RealtimeAudioFormats;
  510. /**
  511. * Configuration for input audio noise reduction.
  512. */
  513. noise_reduction?: Input.NoiseReduction;
  514. /**
  515. * Configuration of the transcription model.
  516. */
  517. transcription?: RealtimeAPI.AudioTranscription;
  518. /**
  519. * Configuration for turn detection. Can be set to `null` to turn off. Server VAD
  520. * means that the model will detect the start and end of speech based on audio
  521. * volume and respond at the end of user speech.
  522. */
  523. turn_detection?: ClientSecretsAPI.RealtimeTranscriptionSessionTurnDetection;
  524. }
  525. namespace Input {
  526. /**
  527. * Configuration for input audio noise reduction.
  528. */
  529. interface NoiseReduction {
  530. /**
  531. * Type of noise reduction. `near_field` is for close-talking microphones such as
  532. * headphones, `far_field` is for far-field microphones such as laptop or
  533. * conference room microphones.
  534. */
  535. type?: RealtimeAPI.NoiseReductionType;
  536. }
  537. }
  538. }
  539. }
  540. /**
  541. * Configuration for turn detection. Can be set to `null` to turn off. Server VAD
  542. * means that the model will detect the start and end of speech based on audio
  543. * volume and respond at the end of user speech.
  544. */
  545. export interface RealtimeTranscriptionSessionTurnDetection {
  546. /**
  547. * Amount of audio to include before the VAD detected speech (in milliseconds).
  548. * Defaults to 300ms.
  549. */
  550. prefix_padding_ms?: number;
  551. /**
  552. * Duration of silence to detect speech stop (in milliseconds). Defaults to 500ms.
  553. * With shorter values the model will respond more quickly, but may jump in on
  554. * short pauses from the user.
  555. */
  556. silence_duration_ms?: number;
  557. /**
  558. * Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A higher
  559. * threshold will require louder audio to activate the model, and thus might
  560. * perform better in noisy environments.
  561. */
  562. threshold?: number;
  563. /**
  564. * Type of turn detection, only `server_vad` is currently supported.
  565. */
  566. type?: string;
  567. }
  568. /**
  569. * Response from creating a session and client secret for the Realtime API.
  570. */
  571. export interface ClientSecretCreateResponse {
  572. /**
  573. * Expiration timestamp for the client secret, in seconds since epoch.
  574. */
  575. expires_at: number;
  576. /**
  577. * The session configuration for either a realtime or transcription session.
  578. */
  579. session: RealtimeSessionCreateResponse | RealtimeTranscriptionSessionCreateResponse;
  580. /**
  581. * The generated client secret value.
  582. */
  583. value: string;
  584. }
  585. export interface ClientSecretCreateParams {
  586. /**
  587. * Configuration for the client secret expiration. Expiration refers to the time
  588. * after which a client secret will no longer be valid for creating sessions. The
  589. * session itself may continue after that time once started. A secret can be used
  590. * to create multiple sessions until it expires.
  591. */
  592. expires_after?: ClientSecretCreateParams.ExpiresAfter;
  593. /**
  594. * Session configuration to use for the client secret. Choose either a realtime
  595. * session or a transcription session.
  596. */
  597. session?: RealtimeAPI.RealtimeSessionCreateRequest | RealtimeAPI.RealtimeTranscriptionSessionCreateRequest;
  598. }
  599. export declare namespace ClientSecretCreateParams {
  600. /**
  601. * Configuration for the client secret expiration. Expiration refers to the time
  602. * after which a client secret will no longer be valid for creating sessions. The
  603. * session itself may continue after that time once started. A secret can be used
  604. * to create multiple sessions until it expires.
  605. */
  606. interface ExpiresAfter {
  607. /**
  608. * The anchor point for the client secret expiration, meaning that `seconds` will
  609. * be added to the `created_at` time of the client secret to produce an expiration
  610. * timestamp. Only `created_at` is currently supported.
  611. */
  612. anchor?: 'created_at';
  613. /**
  614. * The number of seconds from the anchor point to the expiration. Select a value
  615. * between `10` and `7200` (2 hours). This default to 600 seconds (10 minutes) if
  616. * not specified.
  617. */
  618. seconds?: number;
  619. }
  620. }
  621. export declare namespace ClientSecrets {
  622. export { type RealtimeSessionClientSecret as RealtimeSessionClientSecret, type RealtimeSessionCreateResponse as RealtimeSessionCreateResponse, type RealtimeTranscriptionSessionCreateResponse as RealtimeTranscriptionSessionCreateResponse, type RealtimeTranscriptionSessionTurnDetection as RealtimeTranscriptionSessionTurnDetection, type ClientSecretCreateResponse as ClientSecretCreateResponse, type ClientSecretCreateParams as ClientSecretCreateParams, };
  623. }
  624. //# sourceMappingURL=client-secrets.d.ts.map