User
Add a New Custom LLM Model
Learn how to integrate your custom Large Language Model (LLM) with Bolna Voice AI agents using Bolna APIs.
POST
/
user
/
model
/
custom
cURL
curl --request POST \
--url https://api.bolna.ai/user/model/custom \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"custom_model_name": "Customer-care Model",
"custom_model_url": "https://custom.llm.model/v1"
}
'import requests
url = "https://api.bolna.ai/user/model/custom"
payload = {
"custom_model_name": "Customer-care Model",
"custom_model_url": "https://custom.llm.model/v1"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
custom_model_name: 'Customer-care Model',
custom_model_url: 'https://custom.llm.model/v1'
})
};
fetch('https://api.bolna.ai/user/model/custom', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bolna.ai/user/model/custom",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'custom_model_name' => 'Customer-care Model',
'custom_model_url' => 'https://custom.llm.model/v1'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bolna.ai/user/model/custom"
payload := strings.NewReader("{\n \"custom_model_name\": \"Customer-care Model\",\n \"custom_model_url\": \"https://custom.llm.model/v1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bolna.ai/user/model/custom")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"custom_model_name\": \"Customer-care Model\",\n \"custom_model_url\": \"https://custom.llm.model/v1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bolna.ai/user/model/custom")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"custom_model_name\": \"Customer-care Model\",\n \"custom_model_url\": \"https://custom.llm.model/v1\"\n}"
response = http.request(request)
puts response.read_body{
"message": "model added successfully",
"status": "added"
}{
"error": 123,
"message": "<string>"
}This request specifies how to add your own Custom LLM Models and use it with Bolna Voice AI agents. Please read about it more from using-custom-llm
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Add a custom LLM Model
Was this page helpful?
Previous
OverviewAPI endpoints for managing SIP trunks, gateways, and phone numbers on Bolna. Create, update, list, and delete trunks programmatically.
Next
⌘I
cURL
curl --request POST \
--url https://api.bolna.ai/user/model/custom \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"custom_model_name": "Customer-care Model",
"custom_model_url": "https://custom.llm.model/v1"
}
'import requests
url = "https://api.bolna.ai/user/model/custom"
payload = {
"custom_model_name": "Customer-care Model",
"custom_model_url": "https://custom.llm.model/v1"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
custom_model_name: 'Customer-care Model',
custom_model_url: 'https://custom.llm.model/v1'
})
};
fetch('https://api.bolna.ai/user/model/custom', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bolna.ai/user/model/custom",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'custom_model_name' => 'Customer-care Model',
'custom_model_url' => 'https://custom.llm.model/v1'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bolna.ai/user/model/custom"
payload := strings.NewReader("{\n \"custom_model_name\": \"Customer-care Model\",\n \"custom_model_url\": \"https://custom.llm.model/v1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bolna.ai/user/model/custom")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"custom_model_name\": \"Customer-care Model\",\n \"custom_model_url\": \"https://custom.llm.model/v1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bolna.ai/user/model/custom")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"custom_model_name\": \"Customer-care Model\",\n \"custom_model_url\": \"https://custom.llm.model/v1\"\n}"
response = http.request(request)
puts response.read_body{
"message": "model added successfully",
"status": "added"
}{
"error": 123,
"message": "<string>"
}
