Skip to main content
POST
Answers

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
messages
UserMessage · object[]
必填

The conversation so far. Exactly one user message is supported, e.g. [{"role": "user", "content": "Explain quantum computing"}].

Required array length: 1 element
model
enum<string>
默认值:brave-pro

Model ID used to generate the response.

可用选项:
brave-pro,
brave
max_completion_tokens
integer | null
metadata
Metadata · object | null

Accepted for OpenAI SDK compatibility and currently ignored: the pairs are not stored or returned.

seed
integer | null

Accepted for OpenAI SDK compatibility and currently ignored: answers are not reproducible.

stream
boolean
默认值:true
web_search_options
WebSearchOptions · object | null
country
string
默认值:us
language
string
默认值:en
safesearch
string
默认值:moderate
enable_entities
boolean
默认值:false

Whether to include inline entity tags in the answer. Requires stream=true and is not supported in research mode.

enable_citations
boolean
默认值:false

Whether to include inline citation tags in the answer. Requires stream=true and is not supported in research mode.

enable_research
boolean
默认值:false

Whether to answer with iterative deep research instead of a single search. Requires stream=true.

research_allow_thinking
boolean
默认值:true

Accepted for compatibility. Ignored by the mixer engine behind this API, which always runs research with extended thinking off.

research_maximum_number_of_tokens_per_query
integer
默认值:8192

Maximum number of tokens to gather per research query.

必填范围: 1024 <= x <= 16384
research_maximum_number_of_queries
integer
默认值:20

Maximum number of search queries research mode may issue in total.

必填范围: 1 <= x <= 50
research_maximum_number_of_iterations
integer
默认值:4

Maximum number of research iterations.

必填范围: 1 <= x <= 5
research_maximum_number_of_seconds
integer
默认值:180

Time budget for research, in seconds.

必填范围: 1 <= x <= 300
research_maximum_number_of_results_per_query
integer
默认值:30

Maximum number of search results to consider per research query.

必填范围: 1 <= x <= 60

响应

Successful Response

choices
ChoiceChunk · object[]
必填
created
integer
必填
id
string
必填
model
enum<string>
默认值:brave-pro
可用选项:
brave-pro,
brave
system_fingerprint
string | null
object
enum<string>
默认值:chat.completion.chunk
可用选项:
chat.completion.chunk
Allowed value: "chat.completion.chunk"
usage
OpenAIUsage · object | null