Chat through the standard interface
The standard chat interface can return responses in three different formats:- Default response: The assistant returns a structured response and separate citation information.
- Streaming response: The assistant returns the response as a text stream.
- JSON response: The assistant returns the response as JSON key-value pairs.
Default response
The following example sends a message and requests a default response:The
content parameter in the request cannot be empty.JSON
Streaming response
Streaming responses can improve perceived latency by allowing users to see content as it’s generated, rather than waiting for the complete response. This creates a more responsive chat experience, especially for longer responses. The following example sends a message and requests a streaming response:The
content parameter in the request cannot be empty.- Message start: Includes
"role":"assistant", which indicates that the assistant is responding to the user’s message. - Content: Includes a value in the
contentfield (e.g.,"content":"The"), which is part of the assistant’s streamed response to the user’s message. - Citation: Includes a citation to the document that the assistant used to generate the response.
- Message end: Includes
"finish_reason":"stop", which indicates that the assistant has finished responding to the user’s message.
JSON response
The following example uses thejson_response parameter to instruct the assistant to return the response as JSON key-value pairs. This is useful if you need to parse the response programmatically.
JSON response cannot be used with the
stream parameter.Extract the response content
In the assistant’s response, the message string is contained in the following JSON object:message.contentfor the default chat responsedelta.contentfor the streaming chat responsemessage.contentfor the JSON response
- Default response
- Streaming response
- JSON response
Choose a model
Pinecone Assistant supports the following models:gpt-4o(default)gpt-4.1gpt-5o4-miniclaude-sonnet-4-5gemini-2.5-pro
Anthropic has deprecated the Claude 3.5 Sonnet and Claude 3.7 Sonnet models. Assistant automatically routes chat requests that specify
claude-3-5-sonnet or claude-3-7-sonnet to claude-sonnet-4-5 at the same price.model parameter in the request:
Provide conversation history
Models lack memory of previous requests, so any relevant messages from earlier in the conversation must be present in themessages object.
In the following example, the messages object includes prior messages that are necessary for interpreting the newest message.
Filter chat with metadata
You can filter which documents to use for chat completions. The following example filters the responses to use only documents that include the metadata"resource": "encyclopedia".
Control the context size
This is available in API versions
2025-04 and later.top_k * snippet_size. These parameters can be adjusted by setting context_options in the request:
snippet_size: Controls the max size of a snippet (default is 2048 tokens). Note that snippet size can vary and, in rare cases, may be bigger than the setsnippet_size. Snippet size controls the amount of context the model is given for each chunk of text.top_k: Controls the max number of context snippets sent to the LLM (default is 16).top_kcontrols the diversity of information sent to the model.
top_k and snippet_size can help manage token consumption.
Set the sampling temperature
This is available in API versions
2025-04 and later.temperarture parameter in the request. If a model does not support a temperature parameter, the parameter is ignored.
Include citation highlights in the response
Citation highlights are available in the Pinecone console or API versions
2025-04 and later.citation object. The object includes a reference to the document that the assistant used to generate the response. Additionally, you can include highlights, which are the specific parts of the document that the assistant used to generate the response, by setting the include_highlights parameter to true in the request:
curl
Enabling highlights will increase token usage.