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": "Qwen/Qwen2.5-3B-Instruct",
"custom_model_url": "https://your-host/v1",
"custom_model_key": "your-endpoint-key",
"custom_model_family": "qwen"
}
'import requests
url = "https://api.bolna.ai/user/model/custom"
payload = {
"custom_model_name": "Qwen/Qwen2.5-3B-Instruct",
"custom_model_url": "https://your-host/v1",
"custom_model_key": "your-endpoint-key",
"custom_model_family": "qwen"
}
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: 'Qwen/Qwen2.5-3B-Instruct',
custom_model_url: 'https://your-host/v1',
custom_model_key: 'your-endpoint-key',
custom_model_family: 'qwen'
})
};
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' => 'Qwen/Qwen2.5-3B-Instruct',
'custom_model_url' => 'https://your-host/v1',
'custom_model_key' => 'your-endpoint-key',
'custom_model_family' => 'qwen'
]),
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\": \"Qwen/Qwen2.5-3B-Instruct\",\n \"custom_model_url\": \"https://your-host/v1\",\n \"custom_model_key\": \"your-endpoint-key\",\n \"custom_model_family\": \"qwen\"\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\": \"Qwen/Qwen2.5-3B-Instruct\",\n \"custom_model_url\": \"https://your-host/v1\",\n \"custom_model_key\": \"your-endpoint-key\",\n \"custom_model_family\": \"qwen\"\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\": \"Qwen/Qwen2.5-3B-Instruct\",\n \"custom_model_url\": \"https://your-host/v1\",\n \"custom_model_key\": \"your-endpoint-key\",\n \"custom_model_family\": \"qwen\"\n}"
response = http.request(request)
puts response.read_body{
"message": "model added successfully",
"status": "added"
}{
"error": 123,
"message": "<string>"
}{
"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
The model id your endpoint serves, passed through unchanged
OpenAI-compatible base URL, including the version segment
Bearer token sent to your endpoint. Stored encrypted
Model family, for example qwen, llama or mistral
Comma separated language codes. Defaults to en
Was this page helpful?
โ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": "Qwen/Qwen2.5-3B-Instruct",
"custom_model_url": "https://your-host/v1",
"custom_model_key": "your-endpoint-key",
"custom_model_family": "qwen"
}
'import requests
url = "https://api.bolna.ai/user/model/custom"
payload = {
"custom_model_name": "Qwen/Qwen2.5-3B-Instruct",
"custom_model_url": "https://your-host/v1",
"custom_model_key": "your-endpoint-key",
"custom_model_family": "qwen"
}
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: 'Qwen/Qwen2.5-3B-Instruct',
custom_model_url: 'https://your-host/v1',
custom_model_key: 'your-endpoint-key',
custom_model_family: 'qwen'
})
};
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' => 'Qwen/Qwen2.5-3B-Instruct',
'custom_model_url' => 'https://your-host/v1',
'custom_model_key' => 'your-endpoint-key',
'custom_model_family' => 'qwen'
]),
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\": \"Qwen/Qwen2.5-3B-Instruct\",\n \"custom_model_url\": \"https://your-host/v1\",\n \"custom_model_key\": \"your-endpoint-key\",\n \"custom_model_family\": \"qwen\"\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\": \"Qwen/Qwen2.5-3B-Instruct\",\n \"custom_model_url\": \"https://your-host/v1\",\n \"custom_model_key\": \"your-endpoint-key\",\n \"custom_model_family\": \"qwen\"\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\": \"Qwen/Qwen2.5-3B-Instruct\",\n \"custom_model_url\": \"https://your-host/v1\",\n \"custom_model_key\": \"your-endpoint-key\",\n \"custom_model_family\": \"qwen\"\n}"
response = http.request(request)
puts response.read_body{
"message": "model added successfully",
"status": "added"
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}
