VAPI Integration
Build voice-based interactions using our Voice API service for phone calls.
VAPI Integration
The VAPI integration provides a chat completions endpoint specifically designed for handling phone call conversations through the Voice API service.
Chat Completions
Path Parameters
The ID of your project
Request Body
Array of messages in the conversation. Each message should have a role
(“system”, “user”, or “assistant”) and content
.
Whether to stream the response. Defaults to false.
Information about the current call session.
Optional phone number configuration.
Optional customer information.
Example request:
Response
The response format is identical to the API integration’s chat completions endpoint, with the addition of session management for phone calls.
Unique identifier for the completion
Object type (“chat.completion”)
Unix timestamp of when the completion was created
Model used for the completion
Array of completion choices
Session ID for the conversation
Example response:
Streaming Response
The streaming response format is identical to the API integration’s streaming format.
Error Responses
Status Code | Description |
---|---|
400 | Invalid request body or missing call ID |
500 | Internal server error |
Session Management
The VAPI integration automatically manages sessions based on the call ID. It will:
- Look up existing sessions for returning callers
- Create new sessions for first-time callers
- Maintain conversation context throughout the call