# Proxy servers with Pinecone?

**URL:** <https://community.pinecone.io/t/proxy-servers-with-pinecone/287>\
**Category:** Support\
**Created:** [March 7, 2022, 7:26pm UTC](https://community.pinecone.io/t/proxy-servers-with-pinecone/287 "2022-03-07T19:26:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sophiem](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@sophiem](https://community.pinecone.io/u/sophiem)\
**Post date:** [March 7, 2022, 7:26pm UTC](https://community.pinecone.io/t/proxy-servers-with-pinecone/287/1 "2022-03-07T19:26:27Z")

</div>

A customer question: My team is looking into using Pinecone as a vector database. However, your python code doesn’t allow for passing in a proxy server. Would you be willing to add in the ability to pass in a proxy as an argument within pinecone.init()?

---

<div class="post-metadata">

**Author:** ![rajat](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/rajat/32/3037_2.png) [@rajat](https://community.pinecone.io/u/rajat)\
**Post date:** [March 7, 2022, 7:30pm UTC](https://community.pinecone.io/t/proxy-servers-with-pinecone/287/2 "2022-03-07T19:30:35Z")

</div>

Yes, we can pass a proxy via `pinecone.init()`. Since our REST client is based on an OpenAPI spec, you can pass your own OpenAPI configuration and modify defaults, including proxies. Here is an example to use an insecure local proxy running on my system:

```auto
from pinecone.core.client.configuration import Configuration as OpenApiConfiguration

openapi_config = OpenApiConfiguration.get_default_copy()
# Here I am trying to connect to an insecure local proxy at 0.0.0.0:8081, 
#however you can keep the verify_ssl=True if you are using a secure connection
openapi_config.verify_ssl = False
openapi_config.proxy = "http://0.0.0.0:8081"
pinecone.init(api_key="API_KEY",openapi_config=openapi_config)
index = pinecone.Index("test")
print(index.describe_index_stats())

```

Note: This is only configurable for the REST client as of now, we will add similar support for gRPC soon.

---

<div class="post-metadata">

**Author:** ![bendavidthomas](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@bendavidthomas](https://community.pinecone.io/u/bendavidthomas)\
**Post date:** [February 10, 2024, 11:33pm UTC](https://community.pinecone.io/t/proxy-servers-with-pinecone/287/3 "2024-02-10T23:33:16Z")

</div>

Hello! How would we do this with the new API?  
I’m trying to update an old project which used a proxy but I can’t figure out how to pass this argument in the new configuration.

---

<div class="post-metadata">

**Author:** ![pallavi.jaini](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/pallavi.jaini/32/2237_2.png) [@pallavi.jaini](https://community.pinecone.io/u/pallavi.jaini)\
**Post date:** [March 7, 2024, 9:11pm UTC](https://community.pinecone.io/t/proxy-servers-with-pinecone/287/4 "2024-03-07T21:11:53Z")

</div>

Are you able to set the proxy with the new API. Looking for the same info.

@rajat - any suggestions as you have helped with the original query of this post

---

<div class="post-metadata">

**Author:** ![patrick1](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/patrick1/32/1863_2.png) [@patrick1](https://community.pinecone.io/u/patrick1)\
**Post date:** [March 22, 2024, 11:25am UTC](https://community.pinecone.io/t/proxy-servers-with-pinecone/287/5 "2024-03-22T11:25:46Z")

</div>

Version 3 of the python SDK had a issue with proxies, where the `openapi_config` was not being passed down to the data connection. Leading to a number of different errors, like timeouts and To be honest we never expected users to be using the `openapi_config`.

The good news is that we have made proxy a top level feature in [v3.2.0](https://github.com/pinecone-io/pinecone-python-client/releases/tag/v3.2.0). There is no need to touch the `openapi_config`.

The recommended way to use a proxy with the Python SDK client is:

```python
from pinecone import Pinecone
import urllib3 import make_headers

pc = Pinecone(
    api_key="YOUR_API_KEY",
    proxy_url='https://your-proxy.com',
    proxy_headers=make_headers(proxy_basic_auth='username:password'),
    ssl_ca_certs='path/to/cert-bundle.pem'
)

pc.list_indexes()

```
