curl --request POST \
--url https://api.b-bot.space/api/v1/invoke_llm \
--header 'Content-Type: application/json' \
--header 'bbot-api-key: <api-key>' \
--data '
{
"expert_id": 37,
"model_id": 6,
"input_data": [
{
"role": "user",
"content": "Hello!"
}
],
"temperature": 1,
"max_tokens": 250
}
'import requests
url = "https://api.b-bot.space/api/v1/invoke_llm"
payload = {
"expert_id": 37,
"model_id": 6,
"input_data": [
{
"role": "user",
"content": "Hello!"
}
],
"temperature": 1,
"max_tokens": 250
}
headers = {
"bbot-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'bbot-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expert_id: 37,
model_id: 6,
input_data: [{role: 'user', content: 'Hello!'}],
temperature: 1,
max_tokens: 250
})
};
fetch('https://api.b-bot.space/api/v1/invoke_llm', 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.b-bot.space/api/v1/invoke_llm",
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([
'expert_id' => 37,
'model_id' => 6,
'input_data' => [
[
'role' => 'user',
'content' => 'Hello!'
]
],
'temperature' => 1,
'max_tokens' => 250
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"bbot-api-key: <api-key>"
],
]);
$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.b-bot.space/api/v1/invoke_llm"
payload := strings.NewReader("{\n \"expert_id\": 37,\n \"model_id\": 6,\n \"input_data\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 250\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("bbot-api-key", "<api-key>")
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.b-bot.space/api/v1/invoke_llm")
.header("bbot-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"expert_id\": 37,\n \"model_id\": 6,\n \"input_data\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 250\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.b-bot.space/api/v1/invoke_llm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["bbot-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expert_id\": 37,\n \"model_id\": 6,\n \"input_data\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 250\n}"
response = http.request(request)
puts response.read_body{
"response": {
"id": "chatcmpl-9kCotn4TY5OcxYc8qFlulso5v8BpC",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
"content": "Hello! How can I assist you today in the realm of marketing psychology for your business?",
"role": "assistant",
"function_call": null,
"tool_calls": null
}
}
],
"created": 1720799395,
"model": "gpt-3.5-turbo-0125",
"object": "chat.completion",
"system_fingerprint": null,
"usage": {
"completion_tokens": 18,
"prompt_tokens": 40,
"total_tokens": 58
}
}
}{
"code": 400,
"message": "Invalid parameters provided.",
"details": "The 'input_data' field is required."
}{
"code": 401,
"message": "Unauthorized access. API key is missing or invalid."
}{
"code": 500,
"message": "An unexpected error occurred on the server.",
"details": "Please try again later."
}Invoke LLM
This endpoint allows you to invoke a language model using specific parameters, such as the expert and model IDs, input data, and additional configuration options.
curl --request POST \
--url https://api.b-bot.space/api/v1/invoke_llm \
--header 'Content-Type: application/json' \
--header 'bbot-api-key: <api-key>' \
--data '
{
"expert_id": 37,
"model_id": 6,
"input_data": [
{
"role": "user",
"content": "Hello!"
}
],
"temperature": 1,
"max_tokens": 250
}
'import requests
url = "https://api.b-bot.space/api/v1/invoke_llm"
payload = {
"expert_id": 37,
"model_id": 6,
"input_data": [
{
"role": "user",
"content": "Hello!"
}
],
"temperature": 1,
"max_tokens": 250
}
headers = {
"bbot-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'bbot-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expert_id: 37,
model_id: 6,
input_data: [{role: 'user', content: 'Hello!'}],
temperature: 1,
max_tokens: 250
})
};
fetch('https://api.b-bot.space/api/v1/invoke_llm', 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.b-bot.space/api/v1/invoke_llm",
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([
'expert_id' => 37,
'model_id' => 6,
'input_data' => [
[
'role' => 'user',
'content' => 'Hello!'
]
],
'temperature' => 1,
'max_tokens' => 250
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"bbot-api-key: <api-key>"
],
]);
$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.b-bot.space/api/v1/invoke_llm"
payload := strings.NewReader("{\n \"expert_id\": 37,\n \"model_id\": 6,\n \"input_data\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 250\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("bbot-api-key", "<api-key>")
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.b-bot.space/api/v1/invoke_llm")
.header("bbot-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"expert_id\": 37,\n \"model_id\": 6,\n \"input_data\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 250\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.b-bot.space/api/v1/invoke_llm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["bbot-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expert_id\": 37,\n \"model_id\": 6,\n \"input_data\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ],\n \"temperature\": 1,\n \"max_tokens\": 250\n}"
response = http.request(request)
puts response.read_body{
"response": {
"id": "chatcmpl-9kCotn4TY5OcxYc8qFlulso5v8BpC",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
"content": "Hello! How can I assist you today in the realm of marketing psychology for your business?",
"role": "assistant",
"function_call": null,
"tool_calls": null
}
}
],
"created": 1720799395,
"model": "gpt-3.5-turbo-0125",
"object": "chat.completion",
"system_fingerprint": null,
"usage": {
"completion_tokens": 18,
"prompt_tokens": 40,
"total_tokens": 58
}
}
}{
"code": 400,
"message": "Invalid parameters provided.",
"details": "The 'input_data' field is required."
}{
"code": 401,
"message": "Unauthorized access. API key is missing or invalid."
}{
"code": 500,
"message": "An unexpected error occurred on the server.",
"details": "Please try again later."
}YOUR_API_KEY_HERE with the actual API key generated
from your profile in the B-Bot hub.temperature parameter is optional. If not provided, a default value will
be used.max_tokens parameter is optional. If not provided, a default value will
be used.Authorizations
API key for authentication
Body
This endpoint allows you to invoke a language model using specific parameters, such as the expert and model IDs, input data, and additional configuration options.
The ID of the expert you want to invoke.
37
The ID of the language model to be used.
6
A list of message objects containing the role and content of the input data.
Show child attributes
Show child attributes
The sampling temperature, which controls the randomness of the model's outputs.
1
The maximum number of tokens (words or word pieces) to generate in the response.
250
Response
Successful response with generated content
Show child attributes
Show child attributes