Create Chat (OpenAI Compatible)
Authentication
Authenticate server-side requests with a private Vapi API key. Create or copy a key from the Vapi Dashboard and send it in the Authorization header as Bearer <token>. Keep private API keys out of client-side code and public repositories.
Request
This is the assistant that will be used for the chat. To use an existing assistant, use assistantId instead.
This is the assistant that will be used for the chat. To use an existing assistant, use assistantId instead.
These are the variable values that will be used to replace template variables in the assistant messages. Only variable substitution is supported in chat contexts - other assistant properties cannot be overridden.
This is the squad that will be used for the chat. To use a transient squad, use squad instead.
This is the squad that will be used for the chat. To use an existing squad, use squadId instead.
This is used to send the chat through a transport like SMS. If transport.phoneNumberId and transport.customer are provided, creates a new session. If sessionId is provided without transport fields, uses existing session data. Cannot specify both sessionId and transport fields (phoneNumberId/customer) together.
Response
OpenAI Responses API format - either non-streaming or streaming