OpenAI Live
Send a request through RunAPI's OpenAI-compatible Live operation.
Genel Bakış
Use RunAPI's OpenAI-compatible Live operation with a compatible model and the protocol's request and response shapes.
Hızlı başlangıç
- Bir API anahtarı oluşturun ve RUNAPI_API_KEY olarak ayarlayın.
- Uyumlu bir model seçin, ardından belgelenen yol parametrelerini ve JSON gövdesini gönderin.
- Bu işlem için gösterilen JSON yanıtını veya sunucu tarafından gönderilen olayları okuyun ve protokol hatalarını işleyin.
Uç Nokta
- Temel URL
https://runapi.ai- Sözleşme sürümü
v1- Tercih edilen kimlik doğrulama
Authorization: Bearer YOUR_API_TOKEN
Kimlik doğrulama taşıyıcıları
RunAPI aşağıda listelenen her taşıyıcıyı kabul eder. Oluşturulan örnekler, protokolün tercih ettiği başlığı kullanır.
- header - Tercih edilen
Authorization: Bearer YOUR_API_TOKEN- header
x-api-key: YOUR_API_TOKEN
Uyumlu modeller
Güncel fiyatlandırma, hız sınırları ve ticari kullanım ayrıntıları için bir model sayfası açın.
1 uyumlu model göster
İstek sözleşmesi
Yalnızca hem genel protokol hem de RunAPI destek kanıtı olan alanlar listelenmektedir. Ek JSON gövde alanları doğrudan iletilir.
JSON gövdesi15 alan
delegation["object", "null"]Optional client or Responses delegation contract.
delegation.instructionsstringBackend prompt for delegated work when type is responses.
delegation.max_output_tokensintegerOutput token budget for the delegated response.
delegation.modelstringResponses model that runs delegated work when type is responses.
delegation.parallel_tool_callsbooleanAllow independent delegated tool calls in one turn.
delegation.reasoningobjectReasoning settings for the delegated model.
delegation.service_tierstringService tier requested for the delegated response.
delegation.textobjectText output settings for the delegated response.
delegation.tool_choice["string", "object"]Which delegated tools the backend may use.
delegation.toolsarrayHosted Responses tools, or client-owned function tools when type is client.
delegation.tools[].typestringdelegation.typestringclient, responses
modelstringRunAPI model identifier; Live currently supports gpt-live-1.
sdpstringClient SDP offer for the WebRTC session.
transportstringWebRTC session negotiation transport.
İstek örneği
{
"delegation": {
"model": "gpt-5.6-terra",
"tools": [
{
"type": "web_search_preview"
}
],
"type": "responses"
},
"model": "gpt-live-1",
"sdp": "v=0",
"transport": "webrtc"
}
Eş zamanlı yanıt
Şema
{
"additionalProperties": true,
"properties": {
"session": {
"additionalProperties": true,
"type": "object"
},
"transport": {
"additionalProperties": true,
"type": "object"
}
},
"required": [
"session",
"transport"
],
"type": "object"
}
Örnek
{
"session": {
"id": "live_123"
},
"transport": {
"sdp": "answer",
"type": "webrtc"
}
}
Protokol hatası: invalid_request
Şema
{
"additionalProperties": true,
"properties": {
"error": {
"additionalProperties": true,
"properties": {
"code": {
"type": [
"string",
"null"
]
},
"message": {
"type": "string"
},
"param": {
"type": [
"string",
"null"
]
},
"type": {
"type": "string"
}
},
"required": [
"message",
"type"
],
"type": "object"
}
},
"required": [
"error"
],
"type": "object"
}
Örnek
{
"error": {
"code": null,
"message": "Invalid Live session request",
"param": "sdp",
"type": "invalid_request_error"
}
}
Kullanım
Şema
{
"additionalProperties": true,
"properties": {
"duration_seconds": {
"type": "number"
}
},
"required": [
"duration_seconds"
],
"type": "object"
}
Örnek
{
"duration_seconds": 3
}
Oluşturulan Kod Örnekleri
Her cURL, JavaScript ve Python örneği, protokole özgü bir SDK gerektirmeden bu sözleşmedeki doğrulanmış isteği gönderir.
Yükle
pip install requests
import requests
response = requests.post(
"https://runapi.ai/v1/live/webrtc",
headers={"Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json"},
json={"model": "gpt-live-1", "transport": "webrtc", "sdp": "v=0", "delegation": {"type": "responses", "model": "gpt-5.6-terra", "tools": [{"type": "web_search_preview"}]}}
)
response.raise_for_status()
print(response.json())