POST
/
chat
/
{assistant_name}
/
chat
/
completions
# To use the Python SDK, install the plugin:
# pip install --upgrade pinecone pinecone-plugin-assistant

from pinecone import Pinecone
from pinecone_plugins.assistant.models.chat import Message

pc = Pinecone(api_key="YOUR_API_KEY")

# Get your assistant.
assistant = pc.assistant.Assistant(
    assistant_name="example-assistant", 
)

# Chat with the assistant.
chat_context = [Message(role="user", content="What is the maximum height of a red pine?")]
response = assistant.chat_completions(messages=chat_context)
{"chat_completion":
  {
    "id":"chatcmpl-9OtJCcR0SJQdgbCDc9JfRZy8g7VJR",
    "choices":[
      {
        "finish_reason":"stop",
        "index":0,
        "message":{
          "role":"assistant",
          "content":"The maximum height of a red pine (Pinus resinosa) is up to 25 meters."
        }
      }
    ],
    "model":"my_assistant"
  }
}
# To use the Python SDK, install the plugin:
# pip install --upgrade pinecone pinecone-plugin-assistant

from pinecone import Pinecone
from pinecone_plugins.assistant.models.chat import Message

pc = Pinecone(api_key="YOUR_API_KEY")

# Get your assistant.
assistant = pc.assistant.Assistant(
    assistant_name="example-assistant", 
)

# Chat with the assistant.
chat_context = [Message(role="user", content="What is the maximum height of a red pine?")]
response = assistant.chat_completions(messages=chat_context)
{"chat_completion":
  {
    "id":"chatcmpl-9OtJCcR0SJQdgbCDc9JfRZy8g7VJR",
    "choices":[
      {
        "finish_reason":"stop",
        "index":0,
        "message":{
          "role":"assistant",
          "content":"The maximum height of a red pine (Pinus resinosa) is up to 25 meters."
        }
      }
    ],
    "model":"my_assistant"
  }
}

Authorizations

Api-Key
string
header
required

Pinecone API Key

Path Parameters

assistant_name
string
required

The name of the assistant to be described.

Body

application/json

The desired configuration to chat an assistant.

The list of queries / chats to chat an assistant

messages
object[]
required
stream
boolean
default:false

If false, the assistant will return a single JSON response. If true, the assistant will return a stream of responses.

model
enum<string>
default:gpt-4o

The large language model to use for answer generation

Available options:
gpt-4o,
gpt-4.1,
o4-mini,
claude-3-5-sonnet,
claude-3-7-sonnet,
gemini-2.5-pro
temperature
number
default:0

Controls the randomness of the model's output: lower values make responses more deterministic, while higher values increase creativity and variability. If the model does not support a temperature parameter, the parameter will be ignored.

filter
object

Optionally filter which documents can be retrieved using the following metadata fields.

Example:
{ "genre": { "$ne": "documentary" } }

Response

Search request successful.

The ChatCompletionModel describes the response format of a chat request.

id
string
choices
object[]
model
string
usage
object

The UsageModel describes the usage of a chat completion.