docs

a slatepencil documentail site

View on GitHub

API call failure

const OpenAI = require('openai')
const { HttpsProxyAgent } = require('https-proxy-agent')

const openai = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY,
  httpAgent: new HttpsProxyAgent(process.env.PROXY_URL)
});

const response = await openai.chat.completions.create({
    model: "gpt-3.5-turbo",
    messages: [],
    temperature: 0.5,
    max_tokens: 256,
});
// ERRROR ENCOUNTED:  Error: 502 Bad gateway.
// omit imports

const interview = "Create a list of 8 questions for an interview with a senior frontend web developer."

const response = await openai.chat.completions.create({
    model: "gpt-3.5-turbo",
    messages: [{role: 'user', content: interview}],
    temperature: 0.5,
    max_tokens: 256,
});
// ERRROR ENCOUNTED:  Error: 503 Service Unavailable.
// omit imports
const image = await openai.images.generate({ model: "dall-e-3", prompt: "A Yamaha-R1M motocycle on a racing loop" })
 console.log(image.data)
//ERRROR ENCOUNTED:   Error: 500 We were unable to process your prompt. Please try again later. You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID 25cec360c3b1db9385ae5898dbc47f53 in your message.)