microsoft-foundry.rest.security.o-auth2-auth
Realtime
Create a Realtime call
POST
/openai/v1/realtime/calls
Creates a Realtime API call over WebRTC and returns the SDP answer needed to complete the peer connection.
İstek Gövdesi
The request body.
Content-Type: multipart/form-data
sdp
string
gerekli
WebRTC Session Description Protocol (SDP) offer generated by the caller.
session
OpenAI.RealtimeCallCreateRequest
Optional session configuration to apply before the realtime session is created. Use the same parameters you would send in a create client secret request.
Yanıtlar
The request has succeeded and a new resource has been created as a result.
Üst Bilgiler
location
string
The location request header.
Gövde
Content-Type: application/sdp
string
İstek
curl -X POST https://api.openai.com/v1/realtime/calls \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-F "sdp=<offer.sdp;type=application/sdp" \
-F 'session={"type":"realtime","model":"gpt-realtime"};type=application/json'
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
call = client.realtime.calls.create(
sdp="sdp",
)
print(call)
content = call.read()
print(content)
Response
v=0
o=- 4227147428 1719357865 IN IP4 127.0.0.1
s=-
c=IN IP4 0.0.0.0
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic:WMS *
a=fingerprint:sha-256 CA:92:52:51:B4:91:3B:34:DD:9C:0B:FB:76:19:7E:3B:F1:21:0F:32:2C:38:01:72:5D:3F:78:C7:5F:8B:C7:36
m=audio 9 UDP/TLS/RTP/SAVPF 111 0 8
a=mid:0
a=ice-ufrag:kZ2qkHXX/u11
a=ice-pwd:uoD16Di5OGx3VbqgA3ymjEQV2kwiOjw6
a=setup:active
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=candidate:993865896 1 udp 2130706431 4.155.146.196 3478 typ host ufrag kZ2qkHXX/u11
a=candidate:1432411780 1 tcp 1671430143 4.155.146.196 443 typ host tcptype passive ufrag kZ2qkHXX/u11
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
a=mid:1
a=sctp-port:5000