コンテンツへスキップ
APIリファレンス
APIリファレンス

OpenAI Live

Send a request through RunAPI's OpenAI-compatible Live operation.

01

概要

Use RunAPI's OpenAI-compatible Live operation with a compatible model and the protocol's request and response shapes.

クイックスタート

  1. APIキーを作成し、RUNAPI_API_KEYとして設定します。
  2. 互換性のあるモデルを選択し、ドキュメントに記載されたパスパラメーターとJSONボディを送信します。
  3. このオペレーションに示された JSON レスポンスまたはサーバー送信イベントを読み取り、プロトコルエラーを処理してください。

エンドポイント

POST /v1/live/webrtc
ベースURL
https://runapi.ai
コントラクトバージョン
v1
推奨認証方式
Authorization: Bearer YOUR_API_TOKEN
02

認証情報の送信方法

RunAPIは以下に列挙された各キャリアを受け付けます。生成されたサンプルはプロトコルの推奨ヘッダーを使用します。

header - 推奨
Authorization: Bearer YOUR_API_TOKEN
header
x-api-key: YOUR_API_TOKEN
03

互換モデル

現在の料金、レート制限、商用利用の詳細については、モデルページを開いてください。

互換モデルを1件表示
04

リクエスト仕様

JSONボディ

公開プロトコルとRunAPIサポートの両方の証拠があるフィールドのみが記載されています。追加のJSONボディフィールドはそのまま渡されます。

JSON ボディフィールド15件
delegation["object", "null"]
任意

Optional client or Responses delegation contract.

delegation.instructionsstring
任意

Backend prompt for delegated work when type is responses.

delegation.max_output_tokensinteger
任意

Output token budget for the delegated response.

delegation.modelstring
任意

Responses model that runs delegated work when type is responses.

delegation.parallel_tool_callsboolean
任意

Allow independent delegated tool calls in one turn.

delegation.reasoningobject
任意

Reasoning settings for the delegated model.

delegation.service_tierstring
任意

Service tier requested for the delegated response.

delegation.textobject
任意

Text output settings for the delegated response.

delegation.tool_choice["string", "object"]
任意

Which delegated tools the backend may use.

delegation.toolsarray
任意

Hosted Responses tools, or client-owned function tools when type is client.

delegation.tools[].typestring
必須
delegation.typestring
任意 許可される値: client, responses
modelstring
必須

RunAPI model identifier; Live currently supports gpt-live-1.

sdpstring
必須

Client SDP offer for the WebRTC session.

transportstring
必須

WebRTC session negotiation transport.

リクエスト例

JSON
{
  "delegation": {
    "model": "gpt-5.6-terra",
    "tools": [
      {
        "type": "web_search_preview"
      }
    ],
    "type": "responses"
  },
  "model": "gpt-live-1",
  "sdp": "v=0",
  "transport": "webrtc"
}
05

同期レスポンス

HTTP 201

スキーマ

JSON
{
  "additionalProperties": true,
  "properties": {
    "session": {
      "additionalProperties": true,
      "type": "object"
    },
    "transport": {
      "additionalProperties": true,
      "type": "object"
    }
  },
  "required": [
    "session",
    "transport"
  ],
  "type": "object"
}

JSON
{
  "session": {
    "id": "live_123"
  },
  "transport": {
    "sdp": "answer",
    "type": "webrtc"
  }
}
06

プロトコルエラー: invalid_request

HTTP 400

スキーマ

JSON
{
  "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"
}

JSON
{
  "error": {
    "code": null,
    "message": "Invalid Live session request",
    "param": "sdp",
    "type": "invalid_request_error"
  }
}
07

使用方法

スキーマ

JSON
{
  "additionalProperties": true,
  "properties": {
    "duration_seconds": {
      "type": "number"
    }
  },
  "required": [
    "duration_seconds"
  ],
  "type": "object"
}

JSON
{
  "duration_seconds": 3
}
08

生成されたコードサンプル

各cURL、JavaScript、およびPythonのサンプルは、プロトコル固有のSDKを必要とせずに、このコントラクトから検証済みのリクエストを送信します。

インストール

Shell
pip install requests
PYTHON
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())