Setting Up Pinecone Environment
1. Installing Pinecone Client
| Language | Package | Install Command |
| Python | pinecone v5+ | pip install pinecone |
| Python (gRPC) | pinecone[grpc] | pip install "pinecone[grpc]" |
| Node.js | @pinecone-database/pinecone v4+ | npm install @pinecone-database/pinecone |
| Java | io.pinecone:pinecone-client | Maven/Gradle dependency |
| Go | github.com/pinecone-io/go-pinecone | go get github.com/pinecone-io/go-pinecone/pinecone |
| .NET | Pinecone.NET | dotnet add package Pinecone.NET |
Note: Package renamed from pinecone-client to pinecone in v3.0. Uninstall the old package first to avoid conflicts.
2. Configuring API Key
| Method | Usage | Security Level |
| Env variable | export PINECONE_API_KEY="..." | Recommended |
| .env file | Load via python-dotenv / dotenv | Good (gitignore) |
| Secret manager | AWS Secrets Manager, GCP Secret Manager, Vault | Best (prod) |
| Hardcoded | Inline string literal | Never |
3. Initializing Pinecone Client
Example: Python Initialization
from pinecone import Pinecone
import os
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
indexes = pc.list_indexes()
Example: Node.js Initialization
import { Pinecone } from "@pinecone-database/pinecone";
const pc = new Pinecone({ apiKey: process.env.PINECONE_API_KEY! });
const indexes = await pc.listIndexes();
| Param | Description |
api_key | Required project API key |
pool_threads | Concurrent request workers (Python) |
source_tag | User-agent tag for tracking |
4. Setting Up Project and Environment
| Concept | Description |
| Project | Top-level container; one or more indexes, one API key per project |
| Organization | Billing + project grouping; multiple projects per org |
| Environment | Pod-based: region+cloud (e.g., us-east-1-aws). Serverless: implicit via index spec |
| API Key Scope | Scoped to a single project; cannot cross projects |
5. Verifying Connection
Example: Health Check
try:
indexes = pc.list_indexes()
print(f"Connected. Found {len(indexes.names())} indexes")
except Exception as e:
print(f"Connection failed: {e}")
| Check | API Call |
| List indexes | pc.list_indexes() |
| Describe index | pc.describe_index("name") |
| Stats | index.describe_index_stats() |
6. Configuring Timeout Settings
| Setting | Python | Default |
| Request timeout | Pinecone(api_key=..., pool_threads=30) | 20s |
| Index timeout | index.query(..., timeout=10) | None |
| Connection pool | pool_threads param | 30 |
7. Setting Up Proxy Configuration
Example: Proxy Setup (Python)
from pinecone import Pinecone
pc = Pinecone(
api_key="...",
proxy_url="http://proxy.corp.com:8080",
ssl_ca_certs="/path/to/ca-bundle.crt",
)
| Param | Description |
proxy_url | HTTP/HTTPS proxy URL with credentials |
ssl_ca_certs | Custom CA bundle for corporate proxies |
ssl_verify | Disable cert verification (dev only) |
8. Configuring Regional Endpoints
| Cloud | Regions (Serverless) |
| AWS | us-east-1, us-west-2, eu-west-1 |
| GCP | us-central1, europe-west4 |
| Azure | eastus2 |
9. Setting Up SSL/TLS Verification
Warning: Never disable SSL verification in production. Always use a proper CA bundle for corporate proxies.
| Setting | Use Case |
ssl_verify=True | Production (default) |
ssl_ca_certs="path" | Custom CA / corporate proxy |
ssl_verify=False | Local dev only UNSAFE |
10. Managing API Key Rotation
Rotation Steps
- Generate new API key in Pinecone console.
- Deploy new key to secret store (staging first).
- Restart services; verify health checks pass.
- Monitor old key usage (audit logs) for 24-48h.
- Revoke old key once traffic confirms zero usage.
| Frequency | Recommendation |
| Production | Every 90 days |
| After exposure | Immediate |
| Team offboarding | Immediate |