Skip to main content

Vapi

Vapi is a hosted platform for building and operating voice assistants for web and telephone conversations. It coordinates call transport, speech recognition, language-model turns, voice generation, tools, and assistant orchestration so applications can deliver a realtime voice experience through a configured assistant.

Vapi's Custom LLM provider separates that orchestration from the model endpoint. A Vapi assistant can keep its speech services, call handling, and tools in Vapi while its OpenAI-compatible language-model requests pass through AISIX. This allows teams to apply AISIX model aliases, caller authorization, routing, and telemetry to the LLM stage without treating AISIX as the voice runtime.

Configure the Vapi model with the AISIX OpenAI-compatible API root, an AISIX model alias, and a credential containing a dedicated AISIX caller API key.

Prerequisites

Before starting, prepare the following:

  • A Vapi account and an assistant you can edit.
  • A publicly reachable HTTPS AISIX proxy URL.
  • An AISIX caller API key dedicated to the assistant.
  • A model alias the caller key can access through the OpenAI-Compatible API.

Keep the upstream provider credential in AISIX. Vapi should store only the restricted AISIX caller key.

Configure a Custom LLM

First, store the AISIX caller key as the organization-level Custom LLM credential:

  1. In the Vapi dashboard, open Settings → Integrations.
  2. Under Model Providers, select Configure Custom LLM.
  3. Enter the AISIX caller key in API Key. Leave the optional OAuth2 fields empty.
  4. Select Save.

Next, configure the assistant to use AISIX:

  1. Open Assistants, then select the assistant you want to configure.
  2. Select the Model card and choose Custom LLM.
  3. Set Model to the AISIX model alias, for example voice-agent-prod.
  4. Set Custom LLM URL to the AISIX API root, including /v1, for example https://gateway.example.com/v1.
  5. After Vapi saves the draft, select Publish and review the model changes.
  6. Select Next, enter a version name under Publish Description, and select Publish again.

Vapi uses the URL as an OpenAI client base URL and appends /chat/completions. It sends the credential as a bearer token in the Authorization header when it calls the custom endpoint. AISIX authenticates that value as the caller key.

The AISIX alias and its upstream model must support streamed Chat Completions. Vapi can begin synthesizing the answer as text deltas arrive.

Verify the Integration

Run a short web or telephone test and ask for a one-sentence response.

Confirm these results:

  • Vapi returns the response as speech.
  • AISIX records a successful POST /v1/chat/completions request.
  • The caller key and model alias match the dedicated Vapi configuration.

Vapi handles call recording settings, transcripts, speech services, and telephony events. AISIX governs only the LLM exchange that Vapi sends through the custom endpoint.

Verify Tools Separately

Vapi can include OpenAI-compatible tool definitions in Custom LLM requests. If the assistant uses tools, verify the streamed function name, arguments, and tool-call ID through AISIX before relying on the integration in production.

Vapi tool execution can also involve assistant, tool, or account-level server URLs. Those webhook endpoints are separate from the Custom LLM URL and are not replaced by AISIX.

Troubleshoot Vapi Requests

SymptomCheck
Authentication failsConfirm the Custom LLM credential contains the AISIX caller key, not the upstream provider key.
Model is not foundConfirm the Vapi model value is an AISIX alias visible to the caller key.
Response is delayedCheck the Vapi transcriber and voice latency separately from AISIX upstream latency.
Text succeeds but a tool failsVerify Vapi's tool server configuration and the model's streamed function-call shape.

Next Steps