Brave AI Grounding API

Response Objects

# AIGroundingResponse

Response model for AI Grounding API request when stream is true.

FieldTypeRequiredDescription
modelstringtrue

The model to use for the chat completion. The value can be (default) or brave.

createdinttrue

The Unix timestamp (in seconds) of when the chat completion was created.

idstringtrue

A unique identifier for the chat completion. Each chunk has the same ID.

objectstringtrue

The object type, which is always chat.completion.

choiceslist [ ChoiceBlocking ]true

A list of chat completion choices. Can contain more than one elements if n is greater than 1. Can also be empty for the last chunk if you set stream_options: {“include_usage”: true}.

usageUsagefalse

The usage information for the request.

# ChoiceBlocking

A choice in the response.

FieldTypeRequiredDescription
indexinttrue

The index of the choice. Always 0 as there is only single choice.

messageChoiceMessagetrue

The message for the choice.

finish_reasonstringfalse

The reason the choice was finished. Either stop or length or null if not finished.

# ChoiceMessage

The message for the choice.

FieldTypeRequiredDescription
rolestringtrue

The role of the message. Always assistant.

contentstringfalse

The content of the message. Can be empty for the last chunk if you set stream_options: {“include_usage”: true}.

# Usage

The usage information for the request.

FieldTypeRequiredDescription
prompt_tokensinttrue

The number of tokens in the prompt.

completion_tokensinttrue

The number of tokens in the completion.

total_tokensinttrue

The total number of tokens in the request.

completion_tokens_detailsCompletionTokensDetailsfalse

The details of the completion tokens.

# CompletionTokensDetails

The details of the completion tokens.

FieldTypeRequiredDescription
reason_tokensintfalse

The number of reasoning tokens.