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_id、server_url、participant_token を返します。
前提: クイックスタート で agent_id を用意。
返却値
| フィールド | 用途 |
|---|
call_id | セッション識別 — GET /v1/calls/<call_id> でポーリング |
server_url | WebSocket URL(例: wss://voice.oneinbox.ai)— フロントエンドに渡す |
participant_token | 短期クライアントトークン — フロントに渡す(API キーではない) |
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. 通話ごとのコンテキスト(任意)
variables でプロンプトにコンテキストを注入:{
"agent_id": "<agent_id>",
"variables": {
"customer_name": "Sam",
"order_id": "ORD-001"
}
}
システムプロンプト: The customer name is {{customer_name}}.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. 通話を確認
curl https://api.oneinbox.ai/v1/calls/<call_id> \
-H "Authorization: Bearer <api_key>"
会話終了時に "status": "completed" と transcript 配列を確認。
セキュリティ
フロントには server_url と participant_token のみ返却 — API キーは露出させない。
Web 通話 vs 電話通話
| Web 通話 | 電話通話 |
|---|
| チャネル | ブラウザ / Web アプリ | テレフォニーキャリア PSTN |
| 電話番号 | 不要 | 必要 |
| テレフォニーインテグレーション | 不要 | 必要 |
| ガイド | このページ | 電話通話 |
トラブルシューティング
| 問題 | 対処 |
|---|
401 | Authorization: Bearer <api_key> を確認 |
404 on agent_id | クイックスタート ステップ 2 から agent_id を再取得 |
| ブラウザでトークンが使えない | Web 通話を再作成 — トークンは短期有効 |
次のステップ