curl --request POST \
--url https://{subdomain}.domo.com/api/ai/v1/messages/chat \
--header 'Content-Type: application/json' \
--header 'X-DOMO-Developer-Token: <api-key>' \
--data '
{
"input": [
{
"role": "USER",
"content": [
{
"type": "TEXT",
"text": "Why is the sky blue?"
}
]
}
]
}
'import requests
url = "https://{subdomain}.domo.com/api/ai/v1/messages/chat"
payload = { "input": [
{
"role": "USER",
"content": [
{
"type": "TEXT",
"text": "Why is the sky blue?"
}
]
}
] }
headers = {
"X-DOMO-Developer-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-DOMO-Developer-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: [{role: 'USER', content: [{type: 'TEXT', text: 'Why is the sky blue?'}]}]
})
};
fetch('https://{subdomain}.domo.com/api/ai/v1/messages/chat', 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://{subdomain}.domo.com/api/ai/v1/messages/chat",
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([
'input' => [
[
'role' => 'USER',
'content' => [
[
'type' => 'TEXT',
'text' => 'Why is the sky blue?'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-DOMO-Developer-Token: <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://{subdomain}.domo.com/api/ai/v1/messages/chat"
payload := strings.NewReader("{\n \"input\": [\n {\n \"role\": \"USER\",\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"Why is the sky blue?\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-DOMO-Developer-Token", "<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://{subdomain}.domo.com/api/ai/v1/messages/chat")
.header("X-DOMO-Developer-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"input\": [\n {\n \"role\": \"USER\",\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"Why is the sky blue?\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.domo.com/api/ai/v1/messages/chat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-DOMO-Developer-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": [\n {\n \"role\": \"USER\",\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"Why is the sky blue?\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"content": [
{
"type": "TEXT",
"text": "The sky appears blue due to a phenomenon called Rayleigh scattering."
}
],
"modelId": "domo.domo_ai.domogpt-medium-v1.2:anthropic",
"isCustomerModel": false,
"sessionId": "e1f6a485-7fb6-4f71-b41c-37d6cb5f6bd3",
"requestId": "df2256fd-d133-4ea1-b958-295be09be7c1",
"stopReason": "END_TURN"
}"<string>"Process a chat messages request.
curl --request POST \
--url https://{subdomain}.domo.com/api/ai/v1/messages/chat \
--header 'Content-Type: application/json' \
--header 'X-DOMO-Developer-Token: <api-key>' \
--data '
{
"input": [
{
"role": "USER",
"content": [
{
"type": "TEXT",
"text": "Why is the sky blue?"
}
]
}
]
}
'import requests
url = "https://{subdomain}.domo.com/api/ai/v1/messages/chat"
payload = { "input": [
{
"role": "USER",
"content": [
{
"type": "TEXT",
"text": "Why is the sky blue?"
}
]
}
] }
headers = {
"X-DOMO-Developer-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-DOMO-Developer-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: [{role: 'USER', content: [{type: 'TEXT', text: 'Why is the sky blue?'}]}]
})
};
fetch('https://{subdomain}.domo.com/api/ai/v1/messages/chat', 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://{subdomain}.domo.com/api/ai/v1/messages/chat",
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([
'input' => [
[
'role' => 'USER',
'content' => [
[
'type' => 'TEXT',
'text' => 'Why is the sky blue?'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-DOMO-Developer-Token: <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://{subdomain}.domo.com/api/ai/v1/messages/chat"
payload := strings.NewReader("{\n \"input\": [\n {\n \"role\": \"USER\",\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"Why is the sky blue?\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-DOMO-Developer-Token", "<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://{subdomain}.domo.com/api/ai/v1/messages/chat")
.header("X-DOMO-Developer-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"input\": [\n {\n \"role\": \"USER\",\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"Why is the sky blue?\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.domo.com/api/ai/v1/messages/chat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-DOMO-Developer-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": [\n {\n \"role\": \"USER\",\n \"content\": [\n {\n \"type\": \"TEXT\",\n \"text\": \"Why is the sky blue?\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"content": [
{
"type": "TEXT",
"text": "The sky appears blue due to a phenomenon called Rayleigh scattering."
}
],
"modelId": "domo.domo_ai.domogpt-medium-v1.2:anthropic",
"isCustomerModel": false,
"sessionId": "e1f6a485-7fb6-4f71-b41c-37d6cb5f6bd3",
"requestId": "df2256fd-d133-4ea1-b958-295be09be7c1",
"stopReason": "END_TURN"
}"<string>"Authorizations
Body
Request for interacting with the chat message AI service.
The list of input messages to be processed by the AI.
Show child attributes
Show child attributes
The unique identifier for the AI session associated with this request.
System-level messages or configurations to guide the AI's response.
Show child attributes
Show child attributes
The identifier of the AI model to be used for generating a response.
Specific parameters or settings that configure the AI model behavior.
Show child attributes
Show child attributes
A parameter for controlling the randomness of the model's output.
The maximum number of tokens to generate in the response.
Model response format specification for structured outputs.
Show child attributes
Show child attributes
Configuration for reasoning behavior and effort level.
Show child attributes
Show child attributes
Response
Successful chat messages response.
Response from a Messages API.
The list of content generated by the model.
Text-based message content.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
Show child attributes
Show child attributes
The id of the model used to generate the response.
The id of the AI Session associated with this request.
The reason that the model stopped.
TOOL_USE, MAX_TOKENS, STOP_SEQUENCE, END_TURN, CONTENT_FILTERED, SAFETY, UNKNOWN The token usage from the model provider.
Show child attributes
Show child attributes