curl --request POST \
--url https://api.you.com/v1/agents/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent": "advanced",
"input": "You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it"
}
'import requests
url = "https://api.you.com/v1/agents/runs"
payload = {
"agent": "advanced",
"input": "You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent: 'advanced',
input: 'You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it'
})
};
fetch('https://api.you.com/v1/agents/runs', 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.you.com/v1/agents/runs",
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([
'agent' => 'advanced',
'input' => 'You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.you.com/v1/agents/runs"
payload := strings.NewReader("{\n \"agent\": \"advanced\",\n \"input\": \"You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.you.com/v1/agents/runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent\": \"advanced\",\n \"input\": \"You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.you.com/v1/agents/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent\": \"advanced\",\n \"input\": \"You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it\"\n}"
response = http.request(request)
puts response.read_body{
"output": [
{
"type": "chat_node.answer",
"text": "What Engineers Need to Know. **Key Takeaway:** Microplastics are tiny plastic particles that are pervasive in the environment and can enter the human body through various [...]",
"content": "You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it",
"agent": "advanced"
}
]
}{
"errors": [
{
"status": "400",
"code": "bad_request",
"title": "Invalid request body",
"detail": "The field 'tools' must be an array of objects."
}
]
}{
"errors": [
{
"status": "401",
"code": "unauthorized",
"title": "Unauthorized",
"detail": "Missing or invalid Authorization header. Use 'Authorization: Bearer <API_KEY>'."
}
]
}{
"errors": [
{
"status": "403",
"code": "tool_not_allowed",
"title": "Tool not allowed",
"detail": "You are not allowed to use the requested tool for this agent or tenant."
}
]
}Advanced Agent (Beta)
curl --request POST \
--url https://api.you.com/v1/agents/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent": "advanced",
"input": "You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it"
}
'import requests
url = "https://api.you.com/v1/agents/runs"
payload = {
"agent": "advanced",
"input": "You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent: 'advanced',
input: 'You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it'
})
};
fetch('https://api.you.com/v1/agents/runs', 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.you.com/v1/agents/runs",
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([
'agent' => 'advanced',
'input' => 'You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.you.com/v1/agents/runs"
payload := strings.NewReader("{\n \"agent\": \"advanced\",\n \"input\": \"You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.you.com/v1/agents/runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent\": \"advanced\",\n \"input\": \"You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.you.com/v1/agents/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent\": \"advanced\",\n \"input\": \"You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it\"\n}"
response = http.request(request)
puts response.read_body{
"output": [
{
"type": "chat_node.answer",
"text": "What Engineers Need to Know. **Key Takeaway:** Microplastics are tiny plastic particles that are pervasive in the environment and can enter the human body through various [...]",
"content": "You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it",
"agent": "advanced"
}
]
}{
"errors": [
{
"status": "400",
"code": "bad_request",
"title": "Invalid request body",
"detail": "The field 'tools' must be an array of objects."
}
]
}{
"errors": [
{
"status": "401",
"code": "unauthorized",
"title": "Unauthorized",
"detail": "Missing or invalid Authorization header. Use 'Authorization: Bearer <API_KEY>'."
}
]
}{
"errors": [
{
"status": "403",
"code": "tool_not_allowed",
"title": "Tool not allowed",
"detail": "You are not allowed to use the requested tool for this agent or tenant."
}
]
}Description
This endpoint engages advanced agents that use tools, multi-turn reasoning, and planning to solve complex queries. The agents break down each query into a workflow, execute the steps iteratively, and reflect on the findings before generating a final response.Authorizations
The unique API Key required to authorize API access. Learn how to get yours in the “Get your API key” section of the documentation.
Body
The agent mode that will be used to execute your request. This parameter must be set as 'advanced'.
The input for the agent. This can be a query or a prompt.
"You are a biologist studying the impacts of microplastics. Explain what microplastics are to a group of engineers, explain the impacts of microplastics on the body, and what the common source and dosage of microplastics are. High-light what a safe dosage might be and how to achieve it"
When set to "true", it will enable SSE (server side events) response. This is useful if you want to stream the response to your applications (e.g., with chatbots). Currently, only "true" is supported.
Add tools the system can call to expand its capabilities, providing more precise answers to the input query. See Research Tool and Compute Tool for more details.
Show child attributes
Show child attributes
Controls the level of detail provided by the agent's response. Choosing high maps to a long-form report while medium maps to a medium verbosity report that captures most details but less comprehensive
medium, high Manages the parameters that control how the agent orchestrates and executes the workflow to answer your query. Adjust its settings to balance between response quality, thoroughness, and speed.
Show child attributes
Show child attributes
Response
Inference response in application/json or text/event-stream format.
Show child attributes
Show child attributes