OpenRouterTeam / openrouter-examples

Examples of integrating the OpenRouter API
https://openrouter.ai/docs
MIT License
76 stars 10 forks source link

i got SSLCertVerificationError #8

Open moamen270 opened 5 months ago

moamen270 commented 5 months ago

I'm attempting to utilize the Open Router API with Python's requests library. Occasionally, I encounter this error message:

HTTPSConnectionPool(host='openrouter.ai', port=443): 
Max retries exceeded with url: /api/v1/chat/completions 
(Caused by SSLError(SSLCertVerificationError
(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)')))

The API functions intermittently, sometimes succeeding and sometimes throwing an error despite using the same header and body.