The interact command launches a prompt for submitting questions to the AI assistant.
JSON Input Data Format
{
"id": string,
"prompt": string
}
id*
Specifies the ID of the instance.
prompt*
Defines the interaction text that will be sent to the AI assistant.
* Indicates a mandatory field. Code Snippets
Here are several code snippets provided for your direct use. Simply select your
preferred tool/language by clicking on it.
API Request
Copy
nexus --mode=cli \
--api=API_NAME \
--command=API_COMMAND \
--account=YOUR_ACCOUNT_ID \
--accesskey=YOUR_ACCESS_KEY \
--secretkey=YOUR_SECRET_KEY \
--data="{ \"id\": \"V7...\", \"prompt\": \"Hi, what is your name?\" }"
API Request
Copy
curl -X POST \
-H "x-access-account: YOUR_ACCOUNT_ID" \
-H "x-access-authorization: YOUR_ACCESS_KEY" \
-H "x-secret-key: YOUR_SECRET_KEY" \
-H "x-api: API_NAME" \
-H "x-api-command: API_COMMAND" \
-d "{ \"id\": \"V7...\", \"prompt\": \"Hi, what is your name?\" }" \
https://your_nexus_server_or_ip/api/v3/
API Request
Copy
const apiUrl = "https://your_nexus_server_or_ip/api/v3/";
//JSON data to be sent
const data = {
"id": "V7dcf7bce3-xxxx-xxxx-xxxx-7e49xxxxx1148",
"prompt": "Hi, what is your name?"
};
const requestOptions = {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-access-account": "YOUR_ACCOUNT_ID",
"x-access-authorization": "YOUR_ACCESS_KEY",
"x-secret-key": "YOUR_SECRET_KEY",
"x-api": "API_NAME",
"x-api-command": "API_COMMAND"
},
body: JSON.stringify(data),
};
fetch(apiUrl, requestOptions)
.then((response) => {
if (!response.ok) {
throw new Error("Connection error");
}
return response.json();
})
.then((data) => {
//process received JSON data
console.log(JSON.stringify(data, null, 4));
if (data.result == "OK") {
console.log("TASK SUCCESSFUL");
} else {
console.log("ERROR: " + data.message);
}
})
.catch((error) => {
console.log("Error: " + error);
});
API Request
Copy
import fetch from 'node-fetch';
/*
Using the following code as a workaround for self-signed certificate
errors is discouraged in production environments.
*/
process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;
const apiUrl = "https://your_nexus_server_or_ip/api/v3/";
//JSON data to be sent
const data = {
"id": "V7dcf7bce3-xxxx-xxxx-xxxx-7e49xxxxx1148",
"prompt": "Hi, what is your name?"
};
const requestOptions = {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-access-account": "YOUR_ACCOUNT_ID",
"x-access-authorization": "YOUR_ACCESS_KEY",
"x-secret-key": "YOUR_SECRET_KEY",
"x-api": "API_NAME",
"x-api-command": "API_COMMAND"
},
body: JSON.stringify(data),
};
fetch(apiUrl, requestOptions)
.then((response) => {
if (!response.ok) {
throw new Error("Connection error");
}
return response.json();
})
.then((data) => {
//process received JSON data
console.log(JSON.stringify(data, null, 4));
if (data.result == "OK") {
console.log("TASK SUCCESSFUL");
} else {
console.log("ERROR: " + data.message);
}
})
.catch((error) => {
console.log("Error: " + error);
});
API Request
Copy
import requests
apiUrl = "https://your_nexus_server_or_ip/api/v3/"
#JSON data to be sent
data = {
"id": "V7dcf7bce3-xxxx-xxxx-xxxx-7e49xxxxx1148",
"prompt": "Hi, what is your name?"
}
headers = {
"Content-Type": "application/json",
"x-access-account": "YOUR_ACCOUNT_ID",
"x-access-authorization": "YOUR_ACCESS_KEY",
"x-secret-key": "YOUR_SECRET_KEY",
"x-api": "API_NAME",
"x-api-command": "API_COMMAND"
}
###
# Using verify=False in the following code as a workaround for
# self-signed certificate errors is discouraged in production environments.
###
response = requests.post(apiUrl, headers=headers, json=data, verify=False)
#process received JSON data
ret = response.json()
print(ret)
if (ret['result'] == "OK"):
print("TASK SUCCESSFUL")
else:
print("ERROR: "+ret['message'])
API Request
Copy
require 'uri'
require 'net/http'
require 'json'
apiUrl = URI.parse("https://your_nexus_server_or_ip/api/v3/")
@data = {
"id": "V7dcf7bce3-xxxx-xxxx-xxxx-7e49xxxxx1148",
"prompt": "Hi, what is your name?"
}.to_json
http = Net::HTTP.new(apiUrl.host, apiUrl.port)
http.use_ssl = true
###
# Using OpenSSL::SSL::VERIFY_NONE in the following code as a workaround for
# self-signed certificate errors is discouraged in production environments.
###
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
req = Net::HTTP::Post.new(apiUrl, initheader = {'Content-Type' => 'application/json'})
req['x-access-account'] = 'YOUR_ACCOUNT_ID'
req['x-access-authorization'] = 'YOUR_ACCESS_KEY'
req['x-secret-key'] = 'YOUR_SECRET_KEY'
req['x-api'] = 'API_NAME'
req['x-api-command'] = 'API_COMMAND'
req.body = @data
#make the api request
res = http.request(req)
# process received JSON data
ret = JSON.parse(res.body)
puts ret
if ret["result"] == "OK"
puts "TASK SUCCESSFUL"
else
puts "ERROR: "+ret["message"]
end
Successful Response
{
"result": "OK",
"payload": {
"result": "OK",
"payload": "{\"model\":\"apicaller:latest\",\"created_at\":\"2025-06-20T05:43:50.61446401Z\",\"response\":\"\\u003cthink\\u003e\\nOkay, the user asked, \\\"Hi, What is your name?\\\" I need to respond appropriately.\\n\\nFirst, I should acknowledge their greeting. Since I'm a language model, I can't have a name, but I can say I'm Ingenia. Then, I should ask them to confirm or provide more information. It's good to keep the conversation friendly and open-ended. Let me make sure the response is polite and helpful.\\n\\u003c/think\\u003e\\n\\nHello! My name is Ingenia. How can I assist you today? 😊\",\"done\":true,\"done_reason\":\"stop\",\"context\":[151644,8948,1406,334,16899,14,17,16,3070,374,8241,8975,3516,198,151645,198,151644,77091,271,13936,0,358,1079,94468,685,11,1128,646,358,1492,498,448,5267,151645,198,151644,872,198,13048,11,3555,374,697,829,30,151645,198,151644,77091,198,151667,198,32313,11,279,1196,4588,11,330,13048,11,3555,374,697,829,7521,358,1184,311,5889,34901,382,5338,11,358,1265,24645,862,42113,13,8704,358,2776,264,4128,1614,11,358,646,944,614,264,829,11,714,358,646,1977,358,2776,94468,685,13,5005,11,358,1265,2548,1105,311,7683,476,3410,803,1995,13,1084,594,1661,311,2506,279,10435,11657,323,1787,83075,13,6771,752,1281,2704,279,2033,374,47787,323,10950,624,151668,271,9707,0,3017,829,374,94468,685,13,2585,646,358,7789,498,3351,30,26525,232],\"total_duration\":6784799823,\"load_duration\":3388542442,\"prompt_eval_count\":50,\"prompt_eval_duration\":475431500,\"eval_count\":109,\"eval_duration\":2919481793}"
}
}