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"
}
]
}
'import requests
url = "https://api.aisa.one/apis/v1/brave/chat/completions"
payload = { "messages": [
{
"content": "<string>",
"role": "user"
}
] }
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'}]})
};
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'
]
]
]),
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}")
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}")
.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}"
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"
}
]
}
'import requests
url = "https://api.aisa.one/apis/v1/brave/chat/completions"
payload = { "messages": [
{
"content": "<string>",
"role": "user"
}
] }
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'}]})
};
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'
]
]
]),
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}")
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}")
.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}"
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
}
}
}Cost and request rules
Published reference values are not an account-specific quote or a settled charge. For endpoints supporting X-AISA-Cost-Mode: quote, obtain a free quote for your exact request before execution; reconcile the settled cost with response metadata and Usage Logs. USD amounts use 1,000,000 integer micro-USD per dollar.- Default request reference estimate (USD): 0.012
- Cost contract: response_usd
- Published reference multiplier: 1.0
- Settlement evidence source: response_header
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
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 <= 60Response
Successful Response
Show child attributes
Show child attributes
brave-pro, brave chat.completion.chunk "chat.completion.chunk"Show child attributes
Show child attributes