Skip to main content
Pinecone Docs

Search documentation

Type to search this documentation.

On this pageOverview

Authentication

Assistant API authentication with API keys, HTTP headers, and SDK client initialization for Pinecone Assistant requests and RAG apps.

All requests to the Pinecone Assistant API must contain a valid API key for the target project.

Create a new API key in the Pinecone console, or use the connect widget below to generate a key.

Copy your generated key:

PINECONE_API_KEY="{{YOUR_API_KEY}}"

# This API key has ReadWrite access to all indexes in your project.

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:

Python
# To use the Python SDK, install the plugin:
# pip install --upgrade pinecone pinecone-plugin-assistant

from pinecone import Pinecone

pc = 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" 
)
JavaScript
import { Pinecone } from '@pinecone-database/pinecone';

const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' });

// Creates an index using the API key stored in the client 'pc'.
const assistant = await pc.createAssistant({
  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
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"
}'
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu