curl --request POST \
--url https://api.aisa.one/apis/v1/brave/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"content": "<string>",
"role": "user"
}
],
"model": "brave-pro",
"max_completion_tokens": 123,
"metadata": {},
"seed": 123,
"stream": true,
"web_search_options": {
"user_location": {
"approximate": {
"city": "<string>",
"country": "<string>",
"region": "<string>",
"timezone": "<string>"
},
"type": "approximate"
}
},
"country": "us",
"language": "en",
"safesearch": "moderate",
"enable_entities": false,
"enable_citations": false,
"enable_research": false,
"research_allow_thinking": true,
"research_maximum_number_of_tokens_per_query": 8192,
"research_maximum_number_of_queries": 20,
"research_maximum_number_of_iterations": 4,
"research_maximum_number_of_seconds": 180,
"research_maximum_number_of_results_per_query": 30
}
'import requests
url = "https://api.aisa.one/apis/v1/brave/chat/completions"
payload = {
"messages": [
{
"content": "<string>",
"role": "user"
}
],
"model": "brave-pro",
"max_completion_tokens": 123,
"metadata": {},
"seed": 123,
"stream": True,
"web_search_options": { "user_location": {
"approximate": {
"city": "<string>",
"country": "<string>",
"region": "<string>",
"timezone": "<string>"
},
"type": "approximate"
} },
"country": "us",
"language": "en",
"safesearch": "moderate",
"enable_entities": False,
"enable_citations": False,
"enable_research": False,
"research_allow_thinking": True,
"research_maximum_number_of_tokens_per_query": 8192,
"research_maximum_number_of_queries": 20,
"research_maximum_number_of_iterations": 4,
"research_maximum_number_of_seconds": 180,
"research_maximum_number_of_results_per_query": 30
}
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({
messages: [{content: '<string>', role: 'user'}],
model: 'brave-pro',
max_completion_tokens: 123,
metadata: {},
seed: 123,
stream: true,
web_search_options: {
user_location: {
approximate: {
city: '<string>',
country: '<string>',
region: '<string>',
timezone: '<string>'
},
type: 'approximate'
}
},
country: 'us',
language: 'en',
safesearch: 'moderate',
enable_entities: false,
enable_citations: false,
enable_research: false,
research_allow_thinking: true,
research_maximum_number_of_tokens_per_query: 8192,
research_maximum_number_of_queries: 20,
research_maximum_number_of_iterations: 4,
research_maximum_number_of_seconds: 180,
research_maximum_number_of_results_per_query: 30
})
};
fetch('https://api.aisa.one/apis/v1/brave/chat/completions', 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.aisa.one/apis/v1/brave/chat/completions",
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([
'messages' => [
[
'content' => '<string>',
'role' => 'user'
]
],
'model' => 'brave-pro',
'max_completion_tokens' => 123,
'metadata' => [
],
'seed' => 123,
'stream' => true,
'web_search_options' => [
'user_location' => [
'approximate' => [
'city' => '<string>',
'country' => '<string>',
'region' => '<string>',
'timezone' => '<string>'
],
'type' => 'approximate'
]
],
'country' => 'us',
'language' => 'en',
'safesearch' => 'moderate',
'enable_entities' => false,
'enable_citations' => false,
'enable_research' => false,
'research_allow_thinking' => true,
'research_maximum_number_of_tokens_per_query' => 8192,
'research_maximum_number_of_queries' => 20,
'research_maximum_number_of_iterations' => 4,
'research_maximum_number_of_seconds' => 180,
'research_maximum_number_of_results_per_query' => 30
]),
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.aisa.one/apis/v1/brave/chat/completions"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"brave-pro\",\n \"max_completion_tokens\": 123,\n \"metadata\": {},\n \"seed\": 123,\n \"stream\": true,\n \"web_search_options\": {\n \"user_location\": {\n \"approximate\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"region\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"type\": \"approximate\"\n }\n },\n \"country\": \"us\",\n \"language\": \"en\",\n \"safesearch\": \"moderate\",\n \"enable_entities\": false,\n \"enable_citations\": false,\n \"enable_research\": false,\n \"research_allow_thinking\": true,\n \"research_maximum_number_of_tokens_per_query\": 8192,\n \"research_maximum_number_of_queries\": 20,\n \"research_maximum_number_of_iterations\": 4,\n \"research_maximum_number_of_seconds\": 180,\n \"research_maximum_number_of_results_per_query\": 30\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.aisa.one/apis/v1/brave/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"brave-pro\",\n \"max_completion_tokens\": 123,\n \"metadata\": {},\n \"seed\": 123,\n \"stream\": true,\n \"web_search_options\": {\n \"user_location\": {\n \"approximate\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"region\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"type\": \"approximate\"\n }\n },\n \"country\": \"us\",\n \"language\": \"en\",\n \"safesearch\": \"moderate\",\n \"enable_entities\": false,\n \"enable_citations\": false,\n \"enable_research\": false,\n \"research_allow_thinking\": true,\n \"research_maximum_number_of_tokens_per_query\": 8192,\n \"research_maximum_number_of_queries\": 20,\n \"research_maximum_number_of_iterations\": 4,\n \"research_maximum_number_of_seconds\": 180,\n \"research_maximum_number_of_results_per_query\": 30\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/brave/chat/completions")
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 \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"brave-pro\",\n \"max_completion_tokens\": 123,\n \"metadata\": {},\n \"seed\": 123,\n \"stream\": true,\n \"web_search_options\": {\n \"user_location\": {\n \"approximate\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"region\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"type\": \"approximate\"\n }\n },\n \"country\": \"us\",\n \"language\": \"en\",\n \"safesearch\": \"moderate\",\n \"enable_entities\": false,\n \"enable_citations\": false,\n \"enable_research\": false,\n \"research_allow_thinking\": true,\n \"research_maximum_number_of_tokens_per_query\": 8192,\n \"research_maximum_number_of_queries\": 20,\n \"research_maximum_number_of_iterations\": 4,\n \"research_maximum_number_of_seconds\": 180,\n \"research_maximum_number_of_results_per_query\": 30\n}"
response = http.request(request)
puts response.read_body{
"choices": [
{
"delta": {
"content": "<string>",
"role": "assistant"
},
"finish_reason": "stop"
}
],
"created": 123,
"id": "<string>",
"model": "brave-pro",
"system_fingerprint": "<string>",
"object": "chat.completion.chunk",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123,
"completion_tokens_details": {
"reasoning_tokens": 123
}
}
}Answers
curl --request POST \
--url https://api.aisa.one/apis/v1/brave/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"content": "<string>",
"role": "user"
}
],
"model": "brave-pro",
"max_completion_tokens": 123,
"metadata": {},
"seed": 123,
"stream": true,
"web_search_options": {
"user_location": {
"approximate": {
"city": "<string>",
"country": "<string>",
"region": "<string>",
"timezone": "<string>"
},
"type": "approximate"
}
},
"country": "us",
"language": "en",
"safesearch": "moderate",
"enable_entities": false,
"enable_citations": false,
"enable_research": false,
"research_allow_thinking": true,
"research_maximum_number_of_tokens_per_query": 8192,
"research_maximum_number_of_queries": 20,
"research_maximum_number_of_iterations": 4,
"research_maximum_number_of_seconds": 180,
"research_maximum_number_of_results_per_query": 30
}
'import requests
url = "https://api.aisa.one/apis/v1/brave/chat/completions"
payload = {
"messages": [
{
"content": "<string>",
"role": "user"
}
],
"model": "brave-pro",
"max_completion_tokens": 123,
"metadata": {},
"seed": 123,
"stream": True,
"web_search_options": { "user_location": {
"approximate": {
"city": "<string>",
"country": "<string>",
"region": "<string>",
"timezone": "<string>"
},
"type": "approximate"
} },
"country": "us",
"language": "en",
"safesearch": "moderate",
"enable_entities": False,
"enable_citations": False,
"enable_research": False,
"research_allow_thinking": True,
"research_maximum_number_of_tokens_per_query": 8192,
"research_maximum_number_of_queries": 20,
"research_maximum_number_of_iterations": 4,
"research_maximum_number_of_seconds": 180,
"research_maximum_number_of_results_per_query": 30
}
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({
messages: [{content: '<string>', role: 'user'}],
model: 'brave-pro',
max_completion_tokens: 123,
metadata: {},
seed: 123,
stream: true,
web_search_options: {
user_location: {
approximate: {
city: '<string>',
country: '<string>',
region: '<string>',
timezone: '<string>'
},
type: 'approximate'
}
},
country: 'us',
language: 'en',
safesearch: 'moderate',
enable_entities: false,
enable_citations: false,
enable_research: false,
research_allow_thinking: true,
research_maximum_number_of_tokens_per_query: 8192,
research_maximum_number_of_queries: 20,
research_maximum_number_of_iterations: 4,
research_maximum_number_of_seconds: 180,
research_maximum_number_of_results_per_query: 30
})
};
fetch('https://api.aisa.one/apis/v1/brave/chat/completions', 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.aisa.one/apis/v1/brave/chat/completions",
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([
'messages' => [
[
'content' => '<string>',
'role' => 'user'
]
],
'model' => 'brave-pro',
'max_completion_tokens' => 123,
'metadata' => [
],
'seed' => 123,
'stream' => true,
'web_search_options' => [
'user_location' => [
'approximate' => [
'city' => '<string>',
'country' => '<string>',
'region' => '<string>',
'timezone' => '<string>'
],
'type' => 'approximate'
]
],
'country' => 'us',
'language' => 'en',
'safesearch' => 'moderate',
'enable_entities' => false,
'enable_citations' => false,
'enable_research' => false,
'research_allow_thinking' => true,
'research_maximum_number_of_tokens_per_query' => 8192,
'research_maximum_number_of_queries' => 20,
'research_maximum_number_of_iterations' => 4,
'research_maximum_number_of_seconds' => 180,
'research_maximum_number_of_results_per_query' => 30
]),
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.aisa.one/apis/v1/brave/chat/completions"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"brave-pro\",\n \"max_completion_tokens\": 123,\n \"metadata\": {},\n \"seed\": 123,\n \"stream\": true,\n \"web_search_options\": {\n \"user_location\": {\n \"approximate\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"region\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"type\": \"approximate\"\n }\n },\n \"country\": \"us\",\n \"language\": \"en\",\n \"safesearch\": \"moderate\",\n \"enable_entities\": false,\n \"enable_citations\": false,\n \"enable_research\": false,\n \"research_allow_thinking\": true,\n \"research_maximum_number_of_tokens_per_query\": 8192,\n \"research_maximum_number_of_queries\": 20,\n \"research_maximum_number_of_iterations\": 4,\n \"research_maximum_number_of_seconds\": 180,\n \"research_maximum_number_of_results_per_query\": 30\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.aisa.one/apis/v1/brave/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"brave-pro\",\n \"max_completion_tokens\": 123,\n \"metadata\": {},\n \"seed\": 123,\n \"stream\": true,\n \"web_search_options\": {\n \"user_location\": {\n \"approximate\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"region\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"type\": \"approximate\"\n }\n },\n \"country\": \"us\",\n \"language\": \"en\",\n \"safesearch\": \"moderate\",\n \"enable_entities\": false,\n \"enable_citations\": false,\n \"enable_research\": false,\n \"research_allow_thinking\": true,\n \"research_maximum_number_of_tokens_per_query\": 8192,\n \"research_maximum_number_of_queries\": 20,\n \"research_maximum_number_of_iterations\": 4,\n \"research_maximum_number_of_seconds\": 180,\n \"research_maximum_number_of_results_per_query\": 30\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/brave/chat/completions")
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 \"messages\": [\n {\n \"content\": \"<string>\",\n \"role\": \"user\"\n }\n ],\n \"model\": \"brave-pro\",\n \"max_completion_tokens\": 123,\n \"metadata\": {},\n \"seed\": 123,\n \"stream\": true,\n \"web_search_options\": {\n \"user_location\": {\n \"approximate\": {\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"region\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"type\": \"approximate\"\n }\n },\n \"country\": \"us\",\n \"language\": \"en\",\n \"safesearch\": \"moderate\",\n \"enable_entities\": false,\n \"enable_citations\": false,\n \"enable_research\": false,\n \"research_allow_thinking\": true,\n \"research_maximum_number_of_tokens_per_query\": 8192,\n \"research_maximum_number_of_queries\": 20,\n \"research_maximum_number_of_iterations\": 4,\n \"research_maximum_number_of_seconds\": 180,\n \"research_maximum_number_of_results_per_query\": 30\n}"
response = http.request(request)
puts response.read_body{
"choices": [
{
"delta": {
"content": "<string>",
"role": "assistant"
},
"finish_reason": "stop"
}
],
"created": 123,
"id": "<string>",
"model": "brave-pro",
"system_fingerprint": "<string>",
"object": "chat.completion.chunk",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123,
"completion_tokens_details": {
"reasoning_tokens": 123
}
}
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
The conversation so far. Exactly one user message is supported, e.g. [{"role": "user", "content": "Explain quantum computing"}].
1 elementShow child attributes
Show child attributes
Model ID used to generate the response.
brave-pro, brave Accepted for OpenAI SDK compatibility and currently ignored: the pairs are not stored or returned.
Show child attributes
Show child attributes
Accepted for OpenAI SDK compatibility and currently ignored: answers are not reproducible.
Show child attributes
Show child attributes
Whether to include inline entity tags in the answer. Requires stream=true and is not supported in research mode.
Whether to include inline citation tags in the answer. Requires stream=true and is not supported in research mode.
Whether to answer with iterative deep research instead of a single search. Requires stream=true.
Accepted for compatibility. Ignored by the mixer engine behind this API, which always runs research with extended thinking off.
Maximum number of tokens to gather per research query.
1024 <= x <= 16384Maximum number of search queries research mode may issue in total.
1 <= x <= 50Maximum number of research iterations.
1 <= x <= 5Time budget for research, in seconds.
1 <= x <= 300Maximum number of search results to consider per research query.
1 <= x <= 60响应
Successful Response
Show child attributes
Show child attributes
brave-pro, brave chat.completion.chunk "chat.completion.chunk"Show child attributes
Show child attributes