Realtime
Accept a Realtime call
Accepts an incoming SIP call and configures the realtime session that handles it.
Path parameters
call_id
string
required
The identifier for the call provided in the
realtime.call.incoming
webhook.
Request Body
Session configuration to apply before the caller is bridged to the model.
type
enum
required
The type of session to create. Always realtime for the Realtime API.
output_modalities
enum[]
The set of modalities the model can respond with. It defaults to ["audio"], indicating that the model will respond with audio plus a transcript. ["text"] can be used to make the model respond with text only. It is not possible to request both text and audio at the same time.
model
string | enum
The Realtime model used for this session.
enum
instructions
string
The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior. Note that the server sets default instructions which will be used if this field is not set and are visible in the session.created event at the start of the session.
audio
OpenAI.RealtimeSessionCreateRequestGAAudio
input
OpenAI.RealtimeSessionCreateRequestGAAudioInput
format
audio/pcm | audio/pcmu | audio/pcma
audio/pcm
OpenAI.RealtimeAudioFormatsAudioPcm
type
enum
required
rate
enum
audio/pcmu
OpenAI.RealtimeAudioFormatsAudioPcmu
type
enum
required
audio/pcma
OpenAI.RealtimeAudioFormatsAudioPcma
type
enum
required
transcription
OpenAI.AudioTranscription
model
string | enum
The model to use for transcription. Current options are whisper-1, gpt-transcribe, gpt-live-transcribe, gpt-4o-mini-transcribe, gpt-4o-mini-transcribe-2025-12-15, gpt-4o-transcribe, gpt-4o-transcribe-diarize, and gpt-realtime-whisper. Use gpt-4o-transcribe-diarize when you need diarization with speaker labels.
enum
language
string
The language of the input audio. Supplying the input language in ISO-639-1 (e.g. en) format will improve accuracy and latency.
languages
string[]
Possible languages of the input audio, in ISO-639-1 format. Supported by gpt-transcribe and gpt-live-transcribe.
keywords
string[]
Words or phrases to guide transcription of the input audio. Supported by gpt-transcribe and gpt-live-transcribe.
prompt
string
An optional text to guide the model's style or continue a previous audio segment. For whisper-1, the prompt is a list of keywords. For gpt-4o-transcribe models (excluding gpt-4o-transcribe-diarize), the prompt is a free text string, for example "expect words related to technology". Prompt is not supported with gpt-realtime-whisper in GA Realtime sessions.
delay
enum
Controls how long the model waits before emitting transcription text. Higher values can improve transcription accuracy at the cost of latency. Only supported with gpt-realtime-whisper in GA Realtime sessions.
noise_reduction
OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction
type
enum
Type of noise reduction. near_field is for close-talking microphones such as headphones, far_field is for far-field microphones such as laptop or conference room microphones.
turn_detection
server_vad | semantic_vad
Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to null to turn off, in which case the client must manually trigger model response. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech. Semantic VAD is more advanced and uses a turn detection model (in conjunction with VAD) to semantically estimate whether the user has finished speaking, then dynamically sets a timeout based on this probability. For example, if user audio trails off with "uhhm", the model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency. For gpt-realtime-whisper transcription sessions, turn detection must be set to null; VAD is not supported.
server_vad
OpenAI.RealtimeTurnDetectionServerVad
type
enum
required
semantic_vad
OpenAI.RealtimeTurnDetectionSemanticVad
type
enum
required
eagerness
enum
output
OpenAI.RealtimeSessionCreateRequestGAAudioOutput
format
audio/pcm | audio/pcmu | audio/pcma
audio/pcm
OpenAI.RealtimeAudioFormatsAudioPcm
type
enum
required
rate
enum
audio/pcmu
OpenAI.RealtimeAudioFormatsAudioPcmu
type
enum
required
audio/pcma
OpenAI.RealtimeAudioFormatsAudioPcma
type
enum
required
voice
OpenAI.VoiceIdsShared | object
A built-in voice name or a custom voice reference.
enum
include
enum[]
Additional fields to include in server outputs. item.input_audio_transcription.logprobs: Include logprobs for input audio transcription.
tracing
enum | OpenAI.RealtimeSessionCreateRequestGATracing | null
Realtime API can write session traces to the Traces Dashboard. Set to null to disable tracing. Once tracing is enabled for a session, the configuration cannot be modified. auto will create a trace for the session with default values for the workflow name, group id, and metadata.
enum
tools
(OpenAI.RealtimeFunctionTool | OpenAI.MCPTool)[]
Tools available to the model.
tool_choice
enum | OpenAI.ToolChoiceFunction | OpenAI.ToolChoiceMCP
How the model chooses tools. Provide one of the string modes or force a specific function/MCP tool.
enum
Controls which (if any) tool is called by the model. none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools.
type
enum
required
For function calling, the type is always function.
name
string
required
The name of the function to call.
type
enum
required
For MCP tools, the type is always mcp.
server_label
string
required
The label of the MCP server to use.
parallel_tool_calls
boolean
Whether the model may call multiple tools in parallel. Only supported by reasoning Realtime models such as gpt-realtime-2.
reasoning
OpenAI.RealtimeReasoning
Configuration for reasoning-capable Realtime models such as gpt-realtime-2.
effort
enum
Constrains effort on reasoning for reasoning-capable Realtime models such as gpt-realtime-2.
max_output_tokens
OpenAI.integer | enum
Maximum number of output tokens for a single assistant response, inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or inf for the maximum available tokens for a given model. Defaults to inf.
enum
truncation
enum | object
When the number of tokens in a conversation exceeds the model's input token limit, the conversation be truncated, meaning messages (starting from the oldest) will not be included in the model's context. A 32k context model with 4,096 max output tokens can only include 28,224 tokens in the context before truncation occurs. Clients can configure truncation behavior to truncate with a lower max token limit, which is an effective way to control token usage and cost. Truncation will reduce the number of cached tokens on the next turn (busting the cache), since messages are dropped from the beginning of the context. However, clients can also configure truncation to retain messages up to a fraction of the maximum context size, which will reduce the need for future truncations and thus improve the cache rate. Truncation can be disabled entirely, which means the server will never truncate but would instead return an error if the conversation exceeds the model's input token limit.
enum
type
enum
required
token_limits
OpenAI.TokenLimits
prompt
OpenAI.Prompt
Reference to a prompt template and its variables. Learn more.
id
string
required
The unique identifier of the prompt template to use.
variables
OpenAI.ResponsePromptVariables | null
Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.
[key: string]
string | OpenAI.InputTextContent | OpenAI.InputImageContent | OpenAI.InputFileContent
type
enum
required
The type of the input item. Always input_text.
text
string
required
The text input to the model.
prompt_cache_breakpoint
OpenAI.PromptCacheBreakpointConfig
Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's prompt_cache_options.ttl; the boundary is not rounded to a token block.
mode
enum
required
The breakpoint mode. Always explicit.
type
enum
required
The type of the input item. Always input_image.
detail
enum
required
prompt_cache_breakpoint
OpenAI.PromptCacheBreakpointConfig
Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's prompt_cache_options.ttl; the boundary is not rounded to a token block.
mode
enum
required
The breakpoint mode. Always explicit.
type
enum
required
The type of the input item. Always input_file.
filename
string
The name of the file to be sent to the model.
file_data
string
The content of the file to be sent to the model.
prompt_cache_breakpoint
OpenAI.PromptCacheBreakpointConfig
Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's prompt_cache_options.ttl; the boundary is not rounded to a token block.
mode
enum
required
The breakpoint mode. Always explicit.
file_url
string
The URL of the file to be sent to the model.
detail
enum
Responses
The request has succeeded.
Request
curl -X POST https://api.openai.com/v1/realtime/calls/$CALL_ID/accept \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "realtime",
"model": "gpt-realtime",
"instructions": "You are Alex, a friendly concierge for Example Corp.",
}'
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});
await client.realtime.calls.accept('call_id', { type: 'realtime' });
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
client.realtime.calls.accept(
call_id="call_id",
type="realtime",
)
package main
import (
"context"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
"github.com/openai/openai-go/realtime"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Realtime.Calls.Accept(
context.TODO(),
"call_id",
realtime.CallAcceptParams{
RealtimeSessionCreateRequest: realtime.RealtimeSessionCreateRequestParam{},
},
)
if err != nil {
panic(err.Error())
}
}
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.realtime.RealtimeSessionCreateRequest;
import com.openai.models.realtime.calls.CallAcceptParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
CallAcceptParams params = CallAcceptParams.builder()
.callId("call_id")
.realtimeSessionCreateRequest(RealtimeSessionCreateRequest.builder().build())
.build();
client.realtime().calls().accept(params);
}
}
require "openai"
openai = OpenAI::Client.new(api_key: "My API Key")
result = openai.realtime.calls.accept("call_id", type: :realtime)
puts(result)