I am using the following demo code. bash:
curl https://api.pinecone.io/indexes
-H “Content-Type: application/json”
-H “Api-Key: $PINECONE_API_KEY”
-H “X-Pinecone-API-Version: 2025-01”
and got Invalid API Key
I also tried this demo code:
from pinecone.grpc import PineconeGRPC as Pinecone
from pinecone import ServerlessSpec
pc = Pinecone(api_key=‘###########################################################################’)
Creates an index using the API key stored in the client ‘pc’.
pc.create_index(
name=“docs-example”,
dimension=1536,
metric=“cosine”,
spec=ServerlessSpec(
cloud=‘aws’,
region=‘us-east-1’
)
)
I run that on my local machine and get:
pinecone.openapi_support.exceptions.UnauthorizedException: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({‘x-pinecone-api-version’: ‘2025-01’, ‘x-cloud-trace-context’: ‘########################’, ‘date’: ‘Fri, 16 May 2025 00:26:23 GMT’, ‘content-type’: ‘text/html’, ‘server’: ‘Google Frontend’, ‘Content-Length’: ‘15’, ‘Via’: ‘1.1 google’, ‘Alt-Svc’: ‘h3=“:443”; ma=2592000,h3-29=“:443”; ma=2592000’})
HTTP response body: Invalid API Key
I’ve tried with a few different API keys and keep getting invalid. I’m wondering if I’m either putting in the secret incorrectly or if the authentication is down or if there is another issue. Anyone have a workaround?