# Getting error 500/429 when setting up gpt3

**URL:** <https://community.openai.com/t/getting-error-500-429-when-setting-up-gpt3/18129>\
**Category:** Prompting\
**Created:** [May 15, 2022, 9:40pm UTC](https://community.openai.com/t/getting-error-500-429-when-setting-up-gpt3/18129 "2022-05-15T21:40:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![temurbakhriddinov](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/temurbakhriddinov/32/10171_2.png) [@temurbakhriddinov](https://community.openai.com/u/temurbakhriddinov)\
**Post date:** [May 15, 2022, 9:40pm UTC](https://community.openai.com/t/getting-error-500-429-when-setting-up-gpt3/18129/1 "2022-05-15T21:40:37Z")

</div>

I keep getting error 500 when trying to send a request through node/nextjs.

Though, the request goes through in curl.

for I.e.  
getting error 500 through this sample project:

> **[GitHub - harish-garg/nextjs-reactjs-gpt-3: GPT-3 Powered Serverless App using...](https://github.com/harish-garg/nextjs-reactjs-gpt-3)**
>
> GPT-3 Powered Serverless App using NextJS & React. Contribute to harish-garg/nextjs-reactjs-gpt-3 development by creating an account on GitHub.

error 429 through this quick start open ai project

> **[GitHub - openai/openai-quickstart-node: Node.js example app from the OpenAI...](https://github.com/openai/openai-quickstart-node)**
>
> Node.js example app from the OpenAI API quickstart tutorial - GitHub - openai/openai-quickstart-node: Node.js example app from the OpenAI API quickstart tutorial

Something might be wrong with my API key??

---

<div class="post-metadata">

**Author:** ![orlundokhubbard](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/orlundokhubbard/32/9295_2.png) [@orlundokhubbard](https://community.openai.com/u/orlundokhubbard)\
**Post date:** [August 29, 2022, 7:51pm UTC](https://community.openai.com/t/getting-error-500-429-when-setting-up-gpt3/18129/2 "2022-08-29T19:51:27Z")

</div>

Hey did you ever get this figured out? I’m running into the same issue.

---

<div class="post-metadata">

**Author:** ![anon2606434](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon2606434](https://community.openai.com/u/anon2606434)\
**Post date:** [August 30, 2022, 12:28am UTC](https://community.openai.com/t/getting-error-500-429-when-setting-up-gpt3/18129/3 "2022-08-30T00:28:19Z")

</div>

yes-- I think it was different in the documentation than how you actually access it.

I’m not currently using open ai, but if I remember it was like

res.status(200).json({ response: completion. **data**.choices[0].text })

---

<div class="post-metadata">

**Author:** ![orlundokhubbard](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/orlundokhubbard/32/9295_2.png) [@orlundokhubbard](https://community.openai.com/u/orlundokhubbard)\
**Post date:** [August 30, 2022, 12:32am UTC](https://community.openai.com/t/getting-error-500-429-when-setting-up-gpt3/18129/4 "2022-08-30T00:32:04Z")

</div>

Yes. that’s the current response. Is that the wrong response? Or should it be something else?

---

<div class="post-metadata">

**Author:** ![anon2606434](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon2606434](https://community.openai.com/u/anon2606434)\
**Post date:** [August 30, 2022, 12:53am UTC](https://community.openai.com/t/getting-error-500-429-when-setting-up-gpt3/18129/5 "2022-08-30T00:53:28Z")

</div>

this is wat i had way back when I used it

```auto

const { Configuration, OpenAIApi } = require('openai')

const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY,
})
const openai = new OpenAIApi(configuration)
let outputAmt = 0;

export default async function (
  req,
  res
) {
  let promptData = req.body.prompt
  let output = req.body.output
  let temp = req.body.temp

  if (output === 'short') {
    outputAmt = 700
  } else if (output === 'long') {
    outputAmt = 3000
  }

  const completion = await openai.createCompletion('text-davinci-002', {
    prompt: promptData,
    temperature: temp,
    max_tokens: outputAmt,
  })
  res.status(200).json({ response: completion.data.choices[0].text })
}

```

---

<div class="post-metadata">

**Author:** ![orlundokhubbard](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/orlundokhubbard/32/9295_2.png) [@orlundokhubbard](https://community.openai.com/u/orlundokhubbard)\
**Post date:** [August 30, 2022, 2:30am UTC](https://community.openai.com/t/getting-error-500-429-when-setting-up-gpt3/18129/6 "2022-08-30T02:30:53Z")

</div>

Oh yes, I have the same thing. How did you overcome the 500 error?

---

<div class="post-metadata">

**Author:** ![mukulmunjal](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/mukulmunjal/32/16904_2.png) [@mukulmunjal](https://community.openai.com/u/mukulmunjal)\
**Post date:** [January 6, 2023, 10:17am UTC](https://community.openai.com/t/getting-error-500-429-when-setting-up-gpt3/18129/7 "2023-01-06T10:17:37Z")

</div>

getting 429 and 503 from completion apis frequently any resolution?

---

<div class="post-metadata">

**Author:** ![benshums](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/benshums/32/28687_2.png) [@benshums](https://community.openai.com/u/benshums)\
**Post date:** [February 12, 2023, 3:14pm UTC](https://community.openai.com/t/getting-error-500-429-when-setting-up-gpt3/18129/8 "2023-02-12T15:14:27Z")

</div>

Same here… about 1 in 5 API calls returns a 500 or 429…

---

<div class="post-metadata">

**Author:** ![steven96813](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/steven96813/32/17591_2.png) [@steven96813](https://community.openai.com/u/steven96813)\
**Post date:** [February 21, 2023, 9:29am UTC](https://community.openai.com/t/getting-error-500-429-when-setting-up-gpt3/18129/9 "2023-02-21T09:29:07Z")

</div>

I’m getting error 500 suddenly now also, but it was working fine before.

Is this an error with the API, like “at capacity” or how ChatGPT often crashes? Or is this an error with the code?

---

<div class="post-metadata">

**Author:** ![curt.kennedy](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/curt.kennedy/32/709249_2.png) [@curt.kennedy](https://community.openai.com/u/curt.kennedy)\
**Post date:** [February 4, 2024, 6:49pm UTC](https://community.openai.com/t/getting-error-500-429-when-setting-up-gpt3/18129/10 "2024-02-04T18:49:55Z")

</div>


