OpenAI Live
Send a request through RunAPI's OpenAI-compatible Live operation.
개요
Use RunAPI's OpenAI-compatible Live operation with a compatible model and the protocol's request and response shapes.
빠른 시작
- API 키를 만들고 RUNAPI_API_KEY로 설정합니다.
- 호환되는 모델을 선택한 후 문서화된 경로 매개변수와 JSON 본문을 전송합니다.
- 해당 작업에 대한 JSON 응답 또는 서버 전송 이벤트를 읽고 프로토콜 오류를 처리하세요.
엔드포인트
- Base URL
https://runapi.ai- 계약 버전
v1- 권장 인증 방식
Authorization: Bearer YOUR_API_TOKEN
인증 정보 전달 방식
RunAPI는 아래 나열된 각 캐리어를 허용합니다. 생성된 샘플은 프로토콜의 기본 헤더를 사용합니다.
- header - 권장
Authorization: Bearer YOUR_API_TOKEN- header
x-api-key: YOUR_API_TOKEN
호환 모델
현재 가격, 속도 제한 및 상업적 이용 세부 정보는 모델 페이지를 여십시오.
호환 모델 1개 보기
요청 계약
공개 프로토콜과 RunAPI 지원이 모두 확인된 필드만 나열됩니다. 추가 JSON 본문 필드는 그대로 전달됩니다.
JSON 본문필드 18개
delegation["object", "null"]선택적 client 또는 Responses 위임 계약으로, 제공자 측 형식을 사용합니다.
delegation.responsesobjecttype이 responses일 때 위임된 작업의 백엔드 설정입니다.
delegation.responses.instructionsstring위임된 작업에 사용할 백엔드 프롬프트입니다.
delegation.responses.max_output_tokensinteger위임된 응답의 출력 토큰 예산으로, 최소 16입니다.
delegation.responses.modelstring위임된 작업을 실행하는 Responses 모델입니다.
delegation.responses.parallel_tool_callsbooleanAllow independent delegated tool calls in one turn.
delegation.responses.reasoningobjectReasoning settings for the delegated model.
delegation.responses.service_tierstringService tier requested for the delegated response.
delegation.responses.textobjectText output settings for the delegated response.
delegation.responses.tool_choice["string", "object"]Which delegated tools the backend may use.
delegation.responses.toolsarray위임된 호출이 사용할 수 있는 호스팅 Responses 도구입니다.
delegation.responses.tools[].typestringweb_search, web_search_preview, file_search, computer_use_preview
delegation.toolsarraytype이 client일 때 클라이언트가 보유한 function 도구입니다.
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.
요청 예시
{
"delegation": {
"responses": {
"model": "gpt-5.6-terra",
"tools": [
{
"type": "web_search"
}
]
},
"type": "responses"
},
"model": "gpt-live-1",
"sdp": "v=0",
"transport": "webrtc"
}
동기 응답
스키마
{
"additionalProperties": true,
"properties": {
"session": {
"additionalProperties": true,
"type": "object"
},
"transport": {
"additionalProperties": true,
"type": "object"
}
},
"required": [
"session",
"transport"
],
"type": "object"
}
예시
{
"session": {
"id": "live_123"
},
"transport": {
"sdp": "answer",
"type": "webrtc"
}
}
프로토콜 오류: invalid_request
스키마
{
"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"
}
예시
{
"error": {
"code": null,
"message": "Invalid Live session request",
"param": "sdp",
"type": "invalid_request_error"
}
}
사용량
스키마
{
"additionalProperties": true,
"properties": {
"duration_seconds": {
"type": "number"
}
},
"required": [
"duration_seconds"
],
"type": "object"
}
예시
{
"duration_seconds": 3
}
생성된 코드 샘플
각 cURL, JavaScript, Python 예제는 프로토콜별 SDK 없이도 이 계약에서 검증된 요청을 전송합니다.
설치
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", "responses": {"model": "gpt-5.6-terra", "tools": [{"type": "web_search"}]}}}
)
response.raise_for_status()
print(response.json())