When using a Pinecone SDK, initialize a client object with your API key and then reuse the authenicated client in subsquent function calls. For example:
Copy
# To use the Python SDK, install the plugin:# pip install --upgrade pinecone pinecone-plugin-assistantfrom pinecone import Pineconepc = Pinecone(api_key="YOUR_API_KEY")# Creates an assistant using the API key stored in the client 'pc'.assistant = pc.assistant.create_assistant( assistant_name="example-assistant", instructions="Use American English for spelling and grammar.", region="us")
All HTTP requests to the Pinecone Assistant API must contain an Api-Key header that specifies a valid API key and must be encoded as JSON with the Content-Type: application/json header. For example:
curl
Copy
PINECONE_API_KEY="YOUR_API_KEY"curl "https://api.pinecone.io/assistant/assistants" \ -H "Api-Key: $PINECONE_API_KEY" \ -H "Content-Type: application/json" \ -H "X-Pinecone-API-Version: 2025-01" \ -d '{ "name": "example-assistant", "instructions": "Use American English for spelling and grammar.", "region":"us"}'