Solutions
Junaid A
By adding this line my issues was fixed
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
I added above line of code in my , logic, where was calling api using httpclient example
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.openai.com/v1/chat...");
request.Headers.Add("Authorization", "Bearer sk-***********************************************");
var content = new StringContent("{\r\n \"model\": \"gpt-3.5-turbo\",\r\n \"messages\": [\r\n {\r\n \"role\": \"system\",\r\n \"content\": \"You are a helpful assistant.\"\r\n },\r\n {\r\n \"role\": \"user\",\r\n \"content\": \""+kw+"\"\r\n }\r\n ]\r\n }", null, "application/json");
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var r = await response.Content.ReadAsStringAsync();
// Console.WriteLine(response.Content);
var myDeserializedClass = JsonConvert.DeserializeObject<RootChat>(r);