Skip to main content
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
}
'
{
  "ai_message": "<string>",
  "ai_score": 123,
  "ai_name": "<string>",
  "SessionId": "<string>",
  "source_app": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.personal.ai/llms.txt

Use this file to discover all available pages before exploring further.

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

x-api-key
string
required
Your Personal AI API key

Headers

Content-Type
string
required
Must be set to application/json

Query Parameters

cmd
string
required
  • chatgpt
  • search
Example
    https://api.personal.ai/v1/instruction?cmd=chatgpt
Example
    https://api.personal.ai/v1/instruction?cmd=search

Body

Text
string
required
Text instruction to send to your AI
Example
    "Text": "who is Einstein"
Context
string
Additional context for the instruction
Example
    "Context": "Respond in 2 sentences or less."
DomainName
string
required
The hyphenated text below the AI’s name when clicked into a Persona.DomainName
Example
    "DomainName": "product-demo-jebzrhw"
UserName
string
Name of the user sending the request
Example
    "UserName": "Leila"
SessionId
string
Session identifier for maintaining conversation context
Example
    "SessionId": "d5e9f208-937c-4a9c-92bf-5fb90ce68ff6"
SourceName
string
Source application name
Example
    "SourceName": "slack"
is_message
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

ai_message
string
The AI’s response to the instruction
ai_score
number
Confidence score of the AI’s response
ai_name
string
The name given to the AI persona
SessionId
string
The Id of the conversation that was passed or automatically generated
source_app
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

CodeDescription
403Forbidden - Check that API key is invalid
503Processing Failure - Instruction could not be processed
Example Error Response
{
    "detail": "AI instruction api unauthorized."
}