简体中文
cURL
curl --request POST \ --url https://app.pathors.com/api/project/{projectId}/integration/vapi/chat/completions \ --header 'Content-Type: application/json' \ --data '{ "messages": [ {} ], "stream": true, "call": {}, "phoneNumber": {}, "customer": {} }'
{ "id": "<string>", "object": "<string>", "created": 123, "model": "<string>", "choices": [ {} ], "session_id": "<string>" }
使用我们的语音 API 服务构建基于电话通话的语音交互。
role
content
{ id: string; // 通话 ID orgId: string; // 组织 ID createdAt: string; // 通话创建时间戳 updatedAt: string; // 通话更新时间戳 type: string; // 通话类型 status: string; // 通话状态 assistantId: string; // 助手 ID customer?: { number: string; // 客户电话号码 }; phoneNumberId?: string; // 电话号码 ID phoneCallProvider?: string; // 通话提供商(如 Twilio) phoneCallProviderId?: string; // 提供商特定的通话 ID phoneCallTransport?: string; // 通话传输方式 }
{ id: string; // 电话号码 ID orgId: string; // 组织 ID number: string; // 电话号码 createdAt: string; // 创建时间戳 updatedAt: string; // 更新时间戳 twilioAccountSid: string;// Twilio 账户 SID twilioAuthToken: string; // Twilio 认证令牌 name: string; // 电话号码名称 provider: string; // 电话提供商 }
{ number: string; // 客户电话号码 }
{ "messages": [ { "role": "user", "content": "你好!" } ], "stream": false, "call": { "id": "call_abc123", "orgId": "org_xyz789", "type": "inbound", "status": "in-progress", "assistantId": "asst_def456" } }
{ "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1677858242, "model": "pathway-default", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "你好!我能帮你什么忙?" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": -1, "completion_tokens": -1, "total_tokens": -1 }, "session_id": "session-xyz789" }