---
title: "Create Realtime Client Secret"
method: POST
path: "/v1/convai/realtime/client_secrets"
tags: ["Realtime"]
---

# Create Realtime Client Secret

`POST /v1/convai/realtime/client_secrets`

## Request

- Base URL: `https://api.elevenlabs.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.elevenlabs.io/v1/convai/realtime/client_secrets`
- Auth: none declared

Create an ephemeral client secret for authenticating browser-based Realtime API sessions.

## Headers

- `xi-api-key` string, nullable: Your API key. This is required by most endpoints to access our API programmatically. You can view your xi-api-key using the 'Profile' tab on the website.

## Request body

- CreateClientSecretRequest
  - `session` OpenAISessionConfigInput
    - `type` 'realtime'
    - `model` 'eleven_realtime_v1_mini' | 'eleven_realtime_v1_max'
    - `instructions` string
    - `output_modalities` string[]
    - `audio` OpenAIAudioConfigInput
      - `input` OpenAIAudioInputConfigInput
        - `format` OpenAIAudioInputFormat
          - `type` 'audio/pcm' | 'audio/pcmu' | 'audio/pcma'
          - `rate` integer
        - `transcription` OpenAIAudioInputTranscription
          - `language` string, nullable: Language code of the conversation (e.g. en, es, pt-br), used for transcription, speech and the model's reply language. Defaults to en.
        - `turn_detection` OpenAITurnDetection
          - `type` 'semantic_vad' | 'server_vad'
          - `eagerness` 'low' | 'medium' | 'high'
          - `create_response` boolean
          - `interrupt_response` boolean
          - `threshold` number, nullable
          - `prefix_padding_ms` integer, nullable
          - `silence_duration_ms` integer, nullable
          - `turn_timeout` number
        - `pacing` 'realtime' | 'bursty': ``BURSTY`` clients stream ahead of wall time, so decisions use the audio clock.
      - `output` OpenAIAudioOutputConfigInput
        - `format` OpenAIAudioOutputFormat
          - `type` 'audio/pcm' | 'audio/pcmu' | 'audio/pcma'
        - `voice` string
    - `tools` union[]
      - union
        - OpenAIFunctionTool
          - `type` 'function'
          - `name` string, required
          - `description` string
          - `parameters` object
        - OpenAIMCPTool
          - `type` 'mcp'
          - `server_label` string, required
          - `server_url` string, required
          - `authorization` string, nullable
          - `allowed_tools` string[], nullable
          - `require_approval` 'never' | 'always'
    - `tool_choice` union
      - string
      - OpenAIToolChoiceFunction
        - `type` 'function'
        - `function` OpenAIToolChoiceFunctionInner, required
          - `name` string, required
    - `temperature` number
    - `max_response_output_tokens` union
      - integer
      - 'inf'
    - `max_duration_seconds` integer: Maximum wall-clock duration of the session in seconds. The session is closed with code 1000 once it is exceeded.
    - `turn_detection` union
      - OpenAITurnDetection
        - `type` 'semantic_vad' | 'server_vad'
        - `eagerness` 'low' | 'medium' | 'high'
        - `create_response` boolean
        - `interrupt_response` boolean
        - `threshold` number, nullable
        - `prefix_padding_ms` integer, nullable
        - `silence_duration_ms` integer, nullable
        - `turn_timeout` number
      - string
    - `tracing` union
      - 'auto'
      - OpenAITracingConfiguration: Only ``group_id`` is acted on; ``workflow_name`` and ``metadata`` are kept so the echoed session matches the request.
        - `group_id` string, nullable: Adds conversation to the group (case-insensitive, up to 64 chars).
        - `workflow_name` string, nullable
        - `metadata` object, nullable
    - `include` string[], nullable
    - `parallel_tool_calls` boolean, nullable
    - `reasoning` object, nullable
    - `truncation` union
      - string
      - object
    - `prompt` object, nullable
  - `expires_after` ExpiresAfter
    - `anchor` 'created_at'
    - `seconds` integer, required

## Response `200`

Successful Response

- ClientSecretResponse
  - `value` string, required
  - `expires_at` integer, required
  - `session` OpenAISessionConfigOutput
    - `type` 'realtime'
    - `model` 'eleven_realtime_v1_mini' | 'eleven_realtime_v1_max'
    - `instructions` string
    - `output_modalities` string[]
    - `audio` OpenAIAudioConfigOutput
      - `input` OpenAIAudioInputConfigOutput
        - `format` OpenAIAudioInputFormat
          - `type` 'audio/pcm' | 'audio/pcmu' | 'audio/pcma'
          - `rate` integer
        - `transcription` OpenAIAudioInputTranscription
          - `language` string, nullable: Language code of the conversation (e.g. en, es, pt-br), used for transcription, speech and the model's reply language. Defaults to en.
        - `turn_detection` OpenAITurnDetection
          - `type` 'semantic_vad' | 'server_vad'
          - `eagerness` 'low' | 'medium' | 'high'
          - `create_response` boolean
          - `interrupt_response` boolean
          - `threshold` number, nullable
          - `prefix_padding_ms` integer, nullable
          - `silence_duration_ms` integer, nullable
          - `turn_timeout` number
        - `pacing` 'realtime' | 'bursty': ``BURSTY`` clients stream ahead of wall time, so decisions use the audio clock.
      - `output` OpenAIAudioOutputConfigOutput
        - `format` OpenAIAudioOutputFormat
          - `type` 'audio/pcm' | 'audio/pcmu' | 'audio/pcma'
        - `voice` string
    - `tools` union[]
      - union
        - OpenAIFunctionTool
          - `type` 'function'
          - `name` string, required
          - `description` string
          - `parameters` object
        - OpenAIMCPTool
          - `type` 'mcp'
          - `server_label` string, required
          - `server_url` string, required
          - `authorization` string, nullable
          - `allowed_tools` string[], nullable
          - `require_approval` 'never' | 'always'
    - `tool_choice` union
      - string
      - OpenAIToolChoiceFunction
        - `type` 'function'
        - `function` OpenAIToolChoiceFunctionInner, required
          - `name` string, required
    - `temperature` number
    - `max_response_output_tokens` union
      - integer
      - 'inf'
    - `max_duration_seconds` integer: Maximum wall-clock duration of the session in seconds. The session is closed with code 1000 once it is exceeded.
    - `tracing` union
      - 'auto'
      - OpenAITracingConfiguration: Only ``group_id`` is acted on; ``workflow_name`` and ``metadata`` are kept so the echoed session matches the request.
        - `group_id` string, nullable: Adds conversation to the group (case-insensitive, up to 64 chars).
        - `workflow_name` string, nullable
        - `metadata` object, nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-20** `32d603c7efa9`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/elevenlabs/apis/elevenlabs-api-documentation/changes/v1/convai/realtime/client_secrets/post.md)

---

[API](https://skmtc.dev/elevenlabs/apis/elevenlabs-api-documentation.md) - [All operations](https://skmtc.dev/elevenlabs/apis/elevenlabs-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/elevenlabs/apis/elevenlabs-api-documentation/revisions/d04f5e77c40a?raw)
