Ask questions
curl --request POST \
--url https://api.bespokelabs.ai/v1/systemone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "nimble-latest",
"state": "The customer was charged twice and asks for a refund. The service still works.",
"questions": {
"refund": {
"type": "noul",
"instructions": "Does the customer request a refund?"
},
"department": {
"type": "choice",
"instructions": "Which department should handle this request?",
"criteria": {
"billing": "Charges, payments and refunds",
"technical": "Software bugs and outages"
}
},
"urgency": {
"type": "score",
"instructions": "How urgent is this request?",
"criteria": [
"Routine billing request; service works",
"Some functionality unavailable",
"Complete service outage"
]
}
}
}
'import requests
url = "https://api.bespokelabs.ai/v1/systemone"
payload = {
"model": "nimble-latest",
"state": "The customer was charged twice and asks for a refund. The service still works.",
"questions": {
"refund": {
"type": "noul",
"instructions": "Does the customer request a refund?"
},
"department": {
"type": "choice",
"instructions": "Which department should handle this request?",
"criteria": {
"billing": "Charges, payments and refunds",
"technical": "Software bugs and outages"
}
},
"urgency": {
"type": "score",
"instructions": "How urgent is this request?",
"criteria": ["Routine billing request; service works", "Some functionality unavailable", "Complete service outage"]
}
}
}
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({
model: 'nimble-latest',
state: 'The customer was charged twice and asks for a refund. The service still works.',
questions: {
refund: {type: 'noul', instructions: 'Does the customer request a refund?'},
department: {
type: 'choice',
instructions: 'Which department should handle this request?',
criteria: {
billing: 'Charges, payments and refunds',
technical: 'Software bugs and outages'
}
},
urgency: {
type: 'score',
instructions: 'How urgent is this request?',
criteria: [
'Routine billing request; service works',
'Some functionality unavailable',
'Complete service outage'
]
}
}
})
};
fetch('https://api.bespokelabs.ai/v1/systemone', 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.bespokelabs.ai/v1/systemone",
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([
'model' => 'nimble-latest',
'state' => 'The customer was charged twice and asks for a refund. The service still works.',
'questions' => [
'refund' => [
'type' => 'noul',
'instructions' => 'Does the customer request a refund?'
],
'department' => [
'type' => 'choice',
'instructions' => 'Which department should handle this request?',
'criteria' => [
'billing' => 'Charges, payments and refunds',
'technical' => 'Software bugs and outages'
]
],
'urgency' => [
'type' => 'score',
'instructions' => 'How urgent is this request?',
'criteria' => [
'Routine billing request; service works',
'Some functionality unavailable',
'Complete service outage'
]
]
]
]),
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.bespokelabs.ai/v1/systemone"
payload := strings.NewReader("{\n \"model\": \"nimble-latest\",\n \"state\": \"The customer was charged twice and asks for a refund. The service still works.\",\n \"questions\": {\n \"refund\": {\n \"type\": \"noul\",\n \"instructions\": \"Does the customer request a refund?\"\n },\n \"department\": {\n \"type\": \"choice\",\n \"instructions\": \"Which department should handle this request?\",\n \"criteria\": {\n \"billing\": \"Charges, payments and refunds\",\n \"technical\": \"Software bugs and outages\"\n }\n },\n \"urgency\": {\n \"type\": \"score\",\n \"instructions\": \"How urgent is this request?\",\n \"criteria\": [\n \"Routine billing request; service works\",\n \"Some functionality unavailable\",\n \"Complete service outage\"\n ]\n }\n }\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.bespokelabs.ai/v1/systemone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"nimble-latest\",\n \"state\": \"The customer was charged twice and asks for a refund. The service still works.\",\n \"questions\": {\n \"refund\": {\n \"type\": \"noul\",\n \"instructions\": \"Does the customer request a refund?\"\n },\n \"department\": {\n \"type\": \"choice\",\n \"instructions\": \"Which department should handle this request?\",\n \"criteria\": {\n \"billing\": \"Charges, payments and refunds\",\n \"technical\": \"Software bugs and outages\"\n }\n },\n \"urgency\": {\n \"type\": \"score\",\n \"instructions\": \"How urgent is this request?\",\n \"criteria\": [\n \"Routine billing request; service works\",\n \"Some functionality unavailable\",\n \"Complete service outage\"\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bespokelabs.ai/v1/systemone")
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 \"model\": \"nimble-latest\",\n \"state\": \"The customer was charged twice and asks for a refund. The service still works.\",\n \"questions\": {\n \"refund\": {\n \"type\": \"noul\",\n \"instructions\": \"Does the customer request a refund?\"\n },\n \"department\": {\n \"type\": \"choice\",\n \"instructions\": \"Which department should handle this request?\",\n \"criteria\": {\n \"billing\": \"Charges, payments and refunds\",\n \"technical\": \"Software bugs and outages\"\n }\n },\n \"urgency\": {\n \"type\": \"score\",\n \"instructions\": \"How urgent is this request?\",\n \"criteria\": [\n \"Routine billing request; service works\",\n \"Some functionality unavailable\",\n \"Complete service outage\"\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"model": "nimble-latest",
"answers": {
"refund": {
"type": "noul",
"noul": 0.998
},
"department": {
"type": "choice",
"choice": "billing",
"probabilities": {
"billing": 1,
"technical": 0
},
"confidence": 1
},
"urgency": {
"type": "score",
"score": 0,
"legend": {
"0": "Routine billing request; service works",
"1": "Some functionality unavailable",
"2": "Complete service outage"
},
"probabilities": {
"0": 1,
"1": 0,
"2": 0
},
"confidence": 1
}
},
"usage": {
"input_tokens": 338,
"output_tokens": 4
}
}{
"detail": "<unknown>",
"request_id": "<string>"
}{
"detail": "<unknown>",
"request_id": "<string>"
}{
"detail": "<unknown>",
"request_id": "<string>"
}{
"detail": "<unknown>",
"request_id": "<string>"
}{
"detail": "<unknown>",
"request_id": "<string>"
}{
"detail": "<unknown>",
"request_id": "<string>"
}{
"detail": "<unknown>",
"request_id": "<string>"
}{
"detail": "<unknown>",
"request_id": "<string>"
}{
"detail": "<unknown>",
"request_id": "<string>"
}Nimble API
Ask questions
Nimble’s System One endpoint: ask up to 64 yes/no, multiple-choice, or rating questions about text or JSON, and get a probability for every answer.
POST
/
v1
/
systemone
Ask questions
curl --request POST \
--url https://api.bespokelabs.ai/v1/systemone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "nimble-latest",
"state": "The customer was charged twice and asks for a refund. The service still works.",
"questions": {
"refund": {
"type": "noul",
"instructions": "Does the customer request a refund?"
},
"department": {
"type": "choice",
"instructions": "Which department should handle this request?",
"criteria": {
"billing": "Charges, payments and refunds",
"technical": "Software bugs and outages"
}
},
"urgency": {
"type": "score",
"instructions": "How urgent is this request?",
"criteria": [
"Routine billing request; service works",
"Some functionality unavailable",
"Complete service outage"
]
}
}
}
'import requests
url = "https://api.bespokelabs.ai/v1/systemone"
payload = {
"model": "nimble-latest",
"state": "The customer was charged twice and asks for a refund. The service still works.",
"questions": {
"refund": {
"type": "noul",
"instructions": "Does the customer request a refund?"
},
"department": {
"type": "choice",
"instructions": "Which department should handle this request?",
"criteria": {
"billing": "Charges, payments and refunds",
"technical": "Software bugs and outages"
}
},
"urgency": {
"type": "score",
"instructions": "How urgent is this request?",
"criteria": ["Routine billing request; service works", "Some functionality unavailable", "Complete service outage"]
}
}
}
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({
model: 'nimble-latest',
state: 'The customer was charged twice and asks for a refund. The service still works.',
questions: {
refund: {type: 'noul', instructions: 'Does the customer request a refund?'},
department: {
type: 'choice',
instructions: 'Which department should handle this request?',
criteria: {
billing: 'Charges, payments and refunds',
technical: 'Software bugs and outages'
}
},
urgency: {
type: 'score',
instructions: 'How urgent is this request?',
criteria: [
'Routine billing request; service works',
'Some functionality unavailable',
'Complete service outage'
]
}
}
})
};
fetch('https://api.bespokelabs.ai/v1/systemone', 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.bespokelabs.ai/v1/systemone",
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([
'model' => 'nimble-latest',
'state' => 'The customer was charged twice and asks for a refund. The service still works.',
'questions' => [
'refund' => [
'type' => 'noul',
'instructions' => 'Does the customer request a refund?'
],
'department' => [
'type' => 'choice',
'instructions' => 'Which department should handle this request?',
'criteria' => [
'billing' => 'Charges, payments and refunds',
'technical' => 'Software bugs and outages'
]
],
'urgency' => [
'type' => 'score',
'instructions' => 'How urgent is this request?',
'criteria' => [
'Routine billing request; service works',
'Some functionality unavailable',
'Complete service outage'
]
]
]
]),
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.bespokelabs.ai/v1/systemone"
payload := strings.NewReader("{\n \"model\": \"nimble-latest\",\n \"state\": \"The customer was charged twice and asks for a refund. The service still works.\",\n \"questions\": {\n \"refund\": {\n \"type\": \"noul\",\n \"instructions\": \"Does the customer request a refund?\"\n },\n \"department\": {\n \"type\": \"choice\",\n \"instructions\": \"Which department should handle this request?\",\n \"criteria\": {\n \"billing\": \"Charges, payments and refunds\",\n \"technical\": \"Software bugs and outages\"\n }\n },\n \"urgency\": {\n \"type\": \"score\",\n \"instructions\": \"How urgent is this request?\",\n \"criteria\": [\n \"Routine billing request; service works\",\n \"Some functionality unavailable\",\n \"Complete service outage\"\n ]\n }\n }\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.bespokelabs.ai/v1/systemone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"nimble-latest\",\n \"state\": \"The customer was charged twice and asks for a refund. The service still works.\",\n \"questions\": {\n \"refund\": {\n \"type\": \"noul\",\n \"instructions\": \"Does the customer request a refund?\"\n },\n \"department\": {\n \"type\": \"choice\",\n \"instructions\": \"Which department should handle this request?\",\n \"criteria\": {\n \"billing\": \"Charges, payments and refunds\",\n \"technical\": \"Software bugs and outages\"\n }\n },\n \"urgency\": {\n \"type\": \"score\",\n \"instructions\": \"How urgent is this request?\",\n \"criteria\": [\n \"Routine billing request; service works\",\n \"Some functionality unavailable\",\n \"Complete service outage\"\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bespokelabs.ai/v1/systemone")
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 \"model\": \"nimble-latest\",\n \"state\": \"The customer was charged twice and asks for a refund. The service still works.\",\n \"questions\": {\n \"refund\": {\n \"type\": \"noul\",\n \"instructions\": \"Does the customer request a refund?\"\n },\n \"department\": {\n \"type\": \"choice\",\n \"instructions\": \"Which department should handle this request?\",\n \"criteria\": {\n \"billing\": \"Charges, payments and refunds\",\n \"technical\": \"Software bugs and outages\"\n }\n },\n \"urgency\": {\n \"type\": \"score\",\n \"instructions\": \"How urgent is this request?\",\n \"criteria\": [\n \"Routine billing request; service works\",\n \"Some functionality unavailable\",\n \"Complete service outage\"\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"model": "nimble-latest",
"answers": {
"refund": {
"type": "noul",
"noul": 0.998
},
"department": {
"type": "choice",
"choice": "billing",
"probabilities": {
"billing": 1,
"technical": 0
},
"confidence": 1
},
"urgency": {
"type": "score",
"score": 0,
"legend": {
"0": "Routine billing request; service works",
"1": "Some functionality unavailable",
"2": "Complete service outage"
},
"probabilities": {
"0": 1,
"1": 0,
"2": 0
},
"confidence": 1
}
},
"usage": {
"input_tokens": 338,
"output_tokens": 4
}
}{
"detail": "<unknown>",
"request_id": "<string>"
}{
"detail": "<unknown>",
"request_id": "<string>"
}{
"detail": "<unknown>",
"request_id": "<string>"
}{
"detail": "<unknown>",
"request_id": "<string>"
}{
"detail": "<unknown>",
"request_id": "<string>"
}{
"detail": "<unknown>",
"request_id": "<string>"
}{
"detail": "<unknown>",
"request_id": "<string>"
}{
"detail": "<unknown>",
"request_id": "<string>"
}{
"detail": "<unknown>",
"request_id": "<string>"
}Authorizations
Your Bespoke Labs API key.
Body
application/json
Typed questions about text or JSON.
The text or JSON to ask about. Nimble reads a JSON state as JSON text.
Your question IDs mapped to questions. The answers use the same IDs.
Show child attributes
Show child attributes
nimble-latest currently points to nimble-v4-max, and it will move to newer models as they are released. nimble-v4 is deprecated and points to nimble-v4-max. nimble-v3 is deprecated. The response repeats the model name from the request.
Available options:
nimble-latest, nimble-v4-max, nimble-v4, nimble-v3