# API KEY Error while retrieving index

**URL:** <https://community.pinecone.io/t/api-key-error-while-retrieving-index/6803>\
**Category:** Support\
**Tags:** vector-database, error-401\
**Created:** [October 18, 2024, 6:16am UTC](https://community.pinecone.io/t/api-key-error-while-retrieving-index/6803 "2024-10-18T06:16:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nouman-Usman](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/nouman-usman/32/3371_2.png) [@Nouman-Usman](https://community.pinecone.io/u/Nouman-Usman)\
**Post date:** [October 18, 2024, 6:16am UTC](https://community.pinecone.io/t/api-key-error-while-retrieving-index/6803/1 "2024-10-18T06:16:54Z")

</div>

```auto
pinecone.core.openapi.shared.exceptions.UnauthorizedException: (401)

```

I keep getting this error even though I’ve double-checked my API numerous times.

---

<div class="post-metadata">

**Author:** ![jocelyn](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/jocelyn/32/1653_2.png) [@jocelyn](https://community.pinecone.io/u/jocelyn)\
**Post date:** [November 15, 2024, 7:17pm UTC](https://community.pinecone.io/t/api-key-error-while-retrieving-index/6803/2 "2024-11-15T19:17:43Z")

</div>

For a 401 Unauthorized error, here are some troubleshooting steps:

API Key Management:

- Verify the API key is valid for your project [1](https://docs.pinecone.io/guides/projects/manage-api-keys#change-api-key-permissions)
- If you suspect the key is compromised, delete it and generate a new one in the console
- Make sure you’re using the correct API key for the project containing your index

Check Permissions:

- Ensure your API key has the correct permissions for the operation you’re trying to perform

- For Standard/Enterprise plans, verify the specific permissions granted to the key

- API Key Creation Steps:

python

```auto
# To create a new API key:# 1. Open the Pinecone console# 2. Select your project# 3. Go to API keys# 4. Click Create API key# 5. Enter API key name# 6. Select permissions# 7. Click Create key# 8. Copy and save the key securely

```

If these steps don’t resolve the issue, you can:

- Double-check your firewall settings [Error: Handshake read failed when connecting - Pinecone Docs](https://docs.pinecone.io/troubleshooting/error-handshake-read-failed)
- Verify your internet connection is working properly
- Check for any code misconfigurations
