API Key Error (401)

I’m looking to work through James’ Haystack Tutorial Notebook: examples/haystack_lfqa.ipynb at master · pinecone-io/examples · GitHub

But I can’t get through the first step given the following error:

UnauthorizedException: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({‘www-authenticate’: ‘API key is missing or invalid for the environment “us-west1-gcp”. Check that the correct environment is specified.’, ‘content-length’: ‘114’, ‘date’: ‘Tue, 31 Jan 2023 12:37:56 GMT’, ‘server’: ‘envoy’})
HTTP response body: API key is missing or invalid for the environment “us-west1-gcp”. Check that the correct environment is specified.

For the following code block:

document_store = PineconeDocumentStore(
api_key=‘my api key’,
index=‘haystack-extractive-qa’,
similarity=“cosine”,
embedding_dim=384
)

I’ve used my API key in other projects without an issue, and to my understanding have all the other proper packages installed.

I’ve tried this with multiple API keys (>12 hours apart), and even created a new account to try a fresh API key. Does anyone know what the issue can be?

I figured it out:

The PineconeDocumentStore() function was missing: environment=“<<my_enviornment>>”

1 Like

Thanks Evan I was facing the same error and your solution saved me going through the documentation.

1 Like