cli/resources/realtime/subresources/calls/index.md +0 −191 deleted
File Deleted View Diff
1# Calls
2
3## Accept call
4
5`$ openai realtime:calls accept`
6
7**post** `/realtime/calls/{call_id}/accept`
8
9Accept an incoming SIP call and configure the realtime session that will
10handle it.
11
12### Parameters
13
14- `--call-id: string`
15
16 The identifier for the call provided in the
17 [`realtime.call.incoming`](https://platform.openai.com/docs/api-reference/webhook-events/realtime/call/incoming)
18 webhook.
19
20- `--type: "realtime"`
21
22 The type of session to create. Always `realtime` for the Realtime API.
23
24- `--audio: optional object { input, output }`
25
26 Configuration for input and output audio.
27
28- `--include: optional array of "item.input_audio_transcription.logprobs"`
29
30 Additional fields to include in server outputs.
31
32 `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription.
33
34- `--instructions: optional string`
35
36 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.
37
38 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.
39
40- `--max-output-tokens: optional number or "inf"`
41
42 Maximum number of output tokens for a single assistant response,
43 inclusive of tool calls. Provide an integer between 1 and 4096 to
44 limit output tokens, or `inf` for the maximum available tokens for a
45 given model. Defaults to `inf`.
46
47- `--model: optional string or "gpt-realtime" or "gpt-realtime-1.5" or "gpt-realtime-2" or 14 more`
48
49 The Realtime model used for this session.
50
51- `--output-modality: optional array of "text" or "audio"`
52
53 The set of modalities the model can respond with. It defaults to `["audio"]`, indicating
54 that the model will respond with audio plus a transcript. `["text"]` can be used to make
55 the model respond with text only. It is not possible to request both `text` and `audio` at the same time.
56
57- `--parallel-tool-calls: optional boolean`
58
59 Whether the model may call multiple tools in parallel. Only supported by
60 reasoning Realtime models such as `gpt-realtime-2`.
61
62- `--prompt: optional object { id, variables, version }`
63
64 Reference to a prompt template and its variables.
65 [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
66
67- `--reasoning: optional object { effort }`
68
69 Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`.
70
71- `--tool-choice: optional ToolChoiceOptions or ToolChoiceFunction or ToolChoiceMcp`
72
73 How the model chooses tools. Provide one of the string modes or force a specific
74 function/MCP tool.
75
76- `--tool: optional array of RealtimeToolsConfigUnion`
77
78 Tools available to the model.
79
80- `--tracing: optional "auto" or object { group_id, metadata, workflow_name }`
81
82 Realtime API can write session traces to the [Traces Dashboard](https://platform.openai.com/logs?api=traces). Set to null to disable tracing. Once
83 tracing is enabled for a session, the configuration cannot be modified.
84
85 `auto` will create a trace for the session with default values for the
86 workflow name, group id, and metadata.
87
88- `--truncation: optional "auto" or "disabled" or RealtimeTruncationRetentionRatio`
89
90 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.
91
92 Clients can configure truncation behavior to truncate with a lower max token limit, which is an effective way to control token usage and cost.
93
94 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.
95
96 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.
97
98### Example
99
100```cli
101openai realtime:calls accept \
102 --api-key 'My API Key' \
103 --call-id call_id \
104 --type realtime
105```
106
107## Hang up call
108
109`$ openai realtime:calls hangup`
110
111**post** `/realtime/calls/{call_id}/hangup`
112
113End an active Realtime API call, whether it was initiated over SIP or
114WebRTC.
115
116### Parameters
117
118- `--call-id: string`
119
120 The identifier for the call. For SIP calls, use the value provided in the
121 [`realtime.call.incoming`](https://platform.openai.com/docs/api-reference/webhook-events/realtime/call/incoming)
122 webhook. For WebRTC sessions, reuse the call ID returned in the `Location`
123 header when creating the call with
124 [`POST /v1/realtime/calls`](https://platform.openai.com/docs/api-reference/realtime/create-call).
125
126### Example
127
128```cli
129openai realtime:calls hangup \
130 --api-key 'My API Key' \
131 --call-id call_id
132```
133
134## Refer call
135
136`$ openai realtime:calls refer`
137
138**post** `/realtime/calls/{call_id}/refer`
139
140Transfer an active SIP call to a new destination using the SIP REFER verb.
141
142### Parameters
143
144- `--call-id: string`
145
146 The identifier for the call provided in the
147 [`realtime.call.incoming`](https://platform.openai.com/docs/api-reference/webhook-events/realtime/call/incoming)
148 webhook.
149
150- `--target-uri: string`
151
152 URI that should appear in the SIP Refer-To header. Supports values like
153 `tel:+14155550123` or `sip:agent@example.com`.
154
155### Example
156
157```cli
158openai realtime:calls refer \
159 --api-key 'My API Key' \
160 --call-id call_id \
161 --target-uri tel:+14155550123
162```
163
164## Reject call
165
166`$ openai realtime:calls reject`
167
168**post** `/realtime/calls/{call_id}/reject`
169
170Decline an incoming SIP call by returning a SIP status code to the caller.
171
172### Parameters
173
174- `--call-id: string`
175
176 The identifier for the call provided in the
177 [`realtime.call.incoming`](https://platform.openai.com/docs/api-reference/webhook-events/realtime/call/incoming)
178 webhook.
179
180- `--status-code: optional number`
181
182 SIP response code to send back to the caller. Defaults to `603` (Decline)
183 when omitted.
184
185### Example
186
187```cli
188openai realtime:calls reject \
189 --api-key 'My API Key' \
190 --call-id call_id
191```