Home / Servers / OpenAI API / create_realtime_session

Create session

An MCP tool from the OpenAI API server, hosted on mcp.hjlabs.in.

Create session 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… [POST /realtime/sessions]

Name on the gateway: openai_api__create_realtime_session · may change things.

Parameters

NameTypeDescription
client_secret requiredobjectEphemeral key returned by the API.
modalitiesarrayThe set of modalities the model can respond with. To disable audio, set this…
instructionsstringThe default system instructions (i.e. system message) prepended to model…
voiceobjectThe voice the model uses to respond. Supported built-in voices are alloy, ash…
input_audio_formatstringThe format of input audio. Options are pcm16, g711_ulaw, or g711_alaw.
output_audio_formatstringThe format of output audio. Options are pcm16, g711_ulaw, or g711_alaw.
input_audio_transcriptionobjectConfiguration for input audio transcription, defaults to off and can be set to…
speednumberThe speed of the model's spoken response. 1.0 is the default speed. 0.25 is…
tracingobjectConfiguration options for tracing. Set to null to disable tracing. Once…
turn_detectionobjectConfiguration for turn detection. Can be set to null to turn off. Server VAD…
toolsarrayTools (functions) available to the model.
tool_choicestringHow the model chooses tools. Options are auto, none, required, or specify a…
temperaturenumberSampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.
max_response_output_tokensintegerMaximum number of output tokens for a single assistant response, inclusive of…
truncationobjectWhen the number of tokens in a conversation exceeds the model's input token…
promptobjectReference to a prompt template and its variables. Learn more.

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "openai_api__create_realtime_session",
  "arguments": {
    "client_secret": "…"
  }
}

Or connect the OpenAI API server directly, which lists 371 tools including this one:

Run in your terminal
claude mcp add --transport http hj-openai-api https://mcp.hjlabs.in/mcp/openai-api \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the create session tool with client_secret set to ….

More from OpenAI API