AI Instruction
curl --request POST \
--url https://api.personal.ai/v1/instruction \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"Text": "<string>",
"Context": "<string>",
"DomainName": "<string>",
"UserName": "<string>",
"SessionId": "<string>",
"SourceName": "<string>",
"is_message": true
}
'import requests
url = "https://api.personal.ai/v1/instruction"
payload = {
"Text": "<string>",
"Context": "<string>",
"DomainName": "<string>",
"UserName": "<string>",
"SessionId": "<string>",
"SourceName": "<string>",
"is_message": True
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
Text: '<string>',
Context: '<string>',
DomainName: '<string>',
UserName: '<string>',
SessionId: '<string>',
SourceName: '<string>',
is_message: true
})
};
fetch('https://api.personal.ai/v1/instruction', 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.personal.ai/v1/instruction",
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([
'Text' => '<string>',
'Context' => '<string>',
'DomainName' => '<string>',
'UserName' => '<string>',
'SessionId' => '<string>',
'SourceName' => '<string>',
'is_message' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"x-api-key: <x-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.personal.ai/v1/instruction"
payload := strings.NewReader("{\n \"Text\": \"<string>\",\n \"Context\": \"<string>\",\n \"DomainName\": \"<string>\",\n \"UserName\": \"<string>\",\n \"SessionId\": \"<string>\",\n \"SourceName\": \"<string>\",\n \"is_message\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "<content-type>")
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.personal.ai/v1/instruction")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "<content-type>")
.body("{\n \"Text\": \"<string>\",\n \"Context\": \"<string>\",\n \"DomainName\": \"<string>\",\n \"UserName\": \"<string>\",\n \"SessionId\": \"<string>\",\n \"SourceName\": \"<string>\",\n \"is_message\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.personal.ai/v1/instruction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"Text\": \"<string>\",\n \"Context\": \"<string>\",\n \"DomainName\": \"<string>\",\n \"UserName\": \"<string>\",\n \"SessionId\": \"<string>\",\n \"SourceName\": \"<string>\",\n \"is_message\": true\n}"
response = http.request(request)
puts response.read_body{
"ai_message": "<string>",
"ai_score": 123,
"ai_name": "<string>",
"SessionId": "<string>",
"source_app": "<string>"
}Personal AI APIs
AI Instruction
Send instructions to your AI for specific actions
POST
/
v1
/
instruction
AI Instruction
curl --request POST \
--url https://api.personal.ai/v1/instruction \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"Text": "<string>",
"Context": "<string>",
"DomainName": "<string>",
"UserName": "<string>",
"SessionId": "<string>",
"SourceName": "<string>",
"is_message": true
}
'import requests
url = "https://api.personal.ai/v1/instruction"
payload = {
"Text": "<string>",
"Context": "<string>",
"DomainName": "<string>",
"UserName": "<string>",
"SessionId": "<string>",
"SourceName": "<string>",
"is_message": True
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
Text: '<string>',
Context: '<string>',
DomainName: '<string>',
UserName: '<string>',
SessionId: '<string>',
SourceName: '<string>',
is_message: true
})
};
fetch('https://api.personal.ai/v1/instruction', 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.personal.ai/v1/instruction",
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([
'Text' => '<string>',
'Context' => '<string>',
'DomainName' => '<string>',
'UserName' => '<string>',
'SessionId' => '<string>',
'SourceName' => '<string>',
'is_message' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"x-api-key: <x-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.personal.ai/v1/instruction"
payload := strings.NewReader("{\n \"Text\": \"<string>\",\n \"Context\": \"<string>\",\n \"DomainName\": \"<string>\",\n \"UserName\": \"<string>\",\n \"SessionId\": \"<string>\",\n \"SourceName\": \"<string>\",\n \"is_message\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "<content-type>")
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.personal.ai/v1/instruction")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "<content-type>")
.body("{\n \"Text\": \"<string>\",\n \"Context\": \"<string>\",\n \"DomainName\": \"<string>\",\n \"UserName\": \"<string>\",\n \"SessionId\": \"<string>\",\n \"SourceName\": \"<string>\",\n \"is_message\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.personal.ai/v1/instruction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"Text\": \"<string>\",\n \"Context\": \"<string>\",\n \"DomainName\": \"<string>\",\n \"UserName\": \"<string>\",\n \"SessionId\": \"<string>\",\n \"SourceName\": \"<string>\",\n \"is_message\": true\n}"
response = http.request(request)
puts response.read_body{
"ai_message": "<string>",
"ai_score": 123,
"ai_name": "<string>",
"SessionId": "<string>",
"source_app": "<string>"
}Overview
API endpoint for sending specific instructions to your AI. This endpoint allows you to interact with different AI models and execute specific commands.Authorization
string
required
Your Personal AI API key
Headers
string
required
Must be set to application/json
Query Parameters
string
required
- chatgpt
- search
Example
https://api.personal.ai/v1/instruction?cmd=chatgpt
Example
https://api.personal.ai/v1/instruction?cmd=search
Body
string
required
Text instruction to send to your AI
Example
"Text": "who is Einstein"
string
Additional context for the instruction
Example
"Context": "Respond in 2 sentences or less."
string
required
The hyphenated text below the AI’s name when clicked into a Persona.

Example
"DomainName": "product-demo-jebzrhw"
string
Name of the user sending the request
Example
"UserName": "Leila"
string
Session identifier for maintaining conversation context
Example
"SessionId": "d5e9f208-937c-4a9c-92bf-5fb90ce68ff6"
string
Source application name
Example
"SourceName": "slack"
boolean
Flag to indicate if the instruction should be treated as a message
Example
"is_message": true
Example Request
Example
{
"Text": "who is Einstein",
"Context": "Respond in two sentences or less.",
"DomainName": "product-demo-jebzrhw",
"UserName": "Leila",
"SessionId": "d5e9f208-937c-4a9c-92bf-5fb90ce68ff6",
"SourceName": "slack",
"is_message": true
}
Example Response
string
The AI’s response to the instruction
number
Confidence score of the AI’s response
string
The name given to the AI persona
string
The Id of the conversation that was passed or automatically generated
string
The source from which the request was initiated from as specified in the original API request
Example Success Response
{
"ai_message": "Einstein was a renowned physicist who developed the theory of relativity. He is considered one of the most influential scientists of the 20th century.",
"ai_score": 95.5,
"ai_name": "AI Name",
"SessionId": "d5e9f208-937c-4a9c-92bf-5fb90ce68ff6",
"source_app": "api"
}
Example cURL
cURL
curl --location 'https://api.personal.ai/v1/instruction?cmd=chatgpt' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <your-api-key>' \
--data '{
"Text": "who is Einstein",
"UserName": "Leila",
"DomainName": "product-demo-jebzrhw",
"SourceName": "slack",
"SessionId": "d5e9f208-937c-4a9c-92bf-5fb90ce68ff6",
"is_message": true
}'
Error Codes
| Code | Description |
|---|---|
| 403 | Forbidden - Check that API key is invalid |
| 503 | Processing Failure - Instruction could not be processed |
Example Error Response
{
"detail": "AI instruction api unauthorized."
}
⌘I