Bug report: Custom LLM appends /chat/completions t...
# support
i
When using custom LLM implementation, whatever URL you provide will end up as URL + "/chat/completions". VAPI should not alter this URL you should use the URL as is without modification.
v
Current Behavior: Vapi automatically appends
/chat/completions
to the custom LLM URL you provide, as shown in the official documentation's Flask example:
Copy code
python
@app.route("/chat/completions", methods=["POST"])
def chat_completions():
    # Handle request
At this time, there is no documented way to prevent this URL modification—Vapi expects your server to handle requests at the
/chat/completions
path.
For more details, see the [Vapi Custom LLM integration guide](https://docs.vapi.ai/customization/custom-llm/using-your-server). Source: - [Vapi Custom LLM: Using Your Server](https://docs.vapi.ai/customization/custom-llm/using-your-server)
i
This is bad design
On assistant request, we construct a stateful URL to include chatId, agent type, etc. So VAPI urls always look like https://url.com/vapi/llm?chatId=1234&agent=chat/chat/completions. Your code is NOT acknowledging url parameters it simply appends the /chat/completions onto the end of the url creating a bad URL.
c
Hi ian, Vapi indeed appends
/chat/completions
to the custom LLM URL you provide. To accommodate this design, ensure that your server is set up to handle requests at the
/chat/completions
endpoint. This behavior is outlined in the [Vapi Custom LLM integration guide](https://docs.vapi.ai/customization/custom-llm/using-your-server). If you need to include additional parameters in your URL, consider handling these parameters in your server logic. Unfortunately, as it currently stands, Vapi does not support bypassing this URL modification. Setting up a proxy endpoint to reroute requests could be a workaround if your server requires a specific URL structure.