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",
"object": "chat.completion.chunk",
"system_fingerprint": "<string>",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123,
"completion_tokens_details": {
"reasoning_tokens": 123
}
}
}Brave
Answers
Answers
POST
https://api.aisa.one
/
apis
/
v1
/
brave
/
chat
/
completions
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",
"object": "chat.completion.chunk",
"system_fingerprint": "<string>",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123,
"completion_tokens_details": {
"reasoning_tokens": 123
}
}
}请求规范
- 方法与路径: POST /apis/v1/brave/chat/completions
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/brave/chat/completions
{
"operationId": "any_brave_answer_apis_v1_brave_chat_completions",
"method": "POST",
"path": "/apis/v1/brave/chat/completions",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"properties": {
"country": {
"default": "us",
"title": "Country",
"type": "string"
},
"enable_citations": {
"default": false,
"description": "Whether to include inline citation tags in the answer. Requires <code>stream=true</code> and is not supported in research mode.",
"title": "Enable Citations",
"type": "boolean"
},
"enable_entities": {
"default": false,
"description": "Whether to include inline entity tags in the answer. Requires <code>stream=true</code> and is not supported in research mode.",
"title": "Enable Entities",
"type": "boolean"
},
"enable_research": {
"default": false,
"description": "Whether to answer with iterative deep research instead of a single search. Requires <code>stream=true</code>.",
"title": "Enable Research",
"type": "boolean"
},
"language": {
"default": "en",
"title": "Language",
"type": "string"
},
"max_completion_tokens": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Max Completion Tokens"
},
"messages": {
"description": "The conversation so far. Exactly one <code>user</code> message is supported, e.g. <code>[{"role": "user", "content": "Explain quantum computing"}]</code>.",
"items": {
"properties": {
"content": {
"title": "Content",
"type": "string"
},
"role": {
"const": "user",
"default": "user",
"enum": [
"user"
],
"title": "Role",
"type": "string"
}
},
"required": [
"content"
],
"title": "UserMessage",
"type": "object"
},
"maxItems": 1,
"minItems": 1,
"title": "Messages",
"type": "array"
},
"metadata": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"description": "Accepted for OpenAI SDK compatibility and currently ignored: the pairs are not stored or returned.",
"title": "Metadata"
},
"model": {
"default": "brave-pro",
"description": "Model ID used to generate the response.",
"enum": [
"brave-pro",
"brave"
],
"title": "Model",
"type": "string"
},
"research_allow_thinking": {
"default": true,
"description": "Accepted for compatibility. Ignored by the mixer engine behind this API, which always runs research with extended thinking off.",
"title": "Research Allow Thinking",
"type": "boolean"
},
"research_maximum_number_of_iterations": {
"default": 4,
"description": "Maximum number of research iterations.",
"maximum": 5,
"minimum": 1,
"title": "Research Maximum Number Of Iterations",
"type": "integer"
},
"research_maximum_number_of_queries": {
"default": 20,
"description": "Maximum number of search queries research mode may issue in total.",
"maximum": 50,
"minimum": 1,
"title": "Research Maximum Number Of Queries",
"type": "integer"
},
"research_maximum_number_of_results_per_query": {
"default": 30,
"description": "Maximum number of search results to consider per research query.",
"maximum": 60,
"minimum": 1,
"title": "Research Maximum Number Of Results Per Query",
"type": "integer"
},
"research_maximum_number_of_seconds": {
"default": 180,
"description": "Time budget for research, in seconds.",
"maximum": 300,
"minimum": 1,
"title": "Research Maximum Number Of Seconds",
"type": "integer"
},
"research_maximum_number_of_tokens_per_query": {
"default": 8192,
"description": "Maximum number of tokens to gather per research query.",
"maximum": 16384,
"minimum": 1024,
"title": "Research Maximum Number Of Tokens Per Query",
"type": "integer"
},
"safesearch": {
"default": "moderate",
"title": "Safesearch",
"type": "string"
},
"seed": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"description": "Accepted for OpenAI SDK compatibility and currently ignored: answers are not reproducible.",
"title": "Seed"
},
"stream": {
"default": true,
"title": "Stream",
"type": "boolean"
},
"web_search_options": {
"anyOf": [
{
"properties": {
"search_context_size": {
"anyOf": [
{
"enum": [
"low",
"medium",
"high"
],
"type": "string"
},
{
"type": "null"
}
],
"title": "Search Context Size"
},
"user_location": {
"anyOf": [
{
"properties": {
"approximate": {
"properties": {
"city": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "City"
},
"country": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Country"
},
"region": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Region"
},
"timezone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Timezone"
}
},
"title": "ApproximateUserLocation",
"type": "object"
},
"type": {
"const": "approximate",
"default": "approximate",
"enum": [
"approximate"
],
"title": "Type",
"type": "string"
}
},
"required": [
"approximate"
],
"title": "UserLocation",
"type": "object"
},
{
"type": "null"
}
]
}
},
"title": "WebSearchOptions",
"type": "object"
},
{
"type": "null"
}
]
}
},
"required": [
"messages"
],
"title": "OpenAIChatRequest",
"type": "object"
}
}
},
"description": "",
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
按实际用量收费。 默认请求预估费用:$0.012 USD。 最终费用以实际用量为准。 账户适用价格可能不同;支持报价的接口可按实际请求获取报价。授权
请求体
application/json
响应
Successful Response