curl --request POST \
--url https://chat-api.you.com/smart \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"query": "<string>",
"chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instructions": "<string>"
}
'import requests
url = "https://chat-api.you.com/smart"
payload = {
"query": "<string>",
"chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instructions": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
chat_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
instructions: '<string>'
})
};
fetch('https://chat-api.you.com/smart', 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://chat-api.you.com/smart",
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([
'query' => '<string>',
'chat_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'instructions' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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://chat-api.you.com/smart"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"chat_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"instructions\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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://chat-api.you.com/smart")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"chat_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"instructions\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://chat-api.you.com/smart")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"chat_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"instructions\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"answer": "A solar eclipse occurs when the Moon passes between the Sun and Earth, casting a shadow on Earth and blocking the Sun's light either partially or completely ...",
"search_results": [
{
"url": "https://en.wikipedia.org/wiki/Solar_eclipse",
"name": "Solar eclipse - Wikipedia",
"snippet": "A solar eclipse occurs when the Moon passes between Earth and the Sun, thereby obscuring the view of the Sun from a small part of Earth, totally or partially. Such an alignment occurs approximately every six months, during the eclipse season in its new moon phase, when the Moon's orbital plane is closest to the plane of Earth's orbit.\nIn partial and annular eclipses, only part of the Sun is obscured. Unlike a lunar eclipse, which may be viewed from anywhere on the night side of Earth, a solar eclipse can only be viewed from a relatively small area of the world. As such, although total solar eclipses occur somewhere on Earth every 18 months on average, they recur at any given place only once every 360 to 410 years.\nIf the Moon were in a perfectly circular orbit and in the same orbital plane as Earth, there would be total solar eclipses once a month, at every new moon. Instead, because the Moon's orbit is tilted at about 5 degrees to Earth's orbit, its shadow usually misses Earth ..."
}
]
}Smart API (Legacy)
curl --request POST \
--url https://chat-api.you.com/smart \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"query": "<string>",
"chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instructions": "<string>"
}
'import requests
url = "https://chat-api.you.com/smart"
payload = {
"query": "<string>",
"chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instructions": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
chat_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
instructions: '<string>'
})
};
fetch('https://chat-api.you.com/smart', 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://chat-api.you.com/smart",
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([
'query' => '<string>',
'chat_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'instructions' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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://chat-api.you.com/smart"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"chat_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"instructions\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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://chat-api.you.com/smart")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"chat_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"instructions\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://chat-api.you.com/smart")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"chat_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"instructions\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"answer": "A solar eclipse occurs when the Moon passes between the Sun and Earth, casting a shadow on Earth and blocking the Sun's light either partially or completely ...",
"search_results": [
{
"url": "https://en.wikipedia.org/wiki/Solar_eclipse",
"name": "Solar eclipse - Wikipedia",
"snippet": "A solar eclipse occurs when the Moon passes between Earth and the Sun, thereby obscuring the view of the Sun from a small part of Earth, totally or partially. Such an alignment occurs approximately every six months, during the eclipse season in its new moon phase, when the Moon's orbital plane is closest to the plane of Earth's orbit.\nIn partial and annular eclipses, only part of the Sun is obscured. Unlike a lunar eclipse, which may be viewed from anywhere on the night side of Earth, a solar eclipse can only be viewed from a relatively small area of the world. As such, although total solar eclipses occur somewhere on Earth every 18 months on average, they recur at any given place only once every 360 to 410 years.\nIf the Moon were in a perfectly circular orbit and in the same orbital plane as Earth, there would be total solar eclipses once a month, at every new moon. Instead, because the Moon's orbit is tilted at about 5 degrees to Earth's orbit, its shadow usually misses Earth ..."
}
]
}Authorizations
A unique API Key required to authorize API access. Ensure it is kept confidential. Get a free API Key at you.com/platform.
Body
The main question or statement to be answered. This input directs the scope and context of the response.
A hexadecimal UUID to maintain continuity within the conversation. This can be a randomly generated string that uniquely identifies the session.
Custom commands that allow you to tailor the responses to meet specific requirements or preferences. By providing detailed instructions, you can control the assistant’s tone, style, format, depth of information, and other response characteristics. This enables you to customize responses for different audiences, contexts, or purposes. Instructions up to 2.5K characters are supported by default. For longer instructions—up to 25K characters—custom pricing is available upon request at api@you.com.
Response
A JSON object containing a dictionary with the answer and a list of search results
The main response generated by the API based on the provided query and instructions.
"A solar eclipse occurs when the Moon passes between the Sun and Earth, casting a shadow on Earth and blocking the Sun's light either partially or completely ..."
Show child attributes
Show child attributes