# 403 Forbidden (Wrong API Key)

**URL:** <https://community.pinecone.io/t/403-forbidden-wrong-api-key/6624>\
**Category:** Support\
**Created:** [September 19, 2024, 7:03pm UTC](https://community.pinecone.io/t/403-forbidden-wrong-api-key/6624 "2024-09-19T19:03:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevinroy2015](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/kevinroy2015/32/3240_2.png) [@kevinroy2015](https://community.pinecone.io/u/kevinroy2015)\
**Post date:** [September 19, 2024, 7:03pm UTC](https://community.pinecone.io/t/403-forbidden-wrong-api-key/6624/1 "2024-09-19T19:03:22Z")

</div>

```auto
# Initialize Pinecone client
pc = Pinecone(
        api_key=KEY
    )

# Create or connect to an existing index
if NAME not in pc.list_indexes().names():
    pc.create_index(
        name=NAME ,
        dimension=1536,
        metric='cosine',
        spec=ServerlessSpec(cloud='aws', region='us-east-1')
    )
    while not pc.describe_index(index_name).status['ready']:
        time.sleep(1)
# Connect to the index
index = pinecone.Index(NAME , HOST)

```

This code here works I get no errors. The following line is where I get my error:

```auto
vectors = [(f'doc_{i}', embedding) for i, embedding in enumerate(document_embeddings)]
index.upsert(vectors)

```

Any idea what the 403 error might be related to?

---

<div class="post-metadata">

**Author:** ![ZacharyProser](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/zacharyproser/32/1146_2.png) [@ZacharyProser](https://community.pinecone.io/u/ZacharyProser)\
**Post date:** [September 20, 2024, 2:40pm UTC](https://community.pinecone.io/t/403-forbidden-wrong-api-key/6624/2 "2024-09-20T14:40:10Z")

</div>

Hi @kevinroy2015, and welcome to the Pinecone community forums!

Thank you for your question.

1. To confirm, you are able to see the list of Pinecone indexes in your current project returned successfully by the first code block you shared?
2. Could you please try creating a new project in [app.pinecone.io](http://app.pinecone.io) and using the API key from that new project - do you get the same result?

Best,  
Zack
