メインコンテンツへスキップ

Documentation Index

Fetch the complete documentation index at: https://docs.oneinbox.ai/llms.txt

Use this file to discover all available pages before exploring further.

概要

Web 通話は OneInbox API で作成する通話セッションです。バックエンドでブラウザ音声を支えるリソースです。 Web 通話を作成すると、OneInbox は call_idserver_urlparticipant_token を返します。 前提: クイックスタートagent_id を用意。

返却値

フィールド用途
call_idセッション識別 — GET /v1/calls/<call_id> でポーリング
server_urlWebSocket URL(例: wss://voice.oneinbox.ai)— フロントエンドに渡す
participant_token短期クライアントトークン — フロントに渡す(API キーではない)

1

1. Web 通話を作成

curl -X POST https://api.oneinbox.ai/v1/calls/web \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "<agent_id>",
    "variables": { "customer_name": "Guest" }
  }'
{
  "id": "call_abc123",
  "server_url": "wss://voice.oneinbox.ai",
  "participant_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
2

2. 通話ごとのコンテキスト(任意)

variables でプロンプトにコンテキストを注入:
{
  "agent_id": "<agent_id>",
  "variables": {
    "customer_name": "Sam",
    "order_id": "ORD-001"
  }
}
システムプロンプト: The customer name is {{customer_name}}.
3

3. 音声・モデルの上書き(任意)

エージェントを更新せず、1 通話だけ TTS または LLM を変更:
curl -X POST https://api.oneinbox.ai/v1/calls/web \
  -H "Authorization: Bearer <api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "<agent_id>",
    "overrides": {
      "tts": {
        "provider": "cartesia",
        "voice_id": "a0e99841-438c-4a64-b679-ae501e7d6091"
      },
      "first_message": "Hi! How can I help you today?"
    }
  }'
Web 通話開始ボイス を参照。
4

4. 通話を確認

curl https://api.oneinbox.ai/v1/calls/<call_id> \
  -H "Authorization: Bearer <api_key>"
会話終了時に "status": "completed"transcript 配列を確認。

セキュリティ

フロントには server_urlparticipant_token のみ返却 — API キーは露出させない。

Web 通話 vs 電話通話

Web 通話電話通話
チャネルブラウザ / Web アプリテレフォニーキャリア PSTN
電話番号不要必要
テレフォニーインテグレーション不要必要
ガイドこのページ電話通話

トラブルシューティング

問題対処
401Authorization: Bearer <api_key> を確認
404 on agent_idクイックスタート ステップ 2 から agent_id を再取得
ブラウザでトークンが使えないWeb 通話を再作成 — トークンは短期有効

次のステップ